diff options
Diffstat (limited to 'bin/mklib')
-rwxr-xr-x | bin/mklib | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/bin/mklib b/bin/mklib index b207ade5e13..a0d6115f2ef 100755 --- a/bin/mklib +++ b/bin/mklib @@ -110,29 +110,40 @@ case $ARCH in 'Linux') LIBNAME="lib${LIBNAME}" # prefix with "lib" - OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}" - VERSION="${MAJOR}.${MINOR}.${PATCH}" - echo "mklib: Making Linux shared library: " ${LIBNAME}.so.${VERSION} - - if [ $CPLUSPLUS = 1 ] ; then - LINK="g++" - else - LINK="gcc" - fi - - # rm any old libs - rm -f ${LIBNAME}.so.${VERSION} - rm -f ${LIBNAME}.so.${MAJOR} - rm -f ${LIBNAME}.so - - # make lib - ${LINK} ${OPTS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS} - # make usual symlinks - ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} - ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so - # finish up - FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so" + if [ $STATIC = 1 ] ; then + echo "mklib: Making Linux static library: " ${LIBNAME}.a + LINK="ar" + OPTS="-ruv" + # make lib + ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS} + # finish up + FINAL_LIBS="${LIBNAME}.a" + else + OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}" + VERSION="${MAJOR}.${MINOR}.${PATCH}" + + echo "mklib: Making Linux shared library: " ${LIBNAME}.so.${VERSION} + + if [ $CPLUSPLUS = 1 ] ; then + LINK="g++" + else + LINK="gcc" + fi + + # rm any old libs + rm -f ${LIBNAME}.so.${VERSION} + rm -f ${LIBNAME}.so.${MAJOR} + rm -f ${LIBNAME}.so + + # make lib + ${LINK} ${OPTS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS} + # make usual symlinks + ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} + ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so + # finish up + FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so" + fi ;; 'SunOS') |