home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 10
/
aminetcdnumber101996.iso
/
Aminet
/
gfx
/
x11
/
Mesa_Amiwin.lha
/
Mesa-Amiwin
/
mklib.linux
< prev
next >
Wrap
Text File
|
1995-11-29
|
983b
|
47 lines
#!/bin/sh
# Make a Linux ELF shared library
# First argument is name of output library
# Rest of arguments are object files
LIBRARY=$1
shift 1
OBJECTS=$*
# the following provided by Thomas Hiller (Hiller@tu-harburg.d400.de)
LIBMAJOR=1
LIBMINOR=2
LIBTINY=5
VERSION="${LIBMAJOR}.${LIBMINOR}.${LIBTINY}"
LIBNAME=`basename $LIBRARY`
ARNAME=`basename $LIBNAME .so`.a
DIRNAME=`dirname $LIBRARY`
gcc -shared -Wl,-soname,${LIBNAME}.${LIBMAJOR} -o ${LIBRARY}.${VERSION} ${OBJECTS}
(cd $DIRNAME; ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${LIBMAJOR})
# also make regular .a files,
# provided by Danek Duvall (duvall@dhduvall.student.princeton.edu)
ar cq ${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.