hpLib.rules 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. XCOMM $XConsortium: hpLib.rules /main/16 1996/12/04 11:44:35 swick $
  2. /*
  3. * HP shared library rules
  4. */
  5. #ifndef HasSharedLibraries
  6. # define HasSharedLibraries YES
  7. #endif
  8. #ifndef SharedDataSeparation
  9. # define SharedDataSeparation NO
  10. #endif
  11. #ifndef SharedCodeDef
  12. # define SharedCodeDef /**/
  13. #endif
  14. #ifndef SharedLibraryDef
  15. # define SharedLibraryDef /**/
  16. #endif
  17. #ifndef ShLibIncludeFile
  18. # define ShLibIncludeFile <hpLib.tmpl>
  19. #endif
  20. #ifndef SharedLibraryLoadFlags
  21. # define SharedLibraryLoadFlags -b
  22. #endif
  23. #ifndef PositionIndependentCFlags
  24. # define PositionIndependentCFlags +z
  25. #endif
  26. #ifndef LargePositionIndependentCFlags
  27. # define LargePositionIndependentCFlags +Z
  28. #endif
  29. #ifndef InstLibFlags
  30. # define InstLibFlags -m 0555
  31. #endif
  32. #ifndef UseInstalled
  33. /* assert: LdPostLib pulls in -L$(USRLIBDIR), so it doesn't need to be here */
  34. # define ExtraLoadFlags -Wl,+s -Wl,+b$(USRLIBDIRPATH)
  35. #endif
  36. #ifndef UseExportLists
  37. # define UseExportLists YES
  38. #endif
  39. /* Pre-linking shared libraries is supported in HP/UX 10. */
  40. #if OSMajorVersion > 9
  41. # define HPRequiredLibs $(LDPRELIBS) $(REQUIREDLIBS) +s +b $(USRLIBDIRPATH)
  42. #else
  43. # define HPRequiredLibs $(REQUIREDLIBS)
  44. #endif
  45. #ifndef LinkWithExports
  46. # if UseExportLists
  47. # define LinkWithExports(libname,rev,solist,down,up) \
  48. (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) +h $@ solist HPRequiredLibs) @@\
  49. if [ -f Concat(lib,libname.elist) ]; then \ @@\
  50. RemoveFiles($@.exports $@.list); \ @@\
  51. $(CPP) $(ALLINCLUDES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(DEFINES) Concat(lib,libname.elist) | CppSedMagic >$@.list; \ @@\
  52. $(EXPORTLISTGEN) $@~ $@.list > $@.exports; \ @@\
  53. (cd down; $(LD) -c up/$@.exports -o up/$@~ $(SHLIBLDFLAGS) +h $@ solist HPRequiredLibs); \ @@\
  54. RemoveFiles($@.exports $@.list); \ @@\
  55. fi
  56. # else
  57. # define LinkWithExports(libname,rev,solist,down,up) \
  58. (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) +h $@ solist HPRequiredLibs)
  59. # endif
  60. #endif
  61. /*
  62. * InstallSharedLibrary - generate rules to install the shared library.
  63. */
  64. #ifndef InstallSharedLibrary
  65. # define InstallSharedLibrary(libname,rev,dest) @@\
  66. install:: Concat(lib,libname.sl.rev) @@\
  67. MakeDir($(DESTDIR)dest) @@\
  68. RMoveToBakFile(Concat($(DESTDIR)dest/lib,libname.sl.rev)) @@\
  69. $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.sl.rev) $(DESTDIR)dest @@\
  70. $(RM) Concat($(DESTDIR)dest/lib,libname.sl) @@\
  71. cd $(DESTDIR)dest; $(LN) Concat(lib,libname.sl.rev) Concat(lib,libname.sl) @@\
  72. -RemoveFile(Concat(lib,libname.sl.rev.bak))
  73. #endif /* InstallSharedLibrary */
  74. /*
  75. * InstallSharedLibraryData - generate rules to install the shared library data
  76. */
  77. #ifndef InstallSharedLibraryData
  78. # define InstallSharedLibraryData(libname,rev,dest)
  79. #endif /* InstallSharedLibraryData */
  80. /*
  81. * SharedLibraryTarget - generate rules to create a shared library;
  82. * build it into a different name so that we do not hose people by having
  83. * the library gone for long periods.
  84. */
  85. #ifndef SharedLibraryTarget
  86. # define SharedLibraryTarget(libname,rev,solist,down,up) @@\
  87. AllTarget(Concat(lib,libname.sl.rev)) @@\
  88. @@\
  89. Concat(lib,libname.sl.rev): solist $(EXTRALIBRARYDEPS) @@\
  90. $(RM) $@~ @@\
  91. LinkWithExports(libname,rev,solist,down,up) @@\
  92. -RemoveFiles($@ $@.bak) @@\
  93. MoveToBakFile($@) @@\
  94. $(MV) $@~ $@ @@\
  95. $(RM) Concat(lib,libname.sl) @@\
  96. $(LN) $@ Concat(lib,libname.sl) @@\
  97. LinkBuildLibrary($@) @@\
  98. LinkBuildLibrary(Concat(lib,libname.sl)) @@\
  99. @@\
  100. clean:: @@\
  101. $(RM) Concat(lib,libname.sl.rev) Concat(lib,libname.sl)
  102. #endif /* SharedLibraryTarget */
  103. /*
  104. * SharedLibraryDataTarget - generate rules to create shlib data file;
  105. */
  106. #ifndef SharedLibraryDataTarget
  107. # define SharedLibraryDataTarget(libname,rev,salist)
  108. #endif /* SharedLibraryTarget */