home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / Fresco / build / Unix / config / cf / sunLib.rules < prev    next >
Encoding:
Text File  |  1995-07-12  |  4.1 KB  |  137 lines

  1. XCOMM $XConsortium: sunLib.rules,v 1.14 94/03/28 15:24:43 gildea Exp $
  2.  
  3. /*
  4.  * SunOS shared library rules
  5.  */
  6.  
  7. #ifndef HasSharedLibraries
  8. #define HasSharedLibraries YES
  9. #endif
  10. #ifndef SharedDataSeparation
  11. #define SharedDataSeparation YES
  12. #endif
  13. #ifndef SharedCodeDef
  14. #define SharedCodeDef -DSHAREDCODE
  15. #endif
  16. #ifndef SharedLibraryDef
  17. #define SharedLibraryDef -DSUNSHLIB
  18. #endif
  19. #ifndef ShLibIncludeFile
  20. #define ShLibIncludeFile <sunLib.tmpl>
  21. #endif
  22. #ifndef SharedLibraryLoadFlags
  23. #define SharedLibraryLoadFlags -assert pure-text
  24. #endif
  25. #ifndef PositionIndependentCFlags
  26. #if HasGcc2
  27. #define PositionIndependentCFlags -fpic
  28. #else
  29. #define PositionIndependentCFlags -pic
  30. #endif
  31. #endif
  32. #ifndef PositionIndependentCplusplusFlags
  33. #if HasGcc2ForCplusplus
  34. #define PositionIndependentCplusplusFlags -fpic
  35. #else
  36. #define PositionIndependentCplusplusFlags -pic
  37. #endif
  38. #endif
  39.  
  40. /*
  41.  * SharedDSLibDependencies - shared library dependencies with data separation
  42.  */
  43. #ifndef SharedDSLibDependencies
  44. #define SharedDSLibDependencies(libname,libsource,revname) _UseCat($(USRLIBDIR)/lib,libsource/lib,libname.sa.$(revname))
  45. #endif
  46.  
  47. /*
  48.  * InstallSharedLibrary - generate rules to install the shared library.
  49.  */
  50. #ifndef InstallSharedLibrary
  51. #define    InstallSharedLibrary(libname,rev,dest)                @@\
  52. install:: Concat(lib,libname.so.rev)                     @@\
  53.     MakeDir($(DESTDIR)dest)                        @@\
  54.     $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  55.     $(RM) Concat($(DESTDIR)dest/lib,libname.so)            @@\
  56.     $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)
  57. #endif /* InstallSharedLibrary */
  58.  
  59. /*
  60.  * InstallSharedLibraryData - generate rules to install the shared library data
  61.  */
  62. #ifndef InstallSharedLibraryData
  63. #define    InstallSharedLibraryData(libname,rev,dest)            @@\
  64. install:: Concat(lib,libname.sa.rev)                    @@\
  65.     MakeDir($(DESTDIR)dest)                        @@\
  66.     $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.sa.rev) $(DESTDIR)dest @@\
  67.     RanLibrary($(RANLIBINSTFLAGS) Concat($(DESTDIR)dest/lib,libname.sa.rev))
  68. #endif /* InstallSharedLibraryData */
  69.  
  70. #if HasPurify
  71. #define PureCleanSharedLibrary(libname,rev)                @@\
  72. clean clean.pure::                            @@\
  73.     $(RM) Concat3(lib,libname,_pure_*.so.rev)
  74. #else
  75. #define PureCleanSharedLibrary(libname,rev) /**/
  76. #endif
  77.  
  78. /*
  79.  * SharedCplusplusLibraryTarget - generate rules to create a shared C++
  80.  * library.  Note that replacing $(LD) with $(CXXLINK) does NOT work
  81.  * on SunOS 4.1.x with gcc 2.x.
  82.  */
  83. #ifndef SharedCplusplusLibraryTarget
  84. #define SharedCplusplusLibraryTarget(libname,rev,solist,down,up,need_libs) @@\
  85. AllTarget(Concat(lib,libname.so.rev))                    @@\
  86.                                     @@\
  87. Concat(lib,libname.so.rev):  solist                    @@\
  88.     $(RM) $@                            @@\
  89.     $(LD) -o $@ $(SHLIBLDFLAGS) solist need_libs            @@\
  90.     $(RM) Concat(lib,libname.so)                    @@\
  91.     $(LN) $@ Concat(lib,libname.so)                    @@\
  92.                                     @@\
  93. clean::                                    @@\
  94.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)        @@\
  95.                                     @@\
  96. PureCleanSharedLibrary(libname,rev)
  97. #endif /* SharedCplusplusLibraryTarget */
  98.  
  99. /*
  100.  * NormalSharedLibraryTarget - generate rules to create a shared library;
  101.  * build it into a different name so that the we do not hose people by having
  102.  * the library gone for long periods.
  103.  */
  104. #ifndef SharedLibraryTarget
  105. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  106. AllTarget(Concat(lib,libname.so.rev))                    @@\
  107.                                     @@\
  108. Concat(lib,libname.so.rev):  solist                    @@\
  109.     $(RM) $@~                            @@\
  110.     (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
  111.     $(RM) $@                             @@\
  112.     $(MV) $@~ $@                            @@\
  113.     LinkBuildLibrary($@)                        @@\
  114.                                     @@\
  115. clean::                                    @@\
  116.     $(RM) Concat(lib,libname.so.rev)                @@\
  117.                                     @@\
  118. PureCleanSharedLibrary(libname,rev)
  119. #endif /* SharedLibraryTarget */
  120.  
  121. /*
  122.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  123.  */
  124. #ifndef SharedLibraryDataTarget
  125. #define SharedLibraryDataTarget(libname,rev,salist)            @@\
  126. AllTarget(Concat(lib,libname.sa.rev))                    @@\
  127.                                     @@\
  128. Concat(lib,libname.sa.rev):  salist                    @@\
  129.     $(RM) $@                            @@\
  130.     $(AR) $@ salist                            @@\
  131.     RanLibrary($@)                            @@\
  132.     LinkBuildLibrary($@)                        @@\
  133.                                     @@\
  134. clean::                                    @@\
  135.     $(RM) Concat(lib,libname.sa.rev)
  136. #endif /* SharedLibraryDataTarget */
  137.