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

  1. /*
  2.  * GNU/Hurd shared library rules
  3.  *
  4.  * $XFree86: xc/config/cf/gnuLib.rules,v 1.1.2.2 1998/12/22 12:27:32 hohndel Exp $
  5.  */
  6.  
  7. #ifndef UseElfFormat
  8. #define UseElfFormat YES
  9. #endif
  10.  
  11. /*
  12.  * GNU/Hurd shared library rules
  13.  * Cloned from NetBSD/FreeBSD (ELF) shared library rules
  14.  *
  15.  */
  16.  
  17. #ifndef HasSharedLibraries
  18. #define HasSharedLibraries YES
  19. #endif
  20. #ifndef ForceNormalLib
  21. #define ForceNormalLib YES
  22. #endif
  23.  
  24. #ifndef BaseShLibReqs
  25. #define BaseShLibReqs        /* -lc implied by $(CC) */
  26. #endif
  27.  
  28. #ifndef SharedDataSeparation
  29. #define SharedDataSeparation NO
  30. #endif
  31. #ifndef SharedCodeDef
  32. #define SharedCodeDef /**/
  33. #endif
  34. #ifndef SharedLibraryDef
  35. #define SharedLibraryDef /**/
  36. #endif
  37. #ifndef ShLibIncludeFile
  38. #define ShLibIncludeFile <gnuLib.tmpl>
  39. #endif
  40. #ifndef SharedLibraryLoadFlags
  41. #define SharedLibraryLoadFlags -shared -Wl,-rpath=$(USRLIBDIR)
  42. #endif
  43. #ifndef PositionIndependentCFlags
  44. #define PositionIndependentCFlags -fPIC
  45. #endif
  46. #ifndef PositionIndependentCplusplusFlags
  47. #define PositionIndependentCplusplusFlags -fPIC
  48. #endif
  49. #ifndef ExtraLoadFlags
  50. #ifdef UseInstalled
  51. #define ExtraLoadFlags -Wl,-rpath=$(USRLIBDIRPATH)
  52. #else
  53. #define ExtraLoadFlags -Wl,-dynamic-linker=/lib/ld.so.1 -Wl,-rpath=/lib:$(USRLIBDIRPATH) -Wl,-rpath-link=$(BUILDLIBDIR)
  54. #endif
  55. #endif
  56.  
  57. /*
  58.  * InstallSharedLibrary - generate rules to install the shared library.
  59.  * NOTE: file must be executable, hence "INSTBINFLAGS"
  60.  */
  61. #ifndef InstallSharedLibrary
  62. #define InstallSharedLibrary(libname,rev,dest)                @@\
  63. install:: Concat(lib,libname.so.rev)                     @@\
  64.     MakeDir($(DESTDIR)dest)                        @@\
  65.     $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  66.     (T=`echo Concat($(DESTDIR)dest/lib,libname.so.rev) | sed 's/\.[^\.]*$$//'`;\
  67.         $(RM) $$T && $(LN) Concat(lib,libname.so.rev) $$T)    @@\
  68.     (T=`echo Concat($(DESTDIR)dest/lib,libname.so.rev) | sed 's/\.so.*$$/.so/'`;\
  69.         $(RM) $$T && $(LN) Concat(lib,libname.so.rev) $$T)    @@\
  70.     $(RM) Concat($(DESTDIR)dest/lib,libname.so)            @@\
  71.     $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)
  72. #endif /* InstallSharedLibrary */
  73.  
  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.  
  82. /*
  83.  * SharedLibraryTarget - generate rules to create a shared library;
  84.  * build it into a different name so that we do not hose people by having
  85.  * the library gone for long periods.
  86.  */
  87. #ifndef SharedLibraryTarget
  88. #ifdef UseInstalled  
  89. #define LinkBuildSonameLibrary(lib) true
  90. #else
  91. #define LinkBuildSonameLibrary(lib) (RemoveFile($(BUILDLIBDIR)/lib); \
  92.     cd $(BUILDLIBDIR); $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/lib .)
  93. #endif
  94.  
  95. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  96. AllTarget(Concat(lib,libname.so.rev))                    @@\
  97.                                     @@\
  98. Concat(lib,libname.so.rev):  solist                    @@\
  99.     $(RM) $@~                            @@\
  100.     SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; \            @@\
  101.         (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  102.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  103.         LinkBuildSonameLibrary($$SONAME)            @@\
  104.     $(RM) $@                            @@\
  105.     $(MV) $@~ $@                            @@\
  106.     $(RM) Concat(lib,libname.so)                    @@\
  107.     $(LN) $@ Concat(lib,libname.so)                    @@\
  108.     LinkBuildLibrary($@)                        @@\
  109.     LinkBuildLibrary(Concat(lib,libname.so))            @@\
  110.                                     @@\
  111. clean::                                    @@\
  112.     $(RM) Concat(lib,libname.so.rev)
  113.  
  114. #endif /* SharedLibraryTarget */
  115.  
  116. /*
  117.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  118.  */
  119. #ifndef SharedLibraryDataTarget
  120. #define SharedLibraryDataTarget(libname,rev,salist)
  121. #endif /* SharedLibraryTarget */
  122.