#!/bin/sh # Make a Linux ELF shared library #--identification------------------------------------------------------ # $Id: mklib.linux,v 1.1 2001/02/22 20:55:35 philippe Exp $ # $Log: mklib.linux,v $ # Revision 1.1 2001/02/22 20:55:35 philippe # xrml 0.5.0 initial commit # # Revision 1.6 2000/02/16 01:09:06 brianp # new library dependency vars # # Revision 1.5 1999/11/30 13:02:16 brianp # restored MAJOR version number in soname # # Revision 1.4 1999/11/18 15:29:52 brianp # removed MAJOR version number from soname # # Revision 1.3 1999/09/15 17:11:34 brianp # use TINY in library name # # Revision 1.2 1999/09/15 15:10:20 brianp # added third, tiny version number to arguments # # Revision 1.1 1999/08/19 13:53:03 brianp # initial check-in (post-crash) # #--common-------------------------------------------------------------- LIBRARY=$1 shift 1 MAJOR=$1 shift 1 MINOR=$1 shift 1 TINY=$1 shift 1 OBJECTS=$* #--platform------------------------------------------------------------ # the following provided by Thomas Hiller (Hiller@tu-harburg.d400.de) VERSION="${MAJOR}.${MINOR}.${TINY}" LIBNAME=`basename $LIBRARY` ARNAME=`basename $LIBNAME .so`.a DIRNAME=`dirname $LIBRARY` # When making shared libraries, also link with any libraries we're # depenedant on. if [ $LIBRARY = "libGL.so" ] ; then EXTRA_LIBS=${GL_LIB_DEPS} elif [ $LIBRARY = "libGLU.so" ] ; then EXTRA_LIBS=${GLU_LIB_DEPS} elif [ $LIBRARY = "libglut.so" ] ; then EXTRA_LIBS=${GLUT_LIB_DEPS} fi gcc -shared -Wl,-soname,${LIBNAME}.${MAJOR} -o ${LIBRARY}.${VERSION} ${OBJECTS} ${EXTRA_LIBS} (cd $DIRNAME; ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${MAJOR}) ln -s ${LIBNAME}.${MAJOR} ${LIBRARY} # also make regular .a files, # provided by Danek Duvall (duvall@dhduvall.student.princeton.edu) ar ruv ${DIRNAME}/${ARNAME} ${OBJECTS} ranlib ${DIRNAME}/${ARNAME} # Print a reminder about shared libs: DIR=`cd .. ; pwd` echo echo "******Be sure to add" ${DIR}"/lib to your LD_LIBRARY_PATH variable" echo sleep 2 #### NOTES: # One Mesa user reports having to run the "ldconfig -v" command to make # Linux aware of the shared libs.