home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 5 / MA_Cover_5.iso / ppc / mesa / mklib.glide < prev    next >
Encoding:
Text File  |  1998-01-31  |  1.7 KB  |  75 lines

  1. #!/bin/sh
  2.  
  3. # Make a Linux ELF shared library, including 3Dfx Glide libs
  4.  
  5. #--identification------------------------------------------------------
  6.  
  7. # $Id: mklib.glide,v 1.4 1997/10/21 23:32:31 brianp Exp $
  8.  
  9. # $Log: mklib.glide,v $
  10. # Revision 1.4  1997/10/21 23:32:31  brianp
  11. # now takes major and minor version arguments
  12. #
  13.  
  14. #--common--------------------------------------------------------------
  15.  
  16. # Usage:  mklib libname major minor file.o ...
  17. #
  18. # First argument is name of output library (LIBRARY)
  19. # Second arg is major version number (MAJOR)
  20. # Third arg is minor version number (MINOR)
  21. # Rest of arguments are object files (OBJECTS)
  22.  
  23. LIBRARY=$1
  24. shift 1
  25.  
  26. MAJOR=$1
  27. shift 1
  28.  
  29. MINOR=$1
  30. shift 1
  31.  
  32. OBJECTS=$*
  33.  
  34. #--platform------------------------------------------------------------
  35.  
  36. # If we're making the libMesaGL.so file then also link in the Glide libs
  37. if [ $LIBRARY = "libMesaGL.so" ] ; then
  38.     GLIDELIBS="-L/usr/local/glide/lib -lglide2x -ltexus"
  39. fi
  40.  
  41.  
  42. # the following provided by Thomas Hiller (Hiller@tu-harburg.d400.de)
  43.  
  44. VERSION="${MAJOR}.${MINOR}"
  45.  
  46. LIBNAME=`basename $LIBRARY`
  47. ARNAME=`basename $LIBNAME .so`.a
  48. DIRNAME=`dirname $LIBRARY`
  49.  
  50. gcc -shared -Wl,-soname,${LIBNAME}.${MAJOR} -o ${LIBRARY}.${VERSION} ${OBJECTS} ${GLIDELIBS}
  51. (cd $DIRNAME; ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${MAJOR})
  52.  
  53. ln -s ${LIBNAME}.${MAJOR} ${LIBRARY}
  54.  
  55.  
  56. # also make regular .a files,
  57. # provided by Danek Duvall (duvall@dhduvall.student.princeton.edu)
  58.  
  59. ar ruv ${DIRNAME}/${ARNAME} ${OBJECTS}
  60. ranlib ${DIRNAME}/${ARNAME}
  61.  
  62.  
  63. # Print a reminder about shared libs:
  64. DIR=`cd .. ; pwd`
  65. echo
  66. echo "******Be sure to add" ${DIR}"/lib to your LD_LIBRARY_PATH variable"
  67. echo
  68. sleep 2
  69.  
  70.  
  71.  
  72. #### NOTES:
  73. # One Mesa user reports having to run the "ldconfig -v" command to make
  74. # Linux aware of the shared libs.
  75.