diff options
Diffstat (limited to 'mklibs')
-rwxr-xr-x | mklibs/mkexp.aix | 93 | ||||
-rwxr-xr-x | mklibs/mkslib-debug.linux | 66 | ||||
-rwxr-xr-x | mklibs/mkslib.aix | 92 | ||||
-rwxr-xr-x | mklibs/mkslib.irix6.2-gcc | 66 | ||||
-rwxr-xr-x | mklibs/mkslib.linux | 66 | ||||
-rwxr-xr-x | mklibs/mkslib.solaris-gcc | 63 |
6 files changed, 446 insertions, 0 deletions
diff --git a/mklibs/mkexp.aix b/mklibs/mkexp.aix new file mode 100755 index 0000000..f7bae8f --- /dev/null +++ b/mklibs/mkexp.aix @@ -0,0 +1,93 @@ +#!/bin/ksh + +# Make an AIX EXPORT FILE FOR shared library (tricky!!!) +# Based on a script from Athanasios G. Gaitatzes ([email protected]) +# Improved by Greg Thompson <[email protected]> -gt +# +# Improved by Sven Goethel <[email protected]> +# goal: same tool for any machines ... +# + +# First argument is name of output library +# without dirname and suffix +# +# Rest of arguments are object files WHICH SHOULD BE IN THE EXPORT LIST !! +# + + +# Name of the library which clients will link with (ex: libMesaGL) +BASENAME=$1 + +# BASENAME = LIBRARY without .a suffix +LIBRARY=${BASENAME}.so + +# Name of exports file +EXPFILE=${BASENAME}.exp + +# List of object files to put into library +shift 1 +OBJECTS=$* + + +# Remove any old files from previous make +rm -f ${EXPFILE} + +# Pick a way to use nm -gt +NM=${NM-/bin/nm -eC} + +# Determine which version of AIX this is +AIXVERSION=`uname -v` + +# 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 +# ([email protected]) and Patrick Brown ([email protected]) +if [ "${BASENAME}" = libMesaGLU ] ; then + echo "glLoadIdentity" >> ${EXPFILE} +fi + + + diff --git a/mklibs/mkslib-debug.linux b/mklibs/mkslib-debug.linux new file mode 100755 index 0000000..ba79190 --- /dev/null +++ b/mklibs/mkslib-debug.linux @@ -0,0 +1,66 @@ +#!/bin/sh + +# Make a Linux ELF shared library +# Improved by Sven Goethel <[email protected]> +# goal: same tool for any machines ... +# + +# First argument is name of output library +# without dirname and suffix +# second and third are the major and minor number +# Rest of arguments are object files + +LIBDIR=$1 +shift 1 + +LIBRARY=$1 +shift 1 + +LIBMAJOR=$1 +shift 1 + +LIBMINOR=$1 +shift 1 + +LIBBUGFIX=$1 +shift 1 + + +OBJECTS=$* + +# the following provided by Thomas Hiller ([email protected]) + +VERSION="${LIBMAJOR}.${LIBMINOR}.${LIBBUGFIX}" + +LIBNAME=${LIBRARY}_g.so + +# Remove any old files from previous make +rm -f ${LIBDIR}/${LIBNAME}* + +gcc -shared -Wl,-soname,${LIBNAME}.${LIBMAJOR} \ + -o ${LIBDIR}/${LIBNAME}.${VERSION} \ + ${OBJECTS} + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${LIBMAJOR}.${LIBMINOR} +) + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${LIBMAJOR}.${LIBMINOR} ${LIBNAME}.${LIBMAJOR} +) + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${LIBMAJOR} ${LIBNAME} +) + +# Print a reminder about shared libs: +echo +echo "******Be sure to add" ${LIBDIR}" 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. diff --git a/mklibs/mkslib.aix b/mklibs/mkslib.aix new file mode 100755 index 0000000..93d98e5 --- /dev/null +++ b/mklibs/mkslib.aix @@ -0,0 +1,92 @@ +#!/bin/ksh + +# Make an AIX shared library (tricky!!!) +# Based on a script from Athanasios G. Gaitatzes ([email protected]) +# Improved by Greg Thompson <[email protected]> -gt +# +# Improved by Sven Goethel <[email protected]> +# goal: same tool for any machines ... +# + +# First argument is name of output library +# without dirname and suffix +# second and third are the major and minor number +# Rest of arguments are object files +# + +LIBDIR=$1 +shift 1 + +LIBRARY=$1 +shift 1 + +LIBMAJOR=$1 +shift 1 + +LIBMINOR=$1 +shift 1 + +LIBBUGFIX=$1 +shift 1 + + +OBJECTS=$* + +# the following provided by Thomas Hiller ([email protected]) + +VERSION="${LIBMAJOR}.${LIBMINOR}.${LIBBUGFIX}" + +LIBNAME=${LIBRARY}.so +EXPFILE=${LIBRARY}.exp + +# Remove any old files from previous make +rm -f ${LIBDIR}/${LIBNAME}* + +# 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 + ;; +} + + +# Make the shared lib file +ld -o ${LIBDIR}/${LIBNAME}.${VERSION} \ + ${OBJECTS} ${ENTRY} -bM:SRE -bE:${EXPFILE} \ + -blibpath:/usr/lib/threads:/usr/lib:/lib -lc_r \ + -L${JAVA_HOME}/lib/aix/native_threads -ljava + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${LIBMAJOR}.${LIBMINOR} +) + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${LIBMAJOR}.${LIBMINOR} ${LIBNAME}.${LIBMAJOR} +) + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${LIBMAJOR} ${LIBNAME} +) + +#NOTES +# AIX 4.x /usr/bin/nm -B patch from [email protected] (Simon Clift) +# Robustified symbol extraction for AIX 3 and 4 +# Greg Thompson <[email protected]> + +# Print a reminder about shared libs: +echo +echo "******Be sure to add" ${LIBDIR}"/lib to your LD_LIBRARY_PATH variable" +echo +sleep 2 + diff --git a/mklibs/mkslib.irix6.2-gcc b/mklibs/mkslib.irix6.2-gcc new file mode 100755 index 0000000..9514143 --- /dev/null +++ b/mklibs/mkslib.irix6.2-gcc @@ -0,0 +1,66 @@ +#!/bin/sh + +# Make a Linux ELF shared library +# Improved by Sven Goethel <[email protected]> +# goal: same tool for any machines ... +# + +# First argument is name of output library +# without dirname and suffix +# second and third are the major and minor number +# Rest of arguments are object files + +LIBDIR=$1 +shift 1 + +LIBRARY=$1 +shift 1 + +LIBMAJOR=$1 +shift 1 + +LIBMINOR=$1 +shift 1 + +LIBBUGFIX=$1 +shift 1 + + +OBJECTS=$* + +# the following provided by Thomas Hiller ([email protected]) + +VERSION="${LIBMAJOR}.${LIBMINOR}.${LIBBUGFIX}" + +LIBNAME=${LIBRARY}.so + +# Remove any old files from previous make +rm -f ${LIBDIR}/${LIBNAME}* + +gcc -shared -Wl,-soname,${LIBNAME}.${LIBMAJOR} \ + -o ${LIBDIR}/${LIBNAME}.${VERSION} \ + ${OBJECTS} + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${LIBMAJOR}.${LIBMINOR} +) + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${LIBMAJOR}.${LIBMINOR} ${LIBNAME}.${LIBMAJOR} +) + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${LIBMAJOR} ${LIBNAME} +) + +# Print a reminder about shared libs: +echo +echo "******Be sure to add" ${LIBDIR}" 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. diff --git a/mklibs/mkslib.linux b/mklibs/mkslib.linux new file mode 100755 index 0000000..9514143 --- /dev/null +++ b/mklibs/mkslib.linux @@ -0,0 +1,66 @@ +#!/bin/sh + +# Make a Linux ELF shared library +# Improved by Sven Goethel <[email protected]> +# goal: same tool for any machines ... +# + +# First argument is name of output library +# without dirname and suffix +# second and third are the major and minor number +# Rest of arguments are object files + +LIBDIR=$1 +shift 1 + +LIBRARY=$1 +shift 1 + +LIBMAJOR=$1 +shift 1 + +LIBMINOR=$1 +shift 1 + +LIBBUGFIX=$1 +shift 1 + + +OBJECTS=$* + +# the following provided by Thomas Hiller ([email protected]) + +VERSION="${LIBMAJOR}.${LIBMINOR}.${LIBBUGFIX}" + +LIBNAME=${LIBRARY}.so + +# Remove any old files from previous make +rm -f ${LIBDIR}/${LIBNAME}* + +gcc -shared -Wl,-soname,${LIBNAME}.${LIBMAJOR} \ + -o ${LIBDIR}/${LIBNAME}.${VERSION} \ + ${OBJECTS} + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${LIBMAJOR}.${LIBMINOR} +) + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${LIBMAJOR}.${LIBMINOR} ${LIBNAME}.${LIBMAJOR} +) + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${LIBMAJOR} ${LIBNAME} +) + +# Print a reminder about shared libs: +echo +echo "******Be sure to add" ${LIBDIR}" 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. diff --git a/mklibs/mkslib.solaris-gcc b/mklibs/mkslib.solaris-gcc new file mode 100755 index 0000000..4dda870 --- /dev/null +++ b/mklibs/mkslib.solaris-gcc @@ -0,0 +1,63 @@ +#!/bin/sh + +# Make a Solaris shared library +# contributed by Arno Hahma ([email protected]) +# Improved by Sven Goethel <[email protected]> +# goal: same tool for any machines ... +# + +# First argument is name of output library +# without dirname and suffix +# second and third are the major and minor number +# Rest of arguments are object files + +set -x + +LIBDIR=$1 +shift 1 + +LIBRARY=$1 +shift 1 + +LIBMAJOR=$1 +shift 1 + +LIBMINOR=$1 +shift 1 + +LIBBUGFIX=$1 +shift 1 + + +OBJECTS=$* + +# the following provided by Thomas Hiller ([email protected]) + +VERSION="${LIBMAJOR}.${LIBMINOR}.${LIBBUGFIX}" + +LIBNAME=${LIBRARY}.so + +echo "Building shared object $LIBRARY.so.$VERSION and the archive library $LIBRARY.a" +rm -f ${LIBDIR}/${LIBNAME}* + +gcc -G -o ${LIBDIR}/${LIBNAME}.${VERSION} ${OBJECTS} + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${LIBMAJOR}.${LIBMINOR} +) + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${LIBMAJOR}.${LIBMINOR} ${LIBNAME}.${LIBMAJOR} +) + +( cd ${LIBDIR} ; + ln -s ${LIBNAME}.${LIBMAJOR} ${LIBNAME} +) + +# Print a reminder about shared libs: +echo +echo "******Be sure to add" ${LIBDIR}" to your LD_LIBRARY_PATH variable" +echo +sleep 2 + + |