#!/bin/sh # Make a FreeBSD ELF shared library # $Id: mklib.freebsd,v 1.1 2003/12/12 00:24:35 wes Exp $ #--common-------------------------------------------------------------- # Usage: mklib # # are arcitecture specific build flags # is name of output library (LIBRARY) # is major version number (MAJOR) # is minor version number (MINOR) # remaining arguments are object files (OBJECTS) # # added local installation target prefix (RM_INSTALL) # tidied up the build # # 12/11/03 Contributor: Igor_Pokrovsky at yahoo dot com # ARCHFLAGS=$1 shift 1 LIBRARY=$1 shift 1 MAJOR=$1 shift 1 MINOR=$1 shift 1 # we don't care about ${MINOR} here VERSION=$MAJOR OBJECTS=$* DEPLIBS="-lGL -lGLU -L${X11BASE}/lib -lXmu" #--platform------------------------------------------------------------ # build library objects ${ECHO_CMD} "Building shared object $LIBRARY.so.$VERSION and the archive library $LIBRARY.a" ${RM} -f ${LIBRARY}.a ${LIBRARY}.so.${VERSION} ${AR} qv ${LIBRARY}.a ${OBJECTS} # FreeBSD specific build ${CC} -shared -Wl,-soname,${LIBRARY}.so.${VERSION} -o ${LIBRARY}.so.${VERSION} ${OBJECTS} ${DEPLIBS} if [ ${ARCHFLAGS##*-} != "debug" ]; then ${STRIP_CMD} ${LIBRARY}.so.${VERSION} ${ECHO_CMD} "library has been stripped (non-debug build)." fi # code tree ${CP} ${LIBRARY}.a ${LIBRARY}.so.${VERSION} ../lib ${RM} -f ../lib/${LIBRARY}.so ${LN} -s ${LIBRARY}.so.${VERSION} ${LIBRARY}.so