Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mklib.aix 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. #!/bin/ksh
  2. # Make an AIX shared library (tricky!!!)
  3. # Based on a script from Athanasios G. Gaitatzes (gaitat@vnet.ibm.com)
  4. # Improved by Greg Thompson <gregt@visix.com> -gt
  5. #--identification------------------------------------------------------
  6. # $Id: mklib.aix,v 1.2 1999/09/15 15:10:20 brianp Exp $
  7. # $Log: mklib.aix,v $
  8. # Revision 1.2 1999/09/15 15:10:20 brianp
  9. # added third, tiny version number to arguments
  10. #
  11. # Revision 1.1 1999/08/19 13:52:56 brianp
  12. # initial check-in (post-crash)
  13. #
  14. #--common--------------------------------------------------------------
  15. LIBRARY=$1
  16. shift 1
  17. MAJOR=$1
  18. shift 1
  19. MINOR=$1
  20. shift 1
  21. TINY=$1
  22. shift 1
  23. OBJECTS=$*
  24. #--platform------------------------------------------------------------
  25. # BASENAME = LIBRARY without .a suffix
  26. BASENAME=`echo ${LIBRARY} | sed "s/\.a//g"`
  27. # Name of exports file
  28. EXPFILE=${BASENAME}.exp
  29. # Name of temporary shared lib file
  30. OFILE=shr.o
  31. ####OFILE=${BASENAME}.o
  32. # Remove any old files from previous make
  33. rm -f ${LIBRARY} ${EXPFILE} ${OFILE}
  34. # Pick a way to use nm -gt
  35. NM=${NM-/bin/nm -eC}
  36. # Determine which version of AIX this is
  37. AIXVERSION=`uname -v`
  38. # Pick a way to tell the linker there's no entrypoint -gt
  39. case ${AIXVERSION}
  40. {
  41. 3*)
  42. ENTRY='-e _nostart'
  43. ;;
  44. 4*)
  45. ENTRY=-bnoentry
  46. ;;
  47. *)
  48. echo "Error in mklib.aix!"
  49. exit 1
  50. ;;
  51. }
  52. # Other libraries which we may be dependent on. Since we make the libraries
  53. # in the order libGL.a, libaGLU.a, libglut.a just depends on its predecessor.
  54. # modified to make otherlibs in the form of -lfoo -gt
  55. OTHERLIBS=`ls ../lib/*.a | sed "s/..\/lib\/lib/-l/g" | sed "s/\.a//g"`
  56. ##echo OTHERLIBS are ${OTHERLIBS}
  57. # Make exports (.exp) file header
  58. echo "#! ${LIBRARY}" > ${EXPFILE}
  59. # Append list of exported symbols to exports file -gt
  60. case ${AIXVERSION}
  61. {
  62. 3*)
  63. ${NM} ${OBJECTS} | awk -F'|' '{
  64. if ($3 != "extern" || substr($7,1,1) == " ") continue
  65. sub (" *", "", $1); sub (" *", "", $7)
  66. if ( (($7 == ".text") || ($7 == ".data") || ($7 == ".bss")) \
  67. && ( substr($1,1,1) != ".")) {
  68. if (substr ($1, 1, 7) != "__sinit" &&
  69. substr ($1, 1, 7) != "__sterm") {
  70. if (substr ($1, 1, 5) == "__tf1")
  71. print (substr ($1, 7))
  72. else if (substr ($1, 1, 5) == "__tf9")
  73. print (substr ($1, 15))
  74. else
  75. print $1
  76. }
  77. }
  78. }' | sort -u >> ${EXPFILE}
  79. ;;
  80. 4*)
  81. ${NM} ${OBJECTS} | awk '{
  82. if ((($2 == "T") || ($2 == "D") || ($2 == "B")) \
  83. && ( substr($1,1,1) != ".")) {
  84. if (substr ($1, 1, 7) != "__sinit" &&
  85. substr ($1, 1, 7) != "__sterm") {
  86. if (substr ($1, 1, 5) == "__tf1")
  87. print (substr ($1, 7))
  88. else if (substr ($1, 1, 5) == "__tf9")
  89. print (substr ($1, 15))
  90. else
  91. print $1
  92. }
  93. }
  94. }' | sort -u >> ${EXPFILE}
  95. ;;
  96. }
  97. # This next line is a hack to allow full compatibility with IBM's OpenGL
  98. # libraries. IBM mistakenly exports glLoadIdentity from the libGLU.a
  99. # library. We have to do the same thing. Problem reported by Yemi Adesanya
  100. # (adesanya@afsmail.cern.ch) and Patrick Brown (pbrown@austin.ibm.com)
  101. if [ "${BASENAME}" = libGLU ] ; then
  102. echo "glLoadIdentity" >> ${EXPFILE}
  103. fi
  104. # Make the shared lib file
  105. cc -o ${OFILE} ${OBJECTS} -L../lib ${OTHERLIBS} -lX11 -lXext -lXmu -lXi -lm -lc -bE:${EXPFILE} -bM:SRE ${ENTRY}
  106. # Make the .a file
  107. ar ruv ${LIBRARY} ${OFILE}
  108. # Put exports file in Mesa lib directory
  109. mv ${EXPFILE} ../lib
  110. # Remove OFILE
  111. rm -f ${OFILE}
  112. #NOTES
  113. # AIX 4.x /usr/bin/nm -B patch from ssclift@mach.me.queensu.ca (Simon Clift)
  114. # Robustified symbol extraction for AIX 3 and 4
  115. # Greg Thompson <gregt@visix.com>