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

  1. XCOMM $XConsortium: os2Lib.rules /main/1 1996/10/31 14:47:29 kaleb $
  2.  
  3.  
  4.  
  5. XCOMM $XFree86: xc/config/cf/os2Lib.rules,v 3.7.2.2 1999/07/13 07:09:36 hohndel Exp $
  6.  
  7. /*
  8.  * OS2/EMX shared library rules (DLL version)
  9.  */
  10. #ifndef __EMX__
  11. #error You must edit os2Lib.rules for your (non-EMX) OS/2 dev system
  12. #endif
  13.  
  14. #ifndef HasSharedLibraries
  15. #define HasSharedLibraries YES
  16. #endif
  17. #ifndef ForceNormalLib
  18. #define ForceNormalLib NO
  19. #endif
  20.  
  21. #define SharedOldX NO
  22.  
  23. #ifndef SharedDataSeparation
  24. #define SharedDataSeparation NO
  25. #endif
  26. #ifndef SharedCodeDef
  27. #define SharedCodeDef /**/
  28. #endif
  29. #ifndef SharedLibraryDef
  30. #define SharedLibraryDef /**/
  31. #endif
  32. #ifndef ShLibIncludeFile
  33. #define ShLibIncludeFile <os2Lib.tmpl>
  34. #endif
  35. #ifndef SharedLibraryLoadFlags
  36. #define SharedLibraryLoadFlags /**/
  37. #endif
  38. #ifndef PositionIndependentCFlags
  39. #define PositionIndependentCFlags -Zdll -Zomf -Zmtd
  40. #endif
  41.  
  42. #ifndef NormalSharedLibObjCompile
  43. #define NormalSharedLibObjCompile(options) $(RM) $@                        @@\
  44.     $(CC) -c $(CFLAGS) options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS) $*.c @@\
  45.     touch $*.o
  46. #endif
  47.  
  48. #ifndef InstallSharedLibrary
  49. #ifdef BuildImplibs
  50. #define InstallSharedLibrary(libname,rev,dest)                @@\
  51. install:: libname.dll libname.a    libname.lib                @@\
  52.     MakeDir($(DESTDIR)dest)                        @@\
  53.     $(INSTALL) -c $(INSTLIBFLAGS) libname.dll $(DESTDIR)dest     @@\
  54.     $(INSTALL) -c $(INSTLIBFLAGS) libname.a $(DESTDIR)dest         @@\
  55.     $(INSTALL) -c $(INSTLIBFLAGS) libname.lib $(DESTDIR)dest
  56. #else
  57. #define InstallSharedLibrary(libname,rev,dest)                @@\
  58. install:: libname.dll libname.a                        @@\
  59.     MakeDir($(DESTDIR)dest)                        @@\
  60.     $(INSTALL) -c $(INSTLIBFLAGS) libname.a $(DESTDIR)dest        @@\
  61.     $(INSTALL) -c $(INSTLIBFLAGS) libname.dll $(DESTDIR)dest
  62. #endif
  63. #endif /* InstallSharedLibrary */
  64.  
  65. /*#ifdef UseInstalled
  66. #define LinkBuildLibrary(lib) $(_NULLCMD_)
  67. #else*/
  68. #define LinkBuildLibrary(lib) MakeDir($(BUILDLIBDIR))            @@\
  69.     RemoveFile($(BUILDLIBDIR)/lib)                    @@\
  70.     ImakeIndir $(BUILDLIBDIR) $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/lib .
  71. /*#endif*/
  72.  
  73.         EMXIMP = emximp
  74.         EMXOMF = emxomf
  75.           SHLD = gcc -Zomf -Zdll -Zmtd
  76.      SHADDLIBS = -lbsd -lsocket -lc_import
  77. #ifndef BuildDllSupportLibs
  78. /*#ifdef UseInstalled
  79. #define BuildDllSupportLibs(slib) $(_NULLCMD_)
  80. #else*/
  81. #define BuildDllSupportLibs(slib)                    @@\
  82.     $(EMXIMP) -o slib.imp slib.def                    @@\
  83.     $(EMXIMP) -o slib.a slib.imp                    @@\
  84.     $(EMXOMF) -s -l slib.a                         @@\
  85.     LinkBuildLibrary(slib.a)                    @@\
  86.     LinkBuildLibrary(slib.lib)
  87. /*#endif*/
  88. #endif
  89.  
  90. #ifndef BuildDllSupportLibs2
  91. /*#ifdef UseInstalled
  92. #define BuildDllSupportLibs2(slib) $(_NULLCMD_)
  93. #else*/
  94. #define BuildDllSupportLibs2(slib)                    @@\
  95.     $(EMXIMP) -o slib.imp Concat3(slib,os2,.def)            @@\
  96.     $(EMXIMP) -o slib.a slib.imp                    @@\
  97.     $(EMXOMF) -s -l slib.a                         @@\
  98.     LinkBuildLibrary(slib.a)                    @@\
  99.     LinkBuildLibrary(slib.lib)
  100. /*#endif*/
  101. #endif
  102.  
  103. #ifndef BuildLibSupportLibs
  104. /*#ifdef UseInstalled
  105. #define BuildLibSupportLibs(slib) $(_NULLCMD_)
  106. #else*/
  107. #define BuildLibSupportLibs(slib)                    @@\
  108.     $(EMXOMF) -s -l slib.a                         @@\
  109.     LinkBuildLibrary(slib.a)                    @@\
  110.     LinkBuildLibrary(slib.lib)
  111. /*#endif*/
  112. #endif
  113.  
  114. #ifndef SharedLibraryTarget
  115. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  116. AllTarget(libname.dll)                            @@\
  117. .SUFFIXES: .obj .rsp .def                        @@\
  118.         LBRPATH = $(subst /,\,$(LIBRARY_PATH))                @@\
  119.         LBRDEF = Concat3(libname,os2,.def)                @@\
  120.     LBRCPPDEF = Concat3(libname,os2,-def.cpp)            @@\
  121.     LBRRSP = Concat3(libname,os2,.rsp)                @@\
  122.                                     @@\
  123. link.rsp: $(LBRRSP) $(LBRDEF)                        @@\
  124.     @echo $(LBRPATH)\\dll0.obj+ >link.rsp                @@\
  125.     @cat $(LBRRSP) >>link.rsp                    @@\
  126.     @echo $(LBRPATH)\\mt\\ $(LBRPATH)\\ $(REQUIREDLIBS) bsd socket c_alias c_static c_import os2 emx2 end >>link.rsp    @@\
  127.     @echo $(LBRDEF) >>link.rsp                    @@\
  128.                                     @@\
  129. libname.dll:  $(OBJS) link.rsp                        @@\
  130.     link386 @link.rsp >nul                        @@\
  131.     BuildDllSupportLibs2(libname)                    @@\
  132.     LinkBuildLibrary(libname.dll)                    @@\
  133.                                     @@\
  134. clean::                                    @@\
  135.     $(RM) libname.lib libname.imp *.obj link.rsp
  136. #endif /* SharedLibraryTarget */
  137.  
  138. #ifndef NormalLibraryTarget
  139. #define    NormalLibraryTarget(libname,objlist)                @@\
  140. AllTarget(LibraryTargetName(libname))                    @@\
  141.                                     @@\
  142. LibraryTargetName(libname): objlist                    @@\
  143.     RemoveFile($@)                            @@\
  144.     MakeLibrary($@,objlist)                        @@\
  145.     RanLibrary($@)                            @@\
  146.     BuildLibSupportLibs($*)
  147. #endif /* NormalLibraryTarget */
  148.  
  149. #ifndef NormalDepLibraryTarget
  150. #define    NormalDepLibraryTarget(libname,deplist,objlist)            @@\
  151. AllTarget(LibraryTargetName(libname))                    @@\
  152.                                     @@\
  153. LibraryTargetName(libname): deplist                    @@\
  154.     RemoveFile($@)                            @@\
  155.     MakeLibrary($@,objlist)                        @@\
  156.     RanLibrary($@)                            @@\
  157.     BuildLibSupportLibs($*)
  158. #endif /* NormalDepLibraryTarget */
  159.  
  160. #ifndef SharedLibraryDataTarget
  161. #define SharedLibraryDataTarget(libname,rev,salist)
  162. #endif /* SharedLibraryDataTarget */
  163.  
  164. #ifndef InstallSharedLibraryData
  165. #define InstallSharedLibraryData(libname,rev,dest)
  166. #endif /* InstallSharedLibraryData */
  167.  
  168. #ifndef InstallLibrary
  169. #define    InstallLibrary(libname,dest)                    @@\
  170. install:: LibraryTargetName(libname)                    @@\
  171.     MakeDir($(DESTDIR)dest)                        @@\
  172.     $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) LibraryTargetName(libname) $(DESTDIR)dest @@\
  173.     $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(libname,.lib) $(DESTDIR)dest @@\
  174.     RanLibrary($(RANLIBINSTFLAGS) $(DESTDIR)dest/LibraryTargetName(libname))
  175. #endif /* InstallLibrary */
  176.  
  177. #ifndef LibMkdir
  178. #define LibMkdir(dir) ImakeHelper 11 dir
  179. #endif
  180.  
  181. #ifndef LibCleanDir
  182. #define LibCleanDir(dir)                         @@\
  183.     ImakeIndir dir call RemoveFiles(*.Osuf)
  184. #endif
  185.  
  186. #define MakeStaticLibrary(libname) $(AR) libname *.o
  187.  
  188. #ifndef UnsharedLibraryTarget
  189. #define    UnsharedLibraryTarget(libname,objlist,down,up)            @@\
  190. AllTarget(LibraryTargetName(Concat(libname,_s)))            @@\
  191.                                     @@\
  192. LibraryTargetName(Concat(libname,_s)): objlist                @@\
  193.     RemoveFile($@)                            @@\
  194.     ImakeIndir down MakeStaticLibrary(up/$@)            @@\
  195.     RanLibrary($@)                            @@\
  196.     _LinkBuildLibrary($@)                        @@\
  197.                                     @@\
  198. install::    LibraryTargetName(Concat(libname,_s))            @@\
  199.     $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) LibraryTargetName(Concat(libname,_s)) $(DESTDIR)$(SHLIBDIR)
  200. #endif
  201.  
  202. #ifndef UnsharedLibraryTarget3
  203. #define    UnsharedLibraryTarget3(libname,objlist1,objlist2,objlist3,down,up) @@\
  204. AllTarget(LibraryTargetName(Concat(libname,_s)))            @@\
  205.                                     @@\
  206. LibraryTargetName(Concat(libname,_s)): objlist1 objlist2 objlist3    @@\
  207.     RemoveFile($@)                            @@\
  208.     ImakeIndir down MakeStaticLibrary(up/$@)            @@\
  209.     RanLibrary($@)                            @@\
  210.     _LinkBuildLibrary($@)                        @@\
  211.                                     @@\
  212. install::    LibraryTargetName(Concat(libname,_s))            @@\
  213.     $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) LibraryTargetName(Concat(libname,_s)) $(DESTDIR)$(SHLIBDIR)
  214. #endif /* UnsharedLibraryTarget3 */
  215.  
  216. /*
  217.  * DebuggedLibraryTarget - generate rules to create a debuggable library.
  218.  */
  219. #ifndef DebuggedLibraryTarget
  220. #define    DebuggedLibraryTarget(libname,objlist)                @@\
  221. AllTarget(LibraryTargetNameSuffix(libname,_d))                @@\
  222.                                     @@\
  223. LibraryTargetNameSuffix(libname,_d): objlist $(EXTRALIBRARYDEPS)    @@\
  224.     RemoveFile($@)                            @@\
  225.     ImakeIndir debugger MakeStaticLibrary(../$@)            @@\
  226.     RanLibrary($@)                            @@\
  227.     _LinkBuildLibrary($@)
  228.  
  229. #endif /* DebuggedLibraryTarget */
  230.  
  231. /*
  232.  * ProfiledLibraryTarget - generate rules to create a profiled library.
  233.  */
  234. #ifndef ProfiledLibraryTarget
  235. #define    ProfiledLibraryTarget(libname,objlist)                @@\
  236. AllTarget(LibraryTargetNameSuffix(libname,_p))                @@\
  237.                                     @@\
  238. LibraryTargetNameSuffix(libname,_p): objlist $(EXTRALIBRARYDEPS)    @@\
  239.     RemoveFile($@)                            @@\
  240.     ImakeIndir profiled MakeStaticLibrary(../$@)            @@\
  241.     RanLibrary($@)                            @@\
  242.     _LinkBuildLibrary($@)
  243.  
  244. #endif /* ProfiledLibraryTarget */
  245.  
  246. /*
  247. define ExtraLibMkdir() $(_NULLCMD_)
  248. define ExtraObjCompile(options) $(_NULLCMD_)
  249. define ExtraObjCplusplusCompile(options) $(_NULLCMD_)
  250. define ExtraCleanDir() $(_NULLCMD_)
  251. */