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

  1. XCOMM $XConsortium: sv4Lib.rules /main/18 1996/09/28 16:13:29 rws $
  2. XCOMM $XFree86: xc/config/cf/sv4Lib.rules,v 3.4 1996/12/23 05:50:34 dawes Exp $
  3.  
  4. /*
  5.  * SVR4 shared library rules
  6.  */
  7.  
  8. #ifndef HasSharedLibraries
  9. # define HasSharedLibraries YES
  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 <sv4Lib.tmpl>
  22. #endif
  23. #ifndef SharedLibraryLoadFlags
  24. # define SharedLibraryLoadFlags -G -z text
  25. #endif
  26. #ifndef PositionIndependentCFlags
  27. # if HasGcc2
  28. #  define PositionIndependentCFlags -fpic
  29. # else
  30. #  define PositionIndependentCFlags -K PIC
  31. # endif
  32. #endif
  33. #ifndef PositionIndependentCplusplusFlags
  34. # if HasGcc2ForCplusplus
  35. #  define PositionIndependentCplusplusFlags -fpic
  36. # else
  37. #  define PositionIndependentCplusplusFlags -K PIC
  38. # endif
  39. #endif
  40. #ifndef UseExportLists
  41. # define UseExportLists NO
  42. #endif
  43.  
  44. /*
  45.  * InstallSharedLibrary - generate rules to install the shared library.
  46.  */
  47. #ifndef InstallSharedLibrary
  48. #if StripInstalledPrograms
  49. # define InstallSharedLibrary(libname,rev,dest)                @@\
  50. install:: Concat(lib,libname.so.rev)                     @@\
  51.     MakeDir($(DESTDIR)dest)                        @@\
  52.     $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  53.     mcs -d Concat($(DESTDIR)dest/lib,libname.so.rev)        @@\
  54.     $(RM) Concat($(DESTDIR)dest/lib,libname.so)            @@\
  55.     cd $(DESTDIR)dest; $(LN) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  56. #else
  57. # define InstallSharedLibrary(libname,rev,dest)                @@\
  58. install:: Concat(lib,libname.so.rev)                     @@\
  59.     MakeDir($(DESTDIR)dest)                        @@\
  60.     $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  61.     $(RM) Concat($(DESTDIR)dest/lib,libname.so)            @@\
  62.     cd $(DESTDIR)dest; $(LN) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  63. #endif
  64.  
  65. #endif /* InstallSharedLibrary */
  66.  
  67. /*
  68.  * InstallSharedLibraryData - generate rules to install the shared library data
  69.  */
  70. #ifndef InstallSharedLibraryData
  71. # define InstallSharedLibraryData(libname,rev,dest)
  72. #endif /* InstallSharedLibraryData */
  73.  
  74. #ifndef LinkWithExports
  75. # if UseExportLists
  76. #  define LinkWithExports(libname,rev,solist,down,up) \
  77.     (cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -h $@ solist $(REQUIREDLIBS))    @@\
  78.     if [ -f Concat(lib,libname.elist) ]; then \            @@\
  79.         $(RM) down/$@.exports $@.list; \                @@\
  80.         $(CPP) $(ALLINCLUDES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(DEFINES) Concat(lib,libname.elist) | CppSedMagic >$@.list; \    @@\
  81.         $(EXPORTLISTGEN) $@~ $@.list > down/$@.exports; \        @@\
  82.         (cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -h $@ ShlibExportListOpt($@.exports) solist $(REQUIREDLIBS)); \    @@\
  83.         $(RM) down/$@.exports $@.list; \                @@\
  84.     fi;
  85. # else
  86. #  define LinkWithExports(libname,rev,solist,down,up) \
  87.     (cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -h $@ solist $(REQUIREDLIBS))
  88. # endif
  89. #endif
  90.  
  91. /*
  92.  * SharedLibraryTarget - generate rules to create a shared library;
  93.  * build it into a different name so that we do not hose people by having
  94.  * the library gone for long periods.
  95.  */
  96. #ifndef SharedLibraryTarget
  97. # define SharedLibraryTarget(libname,rev,solist,down,up)        @@\
  98. AllTarget(Concat(lib,libname.so.rev))                    @@\
  99.                                     @@\
  100. Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)            @@\
  101.     $(RM) $@~                            @@\
  102.     LinkWithExports(libname,rev,solist,down,up)            @@\
  103.     $(RM) $@                             @@\
  104.     $(MV) $@~ $@                            @@\
  105.     $(RM) Concat(lib,libname.so)                    @@\
  106.     $(LN) $@ Concat(lib,libname.so)                    @@\
  107.     LinkBuildLibrary($@)                        @@\
  108.     LinkBuildLibrary(Concat(lib,libname.so))            @@\
  109.                                     @@\
  110. clean::                                    @@\
  111.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  112.  
  113. #endif /* SharedLibraryTarget */
  114.  
  115.  
  116. #ifndef SharedDepModuleTarget
  117. #define SharedDepModuleTarget(name,deps,solist)                @@\
  118. AllTarget(name)                                @@\
  119.                                     @@\
  120. name: deps                                @@\
  121.     $(RM) $@~                            @@\
  122.     $(LD) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)        @@\
  123.     $(RM) $@                            @@\
  124.     $(MV) $@~ $@                            @@\
  125.                                     @@\
  126. clean::                                    @@\
  127.     $(RM) name
  128.  
  129. #endif /* SharedDepModuleTarget */
  130.  
  131.  
  132. /*
  133.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  134.  */
  135. #ifndef SharedLibraryDataTarget
  136. # define SharedLibraryDataTarget(libname,rev,salist)
  137. #endif /* SharedLibraryTarget */
  138.