home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / lib / x11 / config / ibmlib.rules < prev    next >
Encoding:
Text File  |  1996-10-17  |  4.5 KB  |  154 lines

  1. XCOMM $XConsortium: ibmLib.rules /main/12 1995/12/04 11:59:16 kaleb $
  2.  
  3. /*
  4.  * AIX shared library rules
  5.  */
  6.  
  7. #ifndef HasSharedLibraries
  8. #define HasSharedLibraries YES
  9. #endif
  10. #ifndef ForceNormalLib
  11. #define ForceNormalLib NO
  12. #endif
  13. #ifndef SharedDataSeparation
  14. #define SharedDataSeparation NO
  15. #endif
  16. #ifndef SharedCodeDef
  17. #define SharedCodeDef -DSHAREDCODE
  18. #endif
  19. #ifndef SharedLibraryDef
  20. #define SharedLibraryDef -DAIXSHLIB
  21. #endif
  22. #ifndef ShLibIncludeFile
  23. #define ShLibIncludeFile <ibmLib.tmpl>
  24. #endif
  25. #ifndef PositionIndependentCFlags
  26. #define PositionIndependentCFlags -bM\:SRE
  27. #endif
  28. #ifndef ExtraLoadFlags
  29. #define ExtraLoadFlags -bnodelcsect
  30. #endif
  31. #if ThreadedX
  32. #define BaseShLibReqs -lc_r -lm
  33. #else
  34. #define BaseShLibReqs -lc -lm
  35. #endif
  36.  
  37. /*
  38.  * SharedDSLibReferences - variables for shared libraries
  39.  */
  40. #if OSMajorVersion < 4
  41.  
  42. #ifndef SharedLibReferences
  43. #define SharedLibReferences(varname,libname,libsource,revname,rev)    @@\
  44. Concat3(DEP,varname,LIB) = /**/                        @@\
  45. Concat(varname,LIB) = _Use(Concat(-l,libname),Concat(libsource/lib,libname.a)) @@\
  46. LintLibReferences(varname,libname,libsource)
  47. #endif
  48.  
  49. #else
  50.  
  51. #ifndef SharedLibReferences
  52. #define SharedLibReferences(varname,libname,libsource,revname,rev)    @@\
  53. Concat3(DEP,varname,LIB) = /**/                        @@\
  54. Concat(varname,LIB) = _Use(Concat(-l,libname),Concat($(BUILDLIBDIR),/libname.imp) Concat3($(BUILDLIBDIR),/lib,libname.a)) @@\
  55. LintLibReferences(varname,libname,libsource)
  56. #endif
  57.  
  58. #endif
  59.  
  60. /*
  61.  * SharedDSLibReferences - variables for shared libraries
  62.  */
  63. #ifndef SharedDSLibReferences
  64. #define SharedDSLibReferences(varname,libname,libsource,revname,rev)    @@\
  65. SharedLibReferences(varname,libname,libsource,revname,rev)
  66. #endif
  67.  
  68. #if OSMajorVersion == 4
  69. /*
  70.  * UnsharedLibReferences - variables for unshared libraries
  71.  */
  72. #ifndef UnsharedLibReferences
  73. #define UnsharedLibReferences(varname,libname,libsource)        @@\
  74. Concat3(DEP,varname,LIB) = _UseCat($(USRLIBDIR)/lib,$(BUILDLIBDIR)/lib,libname.a)    @@\
  75. Concat(varname,LIB) = _Use(Concat(-l,libname),Concat($(BUILDLIBDIR)/lib,libname.a))    @@\
  76. LintLibReferences(varname,libname,libsource)
  77. #endif
  78. #endif
  79.  
  80.  
  81. /*
  82.  * InstallSharedLibrary - generate rules to install the shared library.
  83.  */
  84. #ifndef InstallSharedLibrary
  85. #define    InstallSharedLibrary(libname,rev,dest)                @@\
  86. InstallLibrary(libname,dest)
  87. #endif /* InstallSharedLibrary */
  88.  
  89. /*
  90.  * InstallSharedLibraryData - generate rules to install the shared library data
  91.  */
  92. #ifndef InstallSharedLibraryData
  93. #define    InstallSharedLibraryData(libname,rev,dest)
  94. #endif /* InstallSharedLibraryData */
  95.  
  96. /*
  97.  * NormalSharedLibraryTarget - generate rules to create a shared library;
  98.  * build it into a different name so that the we do not hose people by having
  99.  * the library gone for long periods.
  100.  */
  101. #if OSMajorVersion < 4
  102.  
  103. #ifndef SharedLibraryTarget
  104. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  105. AllTarget(Concat(lib,libname.a))                    @@\
  106.                                     @@\
  107. Concat(lib,libname.a):  solist $(UNSHAREDOBJS)                @@\
  108.     $(RM) $@~ shr.o                            @@\
  109.     (cd down; $(AR) up/$@~ solist)                    @@\
  110.     dump -g $@~ | sed -n -e 's/^[     ]*[0-9][0-9]*[     ]*\([^     .][^     ]*\)$$/\1/p' > $@.syms    @@\
  111.     $(LD) -o shr.o $@~ -H512 -T512 -bM\:SRE -bE\:$@.syms $(REQUIREDLIBS) BaseShLibReqs -L$(USRLIBDIR)    @@\
  112.     $(RM) $@~                            @@\
  113.     $(AR) $@~ shr.o $(UNSHAREDOBJS)                    @@\
  114.     $(RM) $@.syms $@ shr.o                        @@\
  115.     $(MV) $@~ $@                            @@\
  116.     LinkBuildLibrary($@)                        @@\
  117.                                     @@\
  118. clean::                                    @@\
  119.     $(RM) Concat(lib,libname.a)
  120. #endif /* SharedLibraryTarget */
  121.  
  122. #else /* OSMajorVersion == 4 */
  123.  
  124. #ifndef SharedLibraryTarget
  125. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  126. AllTarget(Concat(lib,libname.a))                    @@\
  127.                                     @@\
  128. Concat(lib,libname.a):  solist $(UNSHAREDOBJS)                @@\
  129.     $(RM) $@~ shr.o                            @@\
  130.     (cd down; $(AR) up/$@~ solist)                    @@\
  131.     echo "#! $@ (shr.o)" > libname.inp                @@\
  132.     dump -g $@~ | sed -n -e 's/^[     ]*[0-9][0-9]*[     ]*\([^     .][^     ]*\)$$/\1/p' >> libname.inp    @@\
  133.     $(LD) -o shr.o $@~ -H512 -T512 -bM\:SRE -bE\:libname.inp -bnoentry $(REQUIREDLIBS) BaseShLibReqs -L$(USRLIBDIR)    @@\
  134.     $(RM) $@~                            @@\
  135.     $(AR) $@~ shr.o $(UNSHAREDOBJS)                    @@\
  136.     $(RM) $@                            @@\
  137.     $(MV) $@~ $@                            @@\
  138.     LinkBuildLibrary($@)                        @@\
  139.     RemoveFile($(BUILDLIBDIR)/libname.imp)                @@\
  140.     cd $(BUILDLIBDIR); $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/libname.inp libname.imp @@\
  141.                                     @@\
  142. clean::                                    @@\
  143.     $(RM) Concat(lib,libname.a)
  144. #endif /* SharedLibraryTarget */
  145.  
  146. #endif
  147.  
  148. /*
  149.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  150.  */
  151. #ifndef SharedLibraryDataTarget
  152. #define SharedLibraryDataTarget(libname,rev,salist)
  153. #endif /* SharedLibraryTarget */
  154.