2
0

osfLib.rules 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. XCOMM $XConsortium: osfLib.rules /main/16 1996/09/28 16:11:55 rws $
  2. /*
  3. * OSF/1 shared library rules
  4. */
  5. #ifndef HasSharedLibraries
  6. #define HasSharedLibraries YES
  7. #endif
  8. #ifndef SeparateSharedCompile
  9. #define SeparateSharedCompile NO
  10. #endif
  11. #ifndef SharedDataSeparation
  12. #define SharedDataSeparation NO
  13. #endif
  14. #ifndef SharedCodeDef
  15. #define SharedCodeDef /**/
  16. #endif
  17. #ifndef SharedLibraryDef
  18. #define SharedLibraryDef /**/
  19. #endif
  20. #ifndef ShLibIncludeFile
  21. #define ShLibIncludeFile <osfLib.tmpl>
  22. #endif
  23. #ifndef SharedLibraryLoadFlags
  24. #define SharedLibraryLoadFlags -shared -no_archive
  25. #endif
  26. #ifndef PositionIndependentCFlags
  27. #define PositionIndependentCFlags /**/
  28. #endif
  29. /*
  30. * InstallSharedLibrary - generate rules to install the shared library.
  31. */
  32. #ifndef InstallSharedLibrary
  33. #define InstallSharedLibrary(libname,rev,dest) @@\
  34. install:: Concat(lib,libname.so.rev) @@\
  35. MakeDir($(DESTDIR)dest) @@\
  36. $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  37. $(RM) Concat($(DESTDIR)dest/lib,libname.so) @@\
  38. cd $(DESTDIR)dest; $(LN) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  39. #endif /* InstallSharedLibrary */
  40. /*
  41. * InstallSharedLibraryData - generate rules to install the shared library data
  42. */
  43. #ifndef InstallSharedLibraryData
  44. #define InstallSharedLibraryData(libname,rev,dest)
  45. #endif /* InstallSharedLibraryData */
  46. #ifndef PackageName(libname)
  47. #if ModernOSF1
  48. #define PackageName(libname) /**/
  49. #define Objects(objlist) -all objlist -none
  50. #else
  51. #define PackageName(libname) -package libname
  52. #define Objects(objlist) objlist
  53. #endif
  54. #endif
  55. #if ThreadedX && ModernOSF1 && OSMajorVersion < 4
  56. #define BaseShLibReqs -lc_r -lc
  57. #else
  58. #define BaseShLibReqs -lc
  59. #endif
  60. /*
  61. * SharedLibraryTarget - generate rules to create a shared library;
  62. * build it into a different name so that we do not hose people by having
  63. * the library gone for long periods.
  64. */
  65. #ifndef SharedLibraryTarget
  66. #if SeparateSharedCompile
  67. #define SharedLibraryTarget(libname,rev,solist,down,up) @@\
  68. AllTarget(Concat(lib,libname.so.rev)) @@\
  69. @@\
  70. Concat(lib,libname.so.rev): solist $(EXTRALIBRARYDEPS) @@\
  71. $(RM) $@~ @@\
  72. (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) PackageName($@) \ @@\
  73. -soname $@ Objects(solist) \ @@\
  74. $(REQUIREDLIBS) BaseShLibReqs) @@\
  75. $(RM) $@ @@\
  76. $(MV) $@~ $@ @@\
  77. $(RM) Concat(lib,libname.so) @@\
  78. $(LN) $@ Concat(lib,libname.so) @@\
  79. LinkBuildLibrary($@) @@\
  80. LinkBuildLibrary(Concat(lib,libname.so)) @@\
  81. @@\
  82. clean:: @@\
  83. $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  84. #else
  85. #define SharedLibraryTarget(libname,rev,solist,down,up) @@\
  86. AllTarget(Concat(lib,libname.so.rev)) @@\
  87. @@\
  88. Concat(lib,libname.so.rev): solist $(EXTRALIBRARYDEPS) @@\
  89. $(RM) $@~ @@\
  90. $(LD) -o $@~ $(SHLIBLDFLAGS) PackageName($@) \ @@\
  91. -soname $@ Objects(solist) \ @@\
  92. $(REQUIREDLIBS) BaseShLibReqs @@\
  93. $(RM) $@ @@\
  94. $(MV) $@~ $@ @@\
  95. $(RM) Concat(lib,libname.so) @@\
  96. $(LN) $@ Concat(lib,libname.so) @@\
  97. LinkBuildLibrary($@) @@\
  98. LinkBuildLibrary(Concat(lib,libname.so)) @@\
  99. @@\
  100. clean:: @@\
  101. $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  102. #endif /* SeparateSharedCompile */
  103. #endif /* SharedLibraryTarget */
  104. /*
  105. * SharedLibraryDataTarget - generate rules to create shlib data file;
  106. */
  107. #ifndef SharedLibraryDataTarget
  108. #define SharedLibraryDataTarget(libname,rev,salist)
  109. #endif /* SharedLibraryTarget */