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

  1. #!/bin/sh
  2.  
  3. # Make a digital unix shared library (OSF/1)
  4. # provided by Thomas Graichen (graichen@rzpd.de)
  5.  
  6. #--identification------------------------------------------------------
  7.  
  8. # $Id: mklib.osf1,v 1.7 1997/10/21 23:32:31 brianp Exp $
  9.  
  10. # $Log: mklib.osf1,v $
  11. # Revision 1.7  1997/10/21 23:32:31  brianp
  12. # now takes major and minor version arguments
  13. #
  14.  
  15. #--common--------------------------------------------------------------
  16.  
  17. # Usage:  mklib libname major minor file.o ...
  18. #
  19. # First argument is name of output library (LIBRARY)
  20. # Second arg is major version number (MAJOR)
  21. # Third arg is minor version number (MINOR)
  22. # Rest of arguments are object files (OBJECTS)
  23.  
  24. LIBRARY=$1
  25. shift 1
  26.  
  27. MAJOR=$1
  28. shift 1
  29.  
  30. MINOR=$1
  31. shift 1
  32.  
  33. OBJECTS=$*
  34.  
  35. #--platform------------------------------------------------------------
  36.  
  37. MAJOR=2
  38. VERSION="${MAJOR}.${MINOR}"
  39.  
  40. LIBNAME=`basename $LIBRARY`
  41. ARNAME=`basename $LIBNAME .so`.a
  42. DIRNAME=`dirname $LIBRARY`
  43.  
  44. rm -f ${LIBRARY}.${VERSION}
  45. ld -o ${LIBRARY}.${VERSION} -shared -no_archive -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS}
  46. (cd $DIRNAME; ln -sf ${LIBNAME}.${VERSION} ${LIBNAME})
  47.  
  48. rm -f ${DIRNAME}/${ARNAME}
  49. ar clqz ${DIRNAME}/${ARNAME} ${OBJECTS}
  50.