tweak OpenBSD and SunOS commands
authorBrian Paul <brian.paul@tungstengraphics.com>
Sat, 17 Jan 2004 18:31:12 +0000 (18:31 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Sat, 17 Jan 2004 18:31:12 +0000 (18:31 +0000)
bin/mklib

index 984875f2f7e9e9acd3c5ba5586f0fed7555c3703..694a60bd17228bc632ce2e0bbd2a3cf31a41ad67 100755 (executable)
--- a/bin/mklib
+++ b/bin/mklib
@@ -114,7 +114,7 @@ case $ARCH in
        LIBNAME="lib${LIBNAME}"     # prefix with "lib"
 
         if [ $STATIC = 1 ] ; then
-            echo "mklib: Making Linux static library: " ${LIBNAME}.a
+            echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a
             LINK="ar"
             OPTS="-ruv"
             # make lib
@@ -122,7 +122,11 @@ case $ARCH in
             # finish up
             FINAL_LIBS="${LIBNAME}.a"
         else
-            OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
+           if [ $ARCH = 'Linux' ] ; then
+               OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
+           else
+               OPTS="-shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
+           fi
             VERSION="${MAJOR}.${MINOR}.${PATCH}"
 
             echo "mklib: Making " $ARCH " shared library: " ${LIBNAME}.so.${VERSION}
@@ -190,9 +194,10 @@ case $ARCH in
            OPTS="-G"
        fi
        echo "mklib: linker is" ${LINK} ${OPTS}
-       rm -f ${LIBNAME}
-       ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
-       FINAL_LIBS=${LIBNAME}
+       rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
+       ${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
+       ln -s ${LIBNAME}.${MAJOR} ${LIBNAME}
+       FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}"
        ;;
 
     'FreeBSD')