diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/mklib.aix | 154 | ||||
-rwxr-xr-x | bin/mklib.ar-ruv | 39 | ||||
-rw-r--r-- | bin/mklib.solaris | 53 |
3 files changed, 246 insertions, 0 deletions
diff --git a/bin/mklib.aix b/bin/mklib.aix new file mode 100755 index 0000000000..da8f642f85 --- /dev/null +++ b/bin/mklib.aix @@ -0,0 +1,154 @@ +#!/bin/ksh + +# Make an AIX shared library (tricky!!!) +# Based on a script from Athanasios G. Gaitatzes (gaitat@vnet.ibm.com) +# Improved by Greg Thompson <gregt@visix.com> -gt + +#--identification------------------------------------------------------ + +# $Id: mklib.aix,v 1.1 1999/08/19 13:52:56 brianp Exp $ + +# $Log: mklib.aix,v $ +# Revision 1.1 1999/08/19 13:52:56 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +# Usage: mklib libname major minor file.o ... +# +# First argument is name of output library (LIBRARY) +# Second arg is major version number (MAJOR) +# Third arg is minor version number (MINOR) +# Rest of arguments are object files (OBJECTS) + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +# BASENAME = LIBRARY without .a suffix +BASENAME=`echo ${LIBRARY} | sed "s/\.a//g"` + +# Name of exports file +EXPFILE=${BASENAME}.exp + +# Name of temporary shared lib file +OFILE=shr.o +####OFILE=${BASENAME}.o + + +# Remove any old files from previous make +rm -f ${LIBRARY} ${EXPFILE} ${OFILE} + +# Pick a way to use nm -gt +NM=${NM-/bin/nm -eC} + +# Determine which version of AIX this is +AIXVERSION=`uname -v` + +# Pick a way to tell the linker there's no entrypoint -gt +case ${AIXVERSION} +{ + 3*) + ENTRY='-e _nostart' + ;; + 4*) + ENTRY=-bnoentry + ;; + *) + echo "Error in mklib.aix!" + exit 1 + ;; +} + + +# Other libraries which we may be dependent on. Since we make the libraries +# in the order libGL.a, libaGLU.a, libglut.a just depends on its predecessor. +# modified to make otherlibs in the form of -lfoo -gt +OTHERLIBS=`ls ../lib/*.a | sed "s/..\/lib\/lib/-l/g" | sed "s/\.a//g"` + +##echo OTHERLIBS are ${OTHERLIBS} + + +# Make exports (.exp) file header +echo "#! ${LIBRARY}" > ${EXPFILE} + +# Append list of exported symbols to exports file -gt +case ${AIXVERSION} +{ + 3*) + ${NM} ${OBJECTS} | awk -F'|' '{ + if ($3 != "extern" || substr($7,1,1) == " ") continue + sub (" *", "", $1); sub (" *", "", $7) + if ( (($7 == ".text") || ($7 == ".data") || ($7 == ".bss")) \ + && ( substr($1,1,1) != ".")) { + if (substr ($1, 1, 7) != "__sinit" && + substr ($1, 1, 7) != "__sterm") { + if (substr ($1, 1, 5) == "__tf1") + print (substr ($1, 7)) + else if (substr ($1, 1, 5) == "__tf9") + print (substr ($1, 15)) + else + print $1 + } + } + }' | sort -u >> ${EXPFILE} + ;; + + 4*) + ${NM} ${OBJECTS} | awk '{ + if ((($2 == "T") || ($2 == "D") || ($2 == "B")) \ + && ( substr($1,1,1) != ".")) { + if (substr ($1, 1, 7) != "__sinit" && + substr ($1, 1, 7) != "__sterm") { + if (substr ($1, 1, 5) == "__tf1") + print (substr ($1, 7)) + else if (substr ($1, 1, 5) == "__tf9") + print (substr ($1, 15)) + else + print $1 + } + } + }' | sort -u >> ${EXPFILE} + ;; +} + + +# This next line is a hack to allow full compatibility with IBM's OpenGL +# libraries. IBM mistakenly exports glLoadIdentity from the libGLU.a +# library. We have to do the same thing. Problem reported by Yemi Adesanya +# (adesanya@afsmail.cern.ch) and Patrick Brown (pbrown@austin.ibm.com) +if [ "${BASENAME}" = libGLU ] ; then + echo "glLoadIdentity" >> ${EXPFILE} +fi + + +# Make the shared lib file +cc -o ${OFILE} ${OBJECTS} -L../lib ${OTHERLIBS} -lX11 -lXext -lXmu -lXi -lm -lc -bE:${EXPFILE} -bM:SRE ${ENTRY} + + +# Make the .a file +ar ruv ${LIBRARY} ${OFILE} + +# Put exports file in Mesa lib directory +mv ${EXPFILE} ../lib + +# Remove OFILE +rm -f ${OFILE} + + +#NOTES +# AIX 4.x /usr/bin/nm -B patch from ssclift@mach.me.queensu.ca (Simon Clift) +# Robustified symbol extraction for AIX 3 and 4 +# Greg Thompson <gregt@visix.com> + diff --git a/bin/mklib.ar-ruv b/bin/mklib.ar-ruv new file mode 100755 index 0000000000..4562308c02 --- /dev/null +++ b/bin/mklib.ar-ruv @@ -0,0 +1,39 @@ +#!/bin/sh + +# Make a standard Unix .a library file with 'ar ruv' + +#--identification------------------------------------------------------ + +# $Id: mklib.ar-ruv,v 1.1 1999/08/19 13:52:57 brianp Exp $ + +# $Log: mklib.ar-ruv,v $ +# Revision 1.1 1999/08/19 13:52:57 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +# Usage: mklib libname major minor file.o ... +# +# First argument is name of output library (LIBRARY) +# Second arg is major version number (MAJOR) +# Third arg is minor version number (MINOR) +# Rest of arguments are object files (OBJECTS) + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +#ar ruv $LIBRARY $OBJECTS +ar ru $LIBRARY $OBJECTS + diff --git a/bin/mklib.solaris b/bin/mklib.solaris new file mode 100644 index 0000000000..218665708a --- /dev/null +++ b/bin/mklib.solaris @@ -0,0 +1,53 @@ +#!/bin/sh + +# Make a Solaris shared library +# contributed by Arno Hahma (arno@nitro.pp.utu.fi) + +#--identification------------------------------------------------------ + +# $Id: mklib.solaris,v 1.1 1999/08/19 13:53:06 brianp Exp $ + +# $Log: mklib.solaris,v $ +# Revision 1.1 1999/08/19 13:53:06 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +# Usage: mklib libname major minor file.o ... +# +# First argument is name of output library (LIBRARY) +# Second arg is major version number (MAJOR) +# Third arg is minor version number (MINOR) +# Rest of arguments are object files (OBJECTS) + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +set -x + +LIBRARY=`basename $LIBRARY .a` + +VERSION=$MAJOR.$MINOR + +echo "Building shared object $LIBRARY.so.$VERSION and the archive library $LIBRARY.a" +rm -f ${LIBRARY}.a ${LIBRARY}.so.${VERSION} +ar ruv ${LIBRARY}.a ${OBJECTS} + +ld -G -o ${LIBRARY}.so.${VERSION} ${OBJECTS} + +cp ${LIBRARY}.a ${LIBRARY}.so.${VERSION} ../lib +cd ../lib +ln -s ${LIBRARY}.so.${VERSION} ${LIBRARY}.so + |