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

  1. XCOMM $XConsortium: sgiLib.rules /main/16 1996/09/28 18:11:04 rws $
  2.  
  3. #ifndef HasSharedLibraries
  4. #define HasSharedLibraries YES
  5. #endif
  6. #if OSMajorVersion < 5
  7. #ifndef SharedDataSeparation
  8. #define SharedDataSeparation YES
  9. #endif
  10. #define SharedCodeDef -DSHAREDCODE
  11. #define SharedLibraryDef -DATTSHAREDLIB
  12. #define PositionIndependentCFlags -G 0
  13.  
  14. /*
  15.  * SharedLibraryTarget - generate rules to create a shared library;
  16.  * build it into a different name so that we don't hose people by having
  17.  * the library gone for long periods.
  18.  */
  19. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  20. AllTarget(Concat3(lib,libname,_s))                    @@\
  21.                                     @@\
  22. Concat3(lib,libname,_s): sharedlib.o solist Concat(lib,libname.spec) $(EXTRALIBRARYDEPS)    @@\
  23.     $(RM) $@ $@.a \                            @@\
  24.     && cd down \                            @@\
  25.     && mkshlib -s Concat(up/lib,libname.spec) -t up/$@ -h up/$@.a \    @@\
  26.     && ar rs up/$@.a sharedlib.o                    @@\
  27.     LinkBuildLibrary($@)                        @@\
  28.     LinkBuildLibrary($@.a)                        @@\
  29.                                     @@\
  30. clean::                                    @@\
  31.     $(RM) Concat3(lib,libname,_s) Concat3(lib,libname,_s.a)
  32.  
  33. #define SharedLibraryDataTarget(libname,rev,salist)
  34.  
  35. /*
  36.  * InstallSharedLibrary - generate rules to install the shared library.
  37.  * NOTE: file must be executable, hence "INSTBINFLAGS"
  38.  */
  39. #define    InstallSharedLibrary(libname,rev,dest)                @@\
  40. install:: Concat3(lib,libname,_s)                    @@\
  41.     MakeDir($(DESTDIR)dest)                        @@\
  42.     $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat3(lib,libname,_s.a) $(DESTDIR)dest @@\
  43.     $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat3(lib,libname,_s) $(DESTDIR)dest
  44.  
  45.  
  46. /*
  47.  * InstallSharedLibraryData - generate rules to install the shared library data
  48.  */
  49. #define    InstallSharedLibraryData(libname,rev,dest)            @@\
  50. InstallTarget(install,Concat3(lib,libname,_s.a),$(INSTLIBFLAGS),dest)
  51.  
  52. #else /* OSMajorVersion >= 5 */
  53.  
  54. #ifndef SharedDataSeparation
  55. #define SharedDataSeparation NO
  56. #endif
  57. #ifndef SharedCodeDef
  58. #define SharedCodeDef /**/
  59. #endif
  60. #ifndef SharedLibraryDef
  61. #define SharedLibraryDef /**/
  62. #endif
  63. #ifndef ShLibIncludeFile
  64. #define ShLibIncludeFile <sgiLib.tmpl>
  65. #endif
  66. #ifndef SharedLibraryLoadFlags
  67. #if OSMajorVersion < 6
  68. #define SharedLibraryLoadFlags -shared
  69. #else
  70. #ifndef Mips64Architecture
  71. #define SharedLibraryLoadFlags -shared
  72. #else
  73. #define SharedLibraryLoadFlags -shared -mips3
  74. #endif
  75. #endif
  76. #endif
  77. /* -KPIC is redundant, PIC is always used unless you specify -non_shared */
  78. #ifndef PositionIndependentCFlags
  79. #define PositionIndependentCFlags -KPIC
  80. #endif
  81. #ifndef PositionIndependentCplusplusFlags
  82. #define PositionIndependentCplusplusFlags -KPIC
  83. #endif
  84.  
  85. /*
  86.  * SGI's cc passes an undocumented flag to ld that causes it to look for
  87.  * -lX11 and force use of libX11.so.1.  And it can't be turned off.  Sigh.
  88.  * So we install one of those, too, in the shared library install target.
  89.  */
  90.  
  91. /*
  92.  * InstallSharedLibrary - generate rules to install the shared library.
  93.  */
  94. #ifndef InstallSharedLibrary
  95. #define    InstallSharedLibrary(libname,rev,dest)                @@\
  96. install:: Concat(lib,libname.so.rev)                     @@\
  97.     MakeDir($(DESTDIR)dest)                        @@\
  98.     $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  99.     $(RM) Concat($(DESTDIR)dest/lib,libname.so)            @@\
  100.     cd $(DESTDIR)dest; $(LN) Concat(lib,libname.so.rev) Concat(lib,libname.so) @@\
  101.     if [ "libname" = X11 ]; then \                    @@\
  102.         RemoveFile(Concat($(DESTDIR)dest/lib,libname.so.1)); \    @@\
  103.         cd $(DESTDIR)dest; $(LN) Concat(lib,libname.so.rev) Concat(lib,libname.so.1);\ @@\
  104.     fi
  105.  
  106. #endif /* InstallSharedLibrary */
  107.  
  108. /*
  109.  * InstallSharedLibraryData - generate rules to install the shared library data
  110.  */
  111. #ifndef InstallSharedLibraryData
  112. #define    InstallSharedLibraryData(libname,rev,dest)
  113. #endif /* InstallSharedLibraryData */
  114.  
  115.  
  116. /*
  117.  * SharedLibraryTarget - generate rules to create a shared library;
  118.  * build it into a different name so that we do not hose people by having
  119.  * the library gone for long periods.
  120.  */
  121.  
  122. /*
  123.  * SGI's cc passes an undocumented flag to ld that causes it to look for
  124.  * -lX11 and force use of libX11.so.1.  Sigh.  So we make one of those, too,
  125.  * in the shared library build target.
  126.  */
  127.  
  128. #ifndef sgiX11soHack
  129. #ifdef UseInstalled
  130. #define sgiX11soHack(libname) /**/
  131. #else
  132. #define sgiX11soHack(libname) if [ "libname" = X11 ]; then \        @@\
  133.         RemoveFile($(BUILDLIBDIR)/Concat(lib,libname.so.1)); \    @@\
  134.         cd $(BUILDLIBDIR); $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/$@ Concat(lib,libname.so.1); \ @@\
  135.     fi
  136. #endif
  137. #endif /* sgiX11soHack */
  138.  
  139. #ifndef SharedLibraryTarget
  140. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  141. AllTarget(Concat(lib,libname.so.rev))                    @@\
  142.                                     @@\
  143. Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)            @@\
  144.     $(RM) $@~                             @@\
  145.     (cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -soname $@ solist $(REQUIREDLIBS))    @@\
  146.     $(RM) $@                            @@\
  147.     $(MV) $@~ $@                            @@\
  148.     $(RM) Concat(lib,libname.so)                    @@\
  149.     $(LN) $@ Concat(lib,libname.so)                    @@\
  150.     LinkBuildLibrary($@)                        @@\
  151.     LinkBuildLibrary(Concat(lib,libname.so))            @@\
  152.     sgiX11soHack(libname)                        @@\
  153.                                     @@\
  154. clean::                                    @@\
  155.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so) so_locations
  156.  
  157. #endif /* SharedLibraryTarget */
  158.  
  159. /*
  160.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  161.  */
  162. #ifndef SharedLibraryDataTarget
  163. #define SharedLibraryDataTarget(libname,rev,salist)
  164. #endif /* SharedLibraryTarget */
  165.  
  166. #endif /* OsMajorVersion < 5 else */
  167.