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

  1. XCOMM $XConsortium: sv3Lib.rules /main/1 1996/10/31 14:47:33 kaleb $
  2.  
  3.  
  4.  
  5. XCOMM $XFree86: xc/config/cf/sv3Lib.rules,v 3.1 1996/12/27 06:50:27 dawes Exp $
  6. /*
  7.  * SVR3 shared library rules
  8.  * Copyright (c) 1992, 1993 by Thomas Wolfram, Berlin, Germany
  9.  * Author: Thomas Wolfram, thomas@aeon.in-berlin.de, wolf@prz.tu-berlin.de
  10.  * Conception derived partially from work of Thomas Roell
  11.  */
  12.  
  13. #ifndef HasSharedLibraries
  14. #define HasSharedLibraries NO        /* JUST FOR NOW */
  15. #endif
  16. #ifndef ForceNormalLib
  17. #define ForceNormalLib YES
  18. #endif
  19.  
  20. #ifndef SharedLibSM
  21. #define SharedLibSM HasSharedLibraries
  22. #endif
  23. #ifndef SharedLibXau
  24. #define SharedLibXau HasSharedLibraries
  25. #endif
  26. #ifndef SharedLibXdmcp
  27. #define SharedLibXdmcp HasSharedLibraries
  28. #endif
  29. #ifndef SharedLibXi
  30. #define SharedLibXi HasSharedLibraries
  31. #endif
  32. #ifndef SharedLibXie
  33. #define SharedLibXie HasSharedLibraries
  34. #endif
  35. #ifndef SharedLibXtst
  36. #define SharedLibXtst HasSharedLibraries
  37. #endif
  38. #ifndef SharedLibPhigs
  39. #define SharedLibPhigs HasSharedLibraries
  40. #endif
  41. #ifndef SharedLibICE
  42. #define SharedLibICE HasSharedLibraries
  43. #endif
  44. #ifndef SharedLibFS
  45. #define SharedLibFS HasSharedLibraries
  46. #endif
  47. #ifndef SharedLibX11
  48. #define SharedLibX11 HasSharedLibraries
  49. #endif
  50. #ifndef SharedOldX
  51. #define SharedOldX NO        /* it's obsolete */
  52. #endif
  53. #ifndef SharedLibXt
  54. #define SharedLibXt HasSharedLibraries
  55. #endif
  56. #ifndef SharedLibXaw
  57. #define SharedLibXaw HasSharedLibraries
  58. #endif
  59. #ifndef SharedLibXmu
  60. #define SharedLibXmu HasSharedLibraries
  61. #endif
  62. #ifndef SharedLibXext
  63. #define SharedLibXext HasSharedLibraries
  64. #endif
  65. #ifndef SharedLibPex
  66. #define SharedLibPex NO
  67. #endif
  68.  
  69. #ifndef SharedDataSeparation
  70. #define SharedDataSeparation NO
  71. #endif
  72. #ifndef SharedCodeDef
  73. #define SharedCodeDef /**/
  74. #endif
  75. #ifndef SharedLibraryDef
  76. #define SharedLibraryDef -DSVR3SHLIB
  77. #endif
  78. #ifndef ShLibIncludeFile
  79. #define ShLibIncludeFile <sv3Lib.tmpl>
  80. #endif
  81. #ifndef SharedLibraryLoadFlags
  82. #define SharedLibraryLoadFlags -q
  83. #endif
  84.  
  85. #ifndef PositionIndependentCFlags
  86. # if HasGcc2
  87. #  define PositionIndependentCFlags -msvr3-shlib  
  88. # else
  89. #  define PositionIndependentCFlags /**/
  90. # endif
  91. #endif
  92.  
  93. #ifndef PositionIndependentCplusplusFlags
  94. # if HasGcc2
  95. #  define PositionIndependentCplusplusFlags -msvr3-shlib  
  96. # else
  97. #  define PositionIndependentCplusplusFlags /**/
  98. # endif
  99. #endif
  100.  
  101. #if 0
  102. /*
  103.  * LibCleanDir - helper for cleaning library object subdirectories
  104.  */
  105. #ifndef LibCleanDir
  106. #define LibCleanDir(dir) -@if [ -d dir ]; then \                           @@\
  107.                 (set -x; cd dir; $(RM) *.o *.sd); else exit 0; fi
  108. #endif
  109.  
  110. /*
  111.  * SharedLibObjCompile - compile fragment for shared objects
  112.  */
  113. #ifndef SharedLibObjCompile
  114. #define SharedLibObjCompile(options) $(RM) shared/$@                        @@\
  115.     cat import.h $*.c >_$*.c                                           @@\
  116.         $(CC) -c $(ANSICCOPTIONS) $(CCOPTIONS) $(ALLDEFINES) options \     @@\
  117. $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS) $(CDEBUGFLAGS) _$*.c              @@\
  118.     $(MV) _$*.o shared/$@                                              @@\
  119.     $(RM) _$*.c
  120. #endif
  121.  
  122. /*
  123.  * NormalSharedLibObjCompile - compile fragment for shared object when
  124.  * a normal library is not being built
  125.  */
  126. #ifndef NormalSharedLibObjCompile
  127. #define NormalSharedLibObjCompile(options) $(RM) $@                        @@\
  128.     cat import.h $*.c >_$*.c                                           @@\
  129.         $(CC) -c $(CFLAGS) options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS) _$*.c @@\
  130.     $(MV) _$*.o $@                                                     @@\
  131.     $(RM) _$*.c
  132. #endif
  133.  
  134.  
  135. #ifndef LibraryObjectRule
  136. #define LibraryObjectRule()                                             @@\
  137. all::                                                                   @@\
  138.         _DebuggedLibMkdir()                                             @@\
  139.         _ProfiledLibMkdir()                                             @@\
  140.         _SharedLibMkdir()                                               @@\
  141.                                                                         @@\
  142. includes::                                                              @@\
  143.         _DebuggedLibMkdir()                                             @@\
  144.         _ProfiledLibMkdir()                                             @@\
  145.         _SharedLibMkdir()                                               @@\
  146.                                                                         @@\
  147. .c.o:                                                                   @@\
  148.         _DebuggedObjCompile($(_NOOP_))                                  @@\
  149.         _ProfiledObjCompile($(_NOOP_))                                  @@\
  150.         _SharedObjCompile($(_NOOP_))                                    @@\
  151.         _NormalObjCompile($(_NOOP_))                                    @@\
  152.                                                                         @@\
  153. .SUFFIXES: .sd                                                          @@\
  154. .c.sd:                                                                  @@\
  155.         _SharedDatCompile(-DSVR3SHDAT)                                  @@\
  156.                                                                         @@\
  157. clean::                                                                 @@\
  158.         _DebuggedCleanDir()                                             @@\
  159.         _ProfiledCleanDir()                                             @@\
  160.         _SharedCleanDir()                                               @@\
  161.  
  162. #endif /* LibraryObjectRule */
  163.  
  164.  
  165. /*
  166.  * InstallSharedLibrary - generate rules to install the shared library.
  167.  */
  168. #ifndef InstallSharedLibrary
  169. #if StripInstalledPrograms
  170. #define    InstallSharedLibrary(libname,rev,dest)                @@\
  171. install:: Concat(lib,libname.rev)                     @@\
  172.     MakeDir($(DESTDIR)dest)                        @@\
  173.     $(INSTALL) -c $(INSTLIBFLAGS) Concat3(lib,libname,_s.a) $(DESTDIR)dest @@\
  174.     MakeDir($(DESTDIR)$(LIBDIR)/shlib)                              @@\
  175.         $(INSTALL) -c $(INSTPGMFLAGS) Concat(lib,libname.rev) \         @@\
  176.     $(DESTDIR)$(LIBDIR)/shlib                                       @@\
  177.     strip Concat($(DESTDIR)$(LIBDIR)/shlib/lib,libname.rev)         @@\
  178.     mcs -d Concat($(DESTDIR)$(LIBDIR)/shlib/lib,libname.rev)
  179. #else
  180. #define    InstallSharedLibrary(libname,rev,dest)                @@\
  181. install:: Concat(lib,libname.rev)                     @@\
  182.     MakeDir($(DESTDIR)dest)                        @@\
  183.     $(INSTALL) -c $(INSTLIBFLAGS) Concat3(lib,libname,_s.a) $(DESTDIR)dest @@\
  184.     MakeDir($(DESTDIR)$(LIBDIR)/shlib)                              @@\
  185.         $(INSTALL) -c $(INSTPGMFLAGS) Concat(lib,libname.rev) \         @@\
  186.     $(DESTDIR)$(LIBDIR)/shlib
  187. #endif
  188.  
  189. #endif /* InstallSharedLibrary */
  190.  
  191. /*
  192.  * InstallSharedLibraryData - generate rules to install the shared library data
  193.  */
  194. #ifndef InstallSharedLibraryData
  195. #define    InstallSharedLibraryData(libname,rev,dest)
  196. #endif /* InstallSharedLibraryData */
  197.  
  198.  
  199. /*
  200.  * SharedLibraryTarget - generate rules to create a shared library;
  201.  * build it into a different name so that we do not hose people by having
  202.  * the library gone for long periods.
  203.  */
  204. #ifndef SharedLibraryTarget
  205. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  206. AllTarget(Concat(lib,libname.rev))                    @@\
  207.                                     @@\
  208. Concat(lib,libname.rev):  solist                    @@\
  209.     $(RM) $@ Concat3(lib,libname,_s.a)                @@\
  210.         $(CPP) -DDOWN=down ConnectionFlags ShlibDefines Concat(lib,libname.def) | \ @@\
  211.         sed -e '/^#  *[0-9][0-9]*  *.*$$/d; /^$$/d' >spec.cpp           @@\
  212.         sed -e '1,/#libraries/d; /#externals/,$$d' spec.cpp | \         @@\
  213.         nawk '{ system("ar x " $$1 " " $$2 )}'                          @@\
  214.         echo "#target " Concat($(LIBDIR)/shlib/lib,libname.rev) >spec   @@\
  215.         sed -e '/#libraries/,$$d' spec.cpp >>spec                             @@\
  216.         mkshlib -s spec -t $@ -h Concat3(lib,libname,_s.a) $(SHLIBLDFLAGS)    @@\
  217.         ar rulv Concat3(lib,libname,_s.a) `sed -e '1,/#externals/d' spec.cpp` @@\
  218.         $(RM) spec.cpp spec                                             @@\
  219.                                     @@\
  220. clean::                                    @@\
  221.     $(RM) Concat(lib,libname.rev) Concat3(lib,libname,_s.a)
  222.  
  223. #endif /* SharedLibraryTarget */
  224.  
  225. /*
  226.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  227.  */
  228. #ifndef SharedLibraryDataTarget
  229. #define SharedLibraryDataTarget(libname,rev,salist)
  230. #endif /* SharedLibraryTarget */
  231.  
  232. #endif
  233.