gallium: added tgsi_num_tokens() function to return number of tokens in token array.
[mesa.git] / bin / mklib
index adc2b7f75f44a6d805ff2f5d0a0029557ead0625..8ee8d8ce49d0e629fddbc88a53e011408c9b2118 100755 (executable)
--- a/bin/mklib
+++ b/bin/mklib
@@ -100,6 +100,13 @@ do
        -L*)
            DEPS="$DEPS $1"
            ;;
+       -pthread)
+           # this is a special case (see bugzilla 10876)
+           DEPS="$DEPS $1"
+           ;;
+       '-pthread')
+           DEPS="$DEPS -pthread"
+           ;;
        '-cplusplus')
            CPLUSPLUS=1
            ;;
@@ -180,7 +187,7 @@ fi
 #
 case $ARCH in
 
-    'Linux' | 'OpenBSD')
+    'Linux' | 'OpenBSD' | 'GNU' | GNU/*)
        # we assume gcc
 
        if [ "x$LINK" = "x" ] ; then
@@ -212,22 +219,25 @@ case $ARCH in
             # finish up
             FINAL_LIBS="${LIBNAME}"
         elif [ $STATIC = 1 ] ; then
-           LIBNAME="lib${LIBNAME}"     # prefix with "lib"
-            echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a
+            LIBNAME="lib${LIBNAME}.a"     # prefix with "lib", suffix with ".a"
+            echo "mklib: Making" $ARCH "static library: " ${LIBNAME}
             LINK="ar"
             OPTS="-ru"
+            rm -f ${LIBNAME}
             # make lib
-            ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
-           ranlib ${LIBNAME}.a
+            ${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
+            ranlib ${LIBNAME}
             # finish up
-            FINAL_LIBS=${LIBNAME}.a
+            FINAL_LIBS=${LIBNAME}
         else
            LIBNAME="lib${LIBNAME}"     # prefix with "lib"
-           if [ $ARCH = 'Linux' ] ; then
+           case $ARCH in 'Linux' | 'GNU' | GNU/*)
                OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
-           else
+           ;;
+           *)
                OPTS="-shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
-           fi
+           ;;
+           esac
            if [ $EXPORTS ] ; then
                #OPTS="${OPTS} -Xlinker --retain-symbols-file ${EXPORTS}"
                # Make the 'exptmp' file for --version-script option
@@ -281,7 +291,9 @@ case $ARCH in
            ar -ruv ${LIBNAME} ${OBJECTS}
            FINAL_LIBS=${LIBNAME}
        else
-           LIBNAME="lib${LIBNAME}.so"
+           if [ $NOPREFIX = 0 ] ; then
+               LIBNAME="lib${LIBNAME}.so"
+           fi
            echo "mklib: Making SunOS shared library: " ${LIBNAME}
 
            if [ "x$LINK" = "x" ] ; then
@@ -331,9 +343,14 @@ case $ARCH in
 
            # for debug:
            #echo "mklib: linker is" ${LINK} ${OPTS}
-           rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
-           ${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
-           ln -s ${LIBNAME}.${MAJOR} ${LIBNAME}
+           if [ $NOPREFIX = 1 ] ; then
+               rm -f ${LIBNAME}
+               ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
+           else
+               rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
+               ${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
+               ln -s ${LIBNAME}.${MAJOR} ${LIBNAME}
+           fi
            FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}"
        fi
        ;;