home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / live / usr / X11R6 / lib / X11 / config / sunLib.rules < prev    next >
Text File  |  1999-09-03  |  3KB  |  112 lines

  1. XCOMM $XConsortium: sunLib.rules /main/15 1996/09/28 16:13:16 rws $
  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. InstallTarget(install,Concat(lib,libname.so.rev),$(INSTLIBFLAGS),dest)
  53. #endif /* InstallSharedLibrary */
  54.  
  55. /*
  56.  * InstallSharedLibraryData - generate rules to install the shared library data
  57.  */
  58. #ifndef InstallSharedLibraryData
  59. #define    InstallSharedLibraryData(libname,rev,dest)            @@\
  60. install:: Concat(lib,libname.sa.rev)                    @@\
  61.     MakeDir($(DESTDIR)dest)                        @@\
  62.     $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.sa.rev) $(DESTDIR)dest @@\
  63.     RanLibrary($(RANLIBINSTFLAGS) Concat($(DESTDIR)dest/lib,libname.sa.rev))
  64. #endif /* InstallSharedLibraryData */
  65.  
  66. #if HasPurify
  67. #define PureCleanSharedLibrary(libname,rev)                @@\
  68. clean clean.pure::                            @@\
  69.     $(RM) Concat3(lib,libname,_pure_*.so.rev)
  70. #else
  71. #define PureCleanSharedLibrary(libname,rev) /**/
  72. #endif
  73.  
  74. /*
  75.  * SharedLibraryTarget - generate rules to create a shared library;
  76.  * build it into a different name so that we do not hose people by having
  77.  * the library gone for long periods.
  78.  */
  79. #ifndef SharedLibraryTarget
  80. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  81. AllTarget(Concat(lib,libname.so.rev))                    @@\
  82.                                     @@\
  83. Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)            @@\
  84.     $(RM) $@~                            @@\
  85.     (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
  86.     $(RM) $@                             @@\
  87.     $(MV) $@~ $@                            @@\
  88.     LinkBuildLibrary($@)                        @@\
  89.                                     @@\
  90. clean::                                    @@\
  91.     $(RM) Concat(lib,libname.so.rev)                @@\
  92.                                     @@\
  93. PureCleanSharedLibrary(libname,rev)
  94. #endif /* SharedLibraryTarget */
  95.  
  96. /*
  97.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  98.  */
  99. #ifndef SharedLibraryDataTarget
  100. #define SharedLibraryDataTarget(libname,rev,salist)            @@\
  101. AllTarget(Concat(lib,libname.sa.rev))                    @@\
  102.                                     @@\
  103. Concat(lib,libname.sa.rev):  salist                    @@\
  104.     $(RM) $@                            @@\
  105.     $(AR) $@ salist                            @@\
  106.     RanLibrary($@)                            @@\
  107.     LinkBuildLibrary($@)                        @@\
  108.                                     @@\
  109. clean::                                    @@\
  110.     $(RM) Concat(lib,libname.sa.rev)
  111. #endif /* SharedLibraryDataTarget */
  112.