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

  1. XCOMM $XFree86: xc/config/cf/nto.rules,v 1.1.2.1 1999/07/29 09:40:13 hohndel Exp $ 
  2. XCOMM Rules for QNX/Neutrino
  3. XCOMM Note that some of these will disappear when we stop cross-compiling
  4.  
  5. #ifndef HasSharedLibraries
  6. #define HasSharedLibraries YES
  7. #endif
  8.  
  9. #ifndef SharedDataSeparation
  10. #define SharedDataSeparation NO
  11. #endif
  12. #ifndef SharedCodeDef
  13. #define SharedCodeDef /**/
  14. #endif
  15. #ifndef SharedLibraryDef
  16. #define SharedLibraryDef /**/
  17. #endif
  18. #ifndef SharedLibraryLoadFlags
  19. #define SharedLibraryLoadFlags -shared
  20. #endif
  21. #ifndef PositionIndependentCFlags
  22. #define PositionIndependentCFlags -fPIC
  23. #endif
  24. #ifndef PositionIndependentCplusplusFlags
  25. #define PositionIndependentCplusplusFlags -fPIC
  26. #endif
  27.  
  28. #define LinkFile(tofile, fromfile)                @@\
  29. tofile:: fromfile                        @@\
  30.     $(CP) fromfile tofile                    @@\
  31.                                 @@\
  32. includes:: tofile                        @@\
  33.                                 @@\
  34. depend:: tofile                            @@\
  35.                                 @@\
  36. clean::                                @@\
  37.     RemoveFile(tofile)
  38.  
  39. XCOMM This special rule is used to install the install script.
  40. XCOMM Else theres a name conflict with the QNX installer.
  41.  
  42. #define QNXCopyInstaller(tofile, fromfile)            @@\
  43. tofile::                             @@\
  44.     $(CP) fromfile tofile                    @@\
  45.                                 @@\
  46. includes:: tofile
  47.  
  48.  
  49. #define ObjectFromSpecialSource(dst, src, flags)        @@\
  50. NoConfigRec(dst.c)                        @@\
  51.                                 @@\
  52. dst.c: src.c                            @@\
  53.     RemoveFile($@)                        @@\
  54.     $(CP) $? $@                        @@\
  55.                                 @@\
  56. SpecialCObjectRule(dst,NullParameter,flags)            @@\
  57.                                 @@\
  58. includes:: dst.c                        @@\
  59.                                 @@\
  60. depend:: dst.c                            @@\
  61.                                 @@\
  62. clean::                                @@\
  63.     RemoveFile(dst.c)
  64.  
  65.  
  66. #define ObjectFromSpecialAsmSource(dst, src, flags)        @@\
  67. dst.s: src.s                            @@\
  68.     RemoveFile($@)                        @@\
  69.     $(CP) $? $@                        @@\
  70.                                 @@\
  71. dst.o: dst.s                            @@\
  72.     AssembleObject(flags)                    @@\
  73.                                 @@\
  74. dst.i: dst.s                            @@\
  75.     CPPOnlyAsm(dst,flags)                    @@\
  76.                                 @@\
  77. depend:: dst.s                            @@\
  78.                                 @@\
  79. clean::                                @@\
  80.     RemoveFile(dst.s)
  81.  
  82. XCOMM Special rule ComplexHostProgramTarget needed to compile 
  83. XCOMM our utilities locally because we are cross-compiling...
  84. XCOMM
  85.  
  86. #define ComplexHostProgramTarget(program)            @@\
  87.            CC=cc                        @@\
  88.            STD_INCLUDES =                    @@\
  89.            CFLAGS=$(TOP_INCLUDES) $(INCLUDES) $(BOOTSTRAPCFLAGS)    @@\
  90.            CCOPTIONS =                        @@\
  91.            EXTRA_LOAD_FLAGS =                    @@\
  92.            PROGRAM = program                    @@\
  93.                                 @@\
  94. AllTarget(program)                        @@\
  95.                                 @@\
  96. program: $(OBJS) $(DEPLIBS)                    @@\
  97.     RemoveTargetProgram($@)                    @@\
  98.     HostLinkRule($@,$(_NOOP_),$(OBJS),$(DEPLIBS) $(LOCAL_LIBRARIES)) @@\
  99.                                 @@\
  100. DependTarget()                            @@\
  101.                                 @@\
  102. clean::                                @@\
  103.     RemoveFile(ProgramTargetName(program))
  104.  
  105. XCOMM And this rule is again for a host simple host program when cross-compiling.
  106. XCOMM
  107.  
  108. #define SimpleHostProgramTarget(program)            @@\
  109.          OBJS = program.o                    @@\
  110.          SRCS = program.c                    @@\
  111.                                 @@\
  112. ComplexHostProgramTarget(program)
  113.     
  114. #define HostLinkRule(target,flags,src,libs)            @@\
  115.     cc -F -o target src $(ALLINCLUDES)
  116.  
  117. #ifndef FixupLibReferences
  118. #define FixupLibReferences()                        @@\
  119. XMULIBONLY = -lXmu                            @@\
  120. XMULIB = $(XMULIBONLY) $(XTOOLLIB) $(XLIB)
  121. #endif
  122.  
  123. #ifndef SharedLibraryTarget
  124. #ifdef UseInstalled
  125. #define LinkBuildSonameLibrary(lib) true
  126. #else
  127. #define LinkBuildSonameLibrary(lib) (RemoveFile($(BUILDLIBDIR)/lib); \
  128.     cd $(BUILDLIBDIR); $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/lib .)
  129. #endif
  130.  
  131. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  132. AllTarget(Concat(lib,libname.so.rev))                    @@\
  133.                                     @@\
  134. Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)            @@\
  135.     $(RM) $@~                            @@\
  136.     @SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; set -x; \        @@\
  137.         (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  138.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  139.         LinkBuildSonameLibrary($$SONAME)            @@\
  140.     $(RM) $@                             @@\
  141.     $(MV) $@~ $@                            @@\
  142.     $(RM) Concat(lib,libname.so)                    @@\
  143.     $(LN) $@ Concat(lib,libname.so)                    @@\
  144.     LinkBuildLibrary($@)                        @@\
  145.     LinkBuildLibrary(Concat(lib,libname.so))            @@\
  146.                                     @@\
  147. clean::                                    @@\
  148.     @MAJREV=`expr rev : '\(.*\)\.'`; \                @@\
  149.     set -x; $(RM) Concat(lib,libname.so.$$MAJREV)            @@\
  150.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  151. #endif
  152. /*
  153.  * InstallSharedLibrary - generate rules to install the shared library.
  154.  * NOTE: file must be executable, hence "INSTBINFLAGS"
  155.  */
  156. #ifndef InstallSharedLibrary
  157. #define    InstallSharedLibrary(libname,rev,dest)                @@\
  158. install:: Concat(lib,libname.so.rev)                     @@\
  159.     MakeDir($(DESTDIR)dest)                        @@\
  160.     $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  161.     @T=`echo Concat($(DESTDIR)dest/lib,libname.so.rev) | sed 's/\.[^\.]*$$//'`;\
  162.       set -x; $(RM) $$T && $(LN) Concat(lib,libname.so.rev) $$T    @@\
  163.     $(RM) Concat($(DESTDIR)dest/lib,libname.so)            @@\
  164.     $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)
  165. #endif /* InstallSharedLibrary */
  166.  
  167. /*
  168.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  169.  */
  170. #ifndef SharedLibraryDataTarget
  171. #define SharedLibraryDataTarget(libname,rev,salist)
  172. #endif /* SharedLibraryTarget */
  173.  
  174. /*
  175.  * InstallSharedLibraryData - generate rules to install the shared library data
  176.  */
  177. #ifndef InstallSharedLibraryData
  178. #define    InstallSharedLibraryData(libname,rev,dest)
  179. #endif /* InstallSharedLibraryData */
  180.  
  181. #define BaseShLibReqs
  182.  
  183.  
  184.  
  185. /*
  186.  * ServerTargetWithFlags - generate rules to compile, link, and relink a server
  187.  */
  188. #ifndef ServerTargetWithFlags
  189. #define    ServerTargetWithFlags(server,subdirs,objects,libs,syslibs,flags) @@\
  190. AllTarget(ProgramTargetName(server))                    @@\
  191. ProgramTargetName(server): subdirs objects libs                @@\
  192.     MoveToBakFile($@)                        @@\
  193.     LinkRule($@,$(LDOPTIONS),objects,libs $(LDLIBS) syslibs)     @@\
  194.                                     @@\
  195. Concat(load,server):                            @@\
  196.     MoveToBakFile(ProgramTargetName(server))            @@\
  197.     LinkRule(ProgramTargetName(server),$(LDOPTIONS),objects,libs $(LDLIBS) syslibs) @@\
  198.                                     @@\
  199. loadX:: Concat(load,server)                        @@\
  200.                                     @@\
  201. SentinelProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
  202. SentinelLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
  203. PurifyProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
  204. PurifyLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
  205. ProofProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
  206. ProofLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
  207.                                     @@\
  208. InstallProgramWithFlags(server,$(BINDIR),flags)                @@\
  209.                                     @@\
  210. clean::                                    @@\
  211.     RemoveFile(ProgramTargetName(server))
  212. #endif /* ServerTargetWithFlags */
  213.