Global.pp 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. //
  2. // Global.pp
  3. //
  4. // This file is read in before any of the individual Sources.pp files
  5. // are read. It defines a few global variables that are useful to all
  6. // different kinds of build_types.
  7. //
  8. // We start off by defining a number of map variables. These are
  9. // special variables that can be used to look up a particular named
  10. // scope according to a key (that is, according to the value of some
  11. // variable defined within the scope).
  12. // A named scope is defined using the #begin name .. #end name
  13. // sequence. In general, we use these sequences in the various
  14. // Sources.pp files to define the various targets to build. Each
  15. // named scope carries around its set of variable declarations. The
  16. // named scopes are associated with the dirname of the directory in
  17. // which the Sources.pp file was found.
  18. // The first map variable lets us look up a particular library target
  19. // by its target name. The syntax here indicates that we are
  20. // declaring a map variable called "all_libs" whose key is the
  21. // variable $[TARGET] as defined in each instance of a named scope
  22. // called "static_lib_target," "lib_target," and so on in every
  23. // Sources.pp file. (The */ refers to all the Sources.pp files. We
  24. // could also identify a particular file by its directory name, or
  25. // omit the slash to refer to our own Sources.pp file.)
  26. // After defining this map variable, we can look up other variables
  27. // that are defined for the corresponding target. For instances,
  28. // $[all_libs $[SOURCES],dconfig] will return the value of the SOURCES
  29. // variable as set for the dconfig library (that is, the expression
  30. // $[SOURCES] is evaluated within the named scope whose key is
  31. // "dconfig"--whose variable $[TARGET] was defined to be "dconfig").
  32. #map all_libs TARGET(*/static_lib_target */ss_lib_target */lib_target */noinst_lib_target */metalib_target)
  33. // These allow us to determine whether a particular local library is a
  34. // static or a dynamic library. If the library name appears in the
  35. // static_libs map, it is a static library (i.e. libname.a);
  36. // otherwise, it is a dynamic library (libname.so). The target
  37. // ss_lib_target is a special case: these libraries are dynamic where
  38. // it's easy to make them so (e.g. on Unix platforms), and static on
  39. // platforms where dynamic libraries aren't quite so robust (e.g. on
  40. // Windows).
  41. #if $[eq $[PLATFORM],Win32]
  42. #map static_libs TARGET(*/static_lib_target */ss_lib_target)
  43. #map dynamic_libs TARGET(*/lib_target */noinst_lib_target */metalib_target)
  44. #else
  45. #map static_libs TARGET(*/static_lib_target)
  46. #map dynamic_libs TARGET(*/lib_target */ss_lib_target */noinst_lib_target */metalib_target)
  47. #endif
  48. // This lets us identify which metalib, if any, is including each
  49. // named library. That is, $[module $[TARGET],name] will return
  50. // the name of the metalib that includes library name.
  51. #map module COMPONENT_LIBS(*/metalib_target)
  52. // This lets up look up components of a particular metalib.
  53. #map components TARGET(*/lib_target */noinst_lib_target)
  54. // And this lets us look up source directories by dirname.
  55. #map dirnames DIRNAME(*/)
  56. // Define some various compile flags, derived from the variables set
  57. // in Config.pp.
  58. #set INTERROGATE_PYTHON_INTERFACE $[and $[HAVE_PYTHON],$[INTERROGATE_PYTHON_INTERFACE]]
  59. #define run_interrogate $[or $[INTERROGATE_C_INTERFACE],$[INTERROGATE_PYTHON_INTERFACE]]
  60. #define stl_ipath $[wildcard $[STL_IPATH]]
  61. #define stl_lpath $[wildcard $[STL_LPATH]]
  62. #define stl_cflags $[STL_CFLAGS]
  63. #define stl_libs $[STL_LIBS]
  64. #if $[HAVE_PYTHON]
  65. #define python_ipath $[wildcard $[PYTHON_IPATH]]
  66. #define python_lpath $[wildcard $[PYTHON_LPATH]]
  67. #endif
  68. #if $[HAVE_NSPR]
  69. #define nspr_ipath $[wildcard $[NSPR_IPATH]]
  70. #define nspr_lpath $[wildcard $[NSPR_LPATH]]
  71. #define nspr_cflags $[NSPR_CFLAGS]
  72. #define nspr_libs $[NSPR_LIBS]
  73. #endif
  74. #if $[HAVE_CRYPTO]
  75. #define crypto_ipath $[wildcard $[CRYPTO_IPATH]]
  76. #define crypto_lpath $[wildcard $[CRYPTO_LPATH]]
  77. #define crypto_cflags $[CRYPTO_CFLAGS]
  78. #define crypto_libs $[CRYPTO_LIBS]
  79. #endif
  80. #if $[HAVE_ZLIB]
  81. #define zlib_ipath $[wildcard $[ZLIB_IPATH]]
  82. #define zlib_lpath $[wildcard $[ZLIB_LPATH]]
  83. #define zlib_cflags $[ZLIB_CFLAGS]
  84. #define zlib_libs $[ZLIB_LIBS]
  85. #endif
  86. #if $[HAVE_SOXST]
  87. #define soxst_ipath $[wildcard $[SOXST_IPATH]]
  88. #define soxst_lpath $[wildcard $[SOXST_LPATH]]
  89. #define soxst_cflags $[SOXST_CFLAGS]
  90. #define soxst_libs $[SOXST_LIBS]
  91. #endif
  92. #if $[HAVE_GL]
  93. #define gl_ipath $[wildcard $[GL_IPATH]]
  94. #define gl_lpath $[wildcard $[GL_LPATH]]
  95. #define gl_cflags $[GL_CFLAGS]
  96. #define gl_libs $[GL_LIBS]
  97. #endif
  98. #if $[HAVE_GLX]
  99. #define glx_ipath $[wildcard $[GLX_IPATH]]
  100. #define glx_lpath $[wildcard $[GLX_LPATH]]
  101. #define glx_cflags $[GLX_CFLAGS]
  102. #define glx_libs $[GLX_LIBS]
  103. #endif
  104. #if $[HAVE_GLUT]
  105. #define glut_ipath $[wildcard $[GLUT_IPATH]]
  106. #define glut_lpath $[wildcard $[GLUT_LPATH]]
  107. #define glut_cflags $[GLUT_CFLAGS]
  108. #define glut_libs $[GLUT_LIBS]
  109. #endif
  110. #if $[HAVE_DX]
  111. #define dx_ipath $[wildcard $[DX_IPATH]]
  112. #define dx_lpath $[wildcard $[DX_LPATH]]
  113. #define dx_cflags $[DX_CFLAGS]
  114. #define dx_libs $[DX_LIBS]
  115. #endif
  116. #if $[HAVE_JPEG]
  117. #define jpeg_ipath $[wildcard $[JPEG_IPATH]]
  118. #define jpeg_lpath $[wildcard $[JPEG_LPATH]]
  119. #define jpeg_cflags $[JPEG_CFLAGS]
  120. #define jpeg_libs $[JPEG_LIBS]
  121. #endif
  122. #if $[HAVE_TIFF]
  123. #define tiff_ipath $[wildcard $[TIFF_IPATH]]
  124. #define tiff_lpath $[wildcard $[TIFF_LPATH]]
  125. #define tiff_cflags $[TIFF_CFLAGS]
  126. #define tiff_libs $[TIFF_LIBS]
  127. #endif
  128. #if $[HAVE_FFTW]
  129. #define fftw_ipath $[wildcard $[FFTW_IPATH]]
  130. #define fftw_lpath $[wildcard $[FFTW_LPATH]]
  131. #define fftw_cflags $[FFTW_CFLAGS]
  132. #define fftw_libs $[FFTW_LIBS]
  133. #endif
  134. #if $[HAVE_NURBSPP]
  135. #define nurbspp_ipath $[wildcard $[NURBSPP_IPATH]]
  136. #define nurbspp_lpath $[wildcard $[NURBSPP_LPATH]]
  137. #define nurbspp_cflags $[NURBSPP_CFLAGS]
  138. #define nurbspp_libs $[NURBSPP_LIBS]
  139. #endif
  140. #if $[HAVE_VRPN]
  141. #define vrpn_ipath $[wildcard $[VRPN_IPATH]]
  142. #define vrpn_lpath $[wildcard $[VRPN_LPATH]]
  143. #define vrpn_cflags $[VRPN_CFLAGS]
  144. #define vrpn_libs $[VRPN_LIBS]
  145. #endif
  146. #if $[HAVE_MIKMOD]
  147. #define mikmod_ipath $[wildcard $[MIKMOD_IPATH]]
  148. #define mikmod_lpath $[wildcard $[MIKMOD_LPATH]]
  149. #define mikmod_cflags $[MIKMOD_CFLAGS]
  150. #define mikmod_libs $[MIKMOD_LIBS]
  151. #endif
  152. #if $[HAVE_GTKMM]
  153. #define gtkmm_ipath $[wildcard $[GTKMM_IPATH]]
  154. #define gtkmm_lpath $[wildcard $[GTKMM_LPATH]]
  155. #define gtkmm_cflags $[GTKMM_CFLAGS]
  156. #define gtkmm_libs $[GTKMM_LIBS]
  157. #endif
  158. #if $[HAVE_FREETYPE]
  159. #define freetype_ipath $[wildcard $[FREETYPE_IPATH]]
  160. #define freetype_lpath $[wildcard $[FREETYPE_LPATH]]
  161. #define freetype_cflags $[FREETYPE_CFLAGS]
  162. #define freetype_libs $[FREETYPE_LIBS]
  163. #endif
  164. #if $[and $[HAVE_MAYA],$[MAYA_LOCATION]]
  165. #define maya_ipath $[MAYA_LOCATION]/include
  166. #define maya_lpath $[MAYA_LOCATION]/lib
  167. #define maya_ld $[MAYA_LOCATION]/bin/mayald
  168. #endif
  169. #if $[HAVE_IPC]
  170. #define ipc_ipath $[wildcard $[IPC_IPATH]]
  171. #define ipc_lpath $[wildcard $[IPC_LPATH]]
  172. #define ipc_libs $[IPC_LIBS]
  173. #endif
  174. #if $[HAVE_NET]
  175. #define net_ipath $[wildcard $[NET_IPATH]]
  176. #define net_lpath $[wildcard $[NET_LPATH]]
  177. #define net_libs $[NET_LIBS]
  178. #endif
  179. #if $[HAVE_RAD_MSS]
  180. #define rad_mss_ipath $[wildcard $[RAD_MSS_IPATH]]
  181. #define rad_mss_lpath $[wildcard $[RAD_MSS_LPATH]]
  182. #define rad_mss_libs $[RAD_MSS_LIBS]
  183. #endif
  184. // This variable, when evaluated in the scope of a particular directory,
  185. // will indicate true (i.e. nonempty) when the directory is truly built,
  186. // or false (empty) when the directory is not to be built.
  187. #defer build_directory \
  188. $[and \
  189. $[or $[not $[DIRECTORY_IF_PYTHON]],$[HAVE_PYTHON]], \
  190. $[or $[not $[DIRECTORY_IF_NSPR]],$[HAVE_NSPR]], \
  191. $[or $[not $[DIRECTORY_IF_CRYPTO]],$[HAVE_CRYPTO]], \
  192. $[or $[not $[DIRECTORY_IF_ZLIB]],$[HAVE_ZLIB]], \
  193. $[or $[not $[DIRECTORY_IF_SOXST]],$[HAVE_SOXST]], \
  194. $[or $[not $[DIRECTORY_IF_GL]],$[HAVE_GL]], \
  195. $[or $[not $[DIRECTORY_IF_DX]],$[HAVE_DX]], \
  196. $[or $[not $[DIRECTORY_IF_GLX]],$[HAVE_GLX]], \
  197. $[or $[not $[DIRECTORY_IF_GLUT]],$[HAVE_GLUT]], \
  198. $[or $[not $[DIRECTORY_IF_WGL]],$[HAVE_WGL]], \
  199. $[or $[not $[DIRECTORY_IF_RIB]],$[HAVE_RIB]], \
  200. $[or $[not $[DIRECTORY_IF_PS2]],$[HAVE_PS2]], \
  201. $[or $[not $[DIRECTORY_IF_SGIGL]],$[HAVE_SGIGL]], \
  202. $[or $[not $[DIRECTORY_IF_JPEG]],$[HAVE_JPEG]], \
  203. $[or $[not $[DIRECTORY_IF_TIFF]],$[HAVE_TIFF]], \
  204. $[or $[not $[DIRECTORY_IF_FFTW]],$[HAVE_FFTW]], \
  205. $[or $[not $[DIRECTORY_IF_VRPN]],$[HAVE_VRPN]], \
  206. $[or $[not $[DIRECTORY_IF_GTKMM]],$[HAVE_GTKMM]], \
  207. $[or $[not $[DIRECTORY_IF_MAYA]],$[HAVE_MAYA]], \
  208. $[or $[not $[DIRECTORY_IF_IPC]],$[HAVE_IPC]], \
  209. $[or $[not $[DIRECTORY_IF_NET]],$[HAVE_NET]], \
  210. $[or $[not $[DIRECTORY_IF_AUDIO]],$[HAVE_AUDIO]], \
  211. $[or $[not $[DIRECTORY_IF_INTERROGATE]],$[HAVE_INTERROGATE]], \
  212. 1 ]
  213. // This variable, when evaluated in the scope of a particular target,
  214. // will indicated true when the target should be built, or false when
  215. // the target is not to be built.
  216. #defer build_target \
  217. $[and \
  218. $[or $[not $[TARGET_IF_PYTHON]],$[HAVE_PYTHON]], \
  219. $[or $[not $[TARGET_IF_NSPR]],$[HAVE_NSPR]], \
  220. $[or $[not $[TARGET_IF_CRYPTO]],$[HAVE_CRYPTO]], \
  221. $[or $[not $[TARGET_IF_ZLIB]],$[HAVE_ZLIB]], \
  222. $[or $[not $[TARGET_IF_SOXST]],$[HAVE_SOXST]], \
  223. $[or $[not $[TARGET_IF_GL]],$[HAVE_GL]], \
  224. $[or $[not $[TARGET_IF_DX]],$[HAVE_DX]], \
  225. $[or $[not $[TARGET_IF_GLX]],$[HAVE_GLX]], \
  226. $[or $[not $[TARGET_IF_GLUT]],$[HAVE_GLUT]], \
  227. $[or $[not $[TARGET_IF_WGL]],$[HAVE_WGL]], \
  228. $[or $[not $[TARGET_IF_RIB]],$[HAVE_RIB]], \
  229. $[or $[not $[TARGET_IF_PS2]],$[HAVE_PS2]], \
  230. $[or $[not $[TARGET_IF_SGIGL]],$[HAVE_SGIGL]], \
  231. $[or $[not $[TARGET_IF_JPEG]],$[HAVE_JPEG]], \
  232. $[or $[not $[TARGET_IF_TIFF]],$[HAVE_TIFF]], \
  233. $[or $[not $[TARGET_IF_FFTW]],$[HAVE_FFTW]], \
  234. $[or $[not $[TARGET_IF_VRPN]],$[HAVE_VRPN]], \
  235. $[or $[not $[TARGET_IF_GTKMM]],$[HAVE_GTKMM]], \
  236. $[or $[not $[TARGET_IF_MAYA]],$[HAVE_MAYA]], \
  237. $[or $[not $[TARGET_IF_IPC]],$[HAVE_IPC]], \
  238. $[or $[not $[TARGET_IF_NET]],$[HAVE_NET]], \
  239. $[or $[not $[TARGET_IF_AUDIO]],$[HAVE_AUDIO]], \
  240. 1 ]
  241. // This takes advantage of the above two variables to get the actual
  242. // list of local libraries we are to link with, eliminating those that
  243. // won't be built.
  244. #defer active_local_libs \
  245. $[all_libs $[if $[and $[build_directory],$[build_target]],$[TARGET]],$[LOCAL_LIBS]]
  246. #defer active_component_libs \
  247. $[all_libs $[if $[and $[build_directory],$[build_target]],$[TARGET]],$[COMPONENT_LIBS]]
  248. #defer active_libs $[active_local_libs] $[active_component_libs]
  249. // This variable, when evaluated within a target, will either be empty
  250. // string if the target is not to be built, or the target name if it
  251. // is.
  252. #defer active_target $[if $[build_target],$[TARGET]]
  253. #if $[USE_SINGLE_COMPOSITE_SOURCEFILE]
  254. // for non-composite dirs, want to avoid returning the composite default name
  255. #defer get_combined_sources $[if $[ne $[COMBINED_SOURCES],], $[TARGET]_composite.cxx,]
  256. #else
  257. #defer get_combined_sources $[COMBINED_SOURCES]
  258. #endif
  259. // This subroutine will set up the sources variable to reflect the
  260. // complete set of sources for this target, and also set the
  261. // alt_cflags, alt_libs, etc. as appropriate according to how the
  262. // various USE_* flags are set for the current target.
  263. // This variable returns the complete set of sources for the current
  264. // target.
  265. #defer get_sources \
  266. $[SOURCES] \
  267. $[PRECOMPILED_HEADER] \
  268. $[if $[ne $[NO_COMBINED_SOURCES],], $[INCLUDED_SOURCES], $[get_combined_sources]] \
  269. $[if $[HAVE_CRYPTO],$[IF_CRYPTO_SOURCES]] \
  270. $[if $[HAVE_TIFF],$[IF_TIFF_SOURCES]] \
  271. $[if $[HAVE_FFTW],$[IF_FFTW_SOURCES]] \
  272. $[if $[HAVE_NURBSPP],$[IF_NURBSPP_SOURCES]] \
  273. $[if $[HAVE_JPEG], $[IF_JPEG_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_JPEG_INCLUDED_SOURCES], $[IF_JPEG_COMBINED_SOURCES]]] \
  274. $[if $[HAVE_ZLIB], $[IF_ZLIB_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_ZLIB_INCLUDED_SOURCES], $[IF_ZLIB_COMBINED_SOURCES]]] \
  275. $[if $[HAVE_NET], $[IF_NET_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_NET_INCLUDED_SOURCES], $[IF_NET_COMBINED_SOURCES]]] \
  276. $[if $[HAVE_IPC],$[IF_IPC_SOURCES]] \
  277. $[if $[HAVE_PYTHON],$[IF_PYTHON_SOURCES]]
  278. #defer all_sources \
  279. $[SOURCES] \
  280. $[PRECOMPILED_HEADER] \
  281. $[if $[ne $[NO_COMBINED_SOURCES],], $[INCLUDED_SOURCES], $[get_combined_sources]] \
  282. $[IF_CRYPTO_SOURCES] \
  283. $[IF_TIFF_SOURCES] \
  284. $[IF_FFTW_SOURCES] \
  285. $[IF_NURBSPP_SOURCES] \
  286. $[if $[HAVE_JPEG], $[IF_JPEG_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_JPEG_INCLUDED_SOURCES], $[IF_JPEG_COMBINED_SOURCES]]] \
  287. $[if $[HAVE_ZLIB], $[IF_ZLIB_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_ZLIB_INCLUDED_SOURCES], $[IF_ZLIB_COMBINED_SOURCES]]] \
  288. $[if $[HAVE_NET], $[IF_NET_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_NET_INCLUDED_SOURCES], $[IF_NET_COMBINED_SOURCES]]] \
  289. $[IF_IPC_SOURCES] \
  290. $[IF_PYTHON_SOURCES]
  291. #defer included_sources $[INCLUDED_SOURCES] $[if $[HAVE_ZLIB],$[IF_ZLIB_INCLUDED_SOURCES]] $[if $[HAVE_NET],$[IF_NET_INCLUDED_SOURCES]] $[if $[USE_SINGLE_COMPOSITE_SOURCEFILE], $[COMBINED_SOURCES]] $[if $[HAVE_JPEG],$[IF_JPEG_INCLUDED_SOURCES]]
  292. // This variable returns the set of sources that are to be
  293. // interrogated for the current target.
  294. #defer get_igatescan \
  295. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  296. $[if $[eq $[IGATESCAN], all], \
  297. $[filter-out %.I %.T %.lxx %.yxx %.N %_src.cxx,$[get_sources]], \
  298. $[IGATESCAN]]]
  299. // This variable returns the name of the interrogate database file
  300. // that will be generated for a particular target, or empty string if
  301. // the target is not to be interrogated.
  302. #defer get_igatedb \
  303. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  304. lib$[TARGET]$[dllext].in]
  305. // This variable returns the name of the interrogate code file
  306. // that will be generated for a particular target, or empty string if
  307. // the target is not to be interrogated.
  308. #defer get_igateoutput \
  309. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  310. lib$[TARGET]_igate.cxx]
  311. #defer get_precompiled_header $[PRECOMPILED_HEADER]
  312. // This variable returns the name of the fake precompiled header cxx
  313. // that will be used to force linking of the generated pch .obj into libs
  314. #defer get_pch_outputcxx \
  315. $[if $[and $[DO_PCH], $[PRECOMPILED_HEADER]], \
  316. $[patsubst %.h,%.cxx, $[PRECOMPILED_HEADER]]]
  317. // This variable returns the name of the interrogate module, if the
  318. // current metalib target should include one, or empty string if it
  319. // should not.
  320. #defer get_igatemscan \
  321. $[if $[and $[run_interrogate],$[components $[IGATESCAN],$[active_component_libs]]], \
  322. $[TARGET]]
  323. // This function returns the appropriate cflags for the target, based
  324. // on the various external packages this particular target claims to
  325. // require.
  326. #defun get_cflags
  327. #define alt_cflags $[stl_cflags] $[nspr_cflags] $[python_cflags]
  328. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs]],]
  329. #set alt_cflags $[alt_cflags] $[crypto_cflags]
  330. #endif
  331. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs]],]
  332. #set alt_cflags $[alt_cflags] $[zlib_cflags]
  333. #endif
  334. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs]],]
  335. #set alt_cflags $[alt_cflags] $[gl_cflags]
  336. #endif
  337. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs]],]
  338. #set alt_cflags $[alt_cflags] $[glx_cflags]
  339. #endif
  340. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs]],]
  341. #set alt_cflags $[alt_cflags] $[glut_cflags]
  342. #endif
  343. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs]],]
  344. #set alt_cflags $[alt_cflags] $[dx_cflags]
  345. #endif
  346. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs]],]
  347. #set alt_cflags $[alt_cflags] $[soxst_cflags]
  348. #endif
  349. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs]],]
  350. #set alt_cflags $[alt_cflags] $[ipc_cflags]
  351. #endif
  352. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs]],]
  353. #set alt_cflags $[alt_cflags] $[net_cflags]
  354. #endif
  355. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs]],]
  356. #set alt_cflags $[alt_cflags] $[jpeg_cflags]
  357. #endif
  358. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs]],]
  359. #set alt_cflags $[alt_cflags] $[tiff_cflags]
  360. #endif
  361. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs]],]
  362. #set alt_cflags $[alt_cflags] $[fftw_cflags]
  363. #endif
  364. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs]],]
  365. #set alt_cflags $[alt_cflags] $[nurbspp_cflags]
  366. #endif
  367. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs]],]
  368. #set alt_cflags $[alt_cflags] $[vrpn_cflags]
  369. #endif
  370. #if $[ne $[USE_RAD_MSS] $[components $[USE_RAD_MSS],$[active_component_libs]],]
  371. #set alt_cflags $[alt_cflags] $[rad_mss_cflags]
  372. #endif
  373. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs]],]
  374. #set alt_cflags $[alt_cflags] $[mikmod_cflags]
  375. #endif
  376. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs]],]
  377. #set alt_cflags $[alt_cflags] $[gtkmm_cflags]
  378. #endif
  379. #if $[ne $[USE_FREETYPE] $[components $[USE_FREETYPE],$[active_component_libs]],]
  380. #set alt_cflags $[alt_cflags] $[freetype_cflags]
  381. #endif
  382. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs]],]
  383. #set alt_cflags $[alt_cflags] $[maya_cflags]
  384. #endif
  385. $[alt_cflags]
  386. #end get_cflags
  387. // This function returns the appropriate include path for the target,
  388. // based on the various external packages this particular target
  389. // claims to require. This returns a space-separated set of directory
  390. // names only; the -I switch is not included here.
  391. #defun get_ipath
  392. #define alt_ipath $[stl_ipath] $[nspr_ipath] $[python_ipath]
  393. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs]],]
  394. #set alt_ipath $[alt_ipath] $[crypto_ipath]
  395. #endif
  396. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs]],]
  397. #set alt_ipath $[alt_ipath] $[zlib_ipath]
  398. #endif
  399. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs]],]
  400. #set alt_ipath $[alt_ipath] $[gl_ipath]
  401. #endif
  402. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs]],]
  403. #set alt_ipath $[alt_ipath] $[glx_ipath]
  404. #endif
  405. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs]],]
  406. #set alt_ipath $[alt_ipath] $[glut_ipath]
  407. #endif
  408. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs]],]
  409. #set alt_ipath $[alt_ipath] $[dx_ipath]
  410. #endif
  411. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs]],]
  412. #set alt_ipath $[alt_ipath] $[soxst_ipath]
  413. #endif
  414. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs]],]
  415. #set alt_ipath $[alt_ipath] $[ipc_ipath]
  416. #endif
  417. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs]],]
  418. #set alt_ipath $[alt_ipath] $[net_ipath]
  419. #endif
  420. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs]],]
  421. #set alt_ipath $[alt_ipath] $[jpeg_ipath]
  422. #endif
  423. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs]],]
  424. #set alt_ipath $[alt_ipath] $[tiff_ipath]
  425. #endif
  426. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs]],]
  427. #set alt_ipath $[alt_ipath] $[fftw_ipath]
  428. #endif
  429. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs]],]
  430. #set alt_ipath $[alt_ipath] $[nurbspp_ipath]
  431. #endif
  432. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs]],]
  433. #set alt_ipath $[alt_ipath] $[vrpn_ipath]
  434. #endif
  435. #if $[ne $[USE_RAD_MSS] $[components $[USE_RAD_MSS],$[active_component_libs]],]
  436. #set alt_ipath $[alt_ipath] $[rad_mss_ipath]
  437. #endif
  438. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs]],]
  439. #set alt_ipath $[alt_ipath] $[mikmod_ipath]
  440. #endif
  441. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs]],]
  442. #set alt_ipath $[alt_ipath] $[gtkmm_ipath]
  443. #endif
  444. #if $[ne $[USE_FREETYPE] $[components $[USE_FREETYPE],$[active_component_libs]],]
  445. #set alt_ipath $[alt_ipath] $[freetype_ipath]
  446. #endif
  447. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs]],]
  448. #set alt_ipath $[alt_ipath] $[maya_ipath]
  449. #endif
  450. $[alt_ipath]
  451. #end get_ipath
  452. // This function returns the appropriate library search path for the
  453. // target, based on the various external packages this particular
  454. // target claims to require. This returns a space-separated set of
  455. // directory names only; the -L switch is not included here.
  456. #defun get_lpath
  457. #define alt_lpath $[stl_lpath] $[nspr_lpath] $[python_lpath]
  458. #if $[eq $[PLATFORM],Win32]
  459. #set alt_lpath $[WIN32_PLATFORMSDK_LIBPATH] $[alt_lpath]
  460. #endif
  461. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs] $[transitive_link]],]
  462. #set alt_lpath $[alt_lpath] $[crypto_lpath]
  463. #endif
  464. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs] $[transitive_link]],]
  465. #set alt_lpath $[alt_lpath] $[zlib_lpath]
  466. #endif
  467. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs] $[transitive_link]],]
  468. #set alt_lpath $[alt_lpath] $[gl_lpath]
  469. #endif
  470. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs] $[transitive_link]],]
  471. #set alt_lpath $[alt_lpath] $[glx_lpath]
  472. #endif
  473. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs] $[transitive_link]],]
  474. #set alt_lpath $[alt_lpath] $[glut_lpath]
  475. #endif
  476. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs] $[transitive_link]],]
  477. #set alt_lpath $[alt_lpath] $[dx_lpath]
  478. #endif
  479. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs] $[transitive_link]],]
  480. #set alt_lpath $[alt_lpath] $[soxst_lpath]
  481. #endif
  482. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs] $[transitive_link]],]
  483. #set alt_lpath $[alt_lpath] $[ipc_lpath]
  484. #endif
  485. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs] $[transitive_link]],]
  486. #set alt_lpath $[alt_lpath] $[net_lpath]
  487. #endif
  488. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs] $[transitive_link]],]
  489. #set alt_lpath $[alt_lpath] $[jpeg_lpath]
  490. #endif
  491. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs] $[transitive_link]],]
  492. #set alt_lpath $[alt_lpath] $[tiff_lpath]
  493. #endif
  494. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs] $[transitive_link]],]
  495. #set alt_lpath $[alt_lpath] $[fftw_lpath]
  496. #endif
  497. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs] $[transitive_link]],]
  498. #set alt_lpath $[alt_lpath] $[nurbspp_lpath]
  499. #endif
  500. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs] $[transitive_link]],]
  501. #set alt_lpath $[alt_lpath] $[vrpn_lpath]
  502. #endif
  503. #if $[ne $[USE_RAD_MSS] $[components $[USE_RAD_MSS],$[active_component_libs] $[transitive_link]],]
  504. #set alt_lpath $[alt_lpath] $[rad_mss_lpath]
  505. #endif
  506. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs] $[transitive_link]],]
  507. #set alt_lpath $[alt_lpath] $[mikmod_lpath]
  508. #endif
  509. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs] $[transitive_link]],]
  510. #set alt_lpath $[alt_lpath] $[gtkmm_lpath]
  511. #endif
  512. #if $[ne $[USE_FREETYPE] $[components $[USE_FREETYPE],$[active_component_libs] $[transitive_link]],]
  513. #set alt_lpath $[alt_lpath] $[freetype_lpath]
  514. #endif
  515. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs] $[transitive_link]],]
  516. #set alt_lpath $[alt_lpath] $[maya_lpath]
  517. #endif
  518. $[alt_lpath]
  519. #end get_lpath
  520. // This function returns the appropriate set of library names to link
  521. // with for the target, based on the various external packages this
  522. // particular target claims to require. This returns a
  523. // space-separated set of library names only; the -l switch is not
  524. // included here.
  525. #defun get_libs
  526. #define alt_libs $[stl_libs] $[nspr_libs] $[python_libs] $[TARGET_LIBS]
  527. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs] $[transitive_link]],]
  528. #set alt_libs $[alt_libs] $[crypto_libs]
  529. #endif
  530. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs] $[transitive_link]],]
  531. #set alt_libs $[alt_libs] $[zlib_libs]
  532. #endif
  533. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs] $[transitive_link]],]
  534. #set alt_libs $[alt_libs] $[gl_libs]
  535. #endif
  536. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs] $[transitive_link]],]
  537. #set alt_libs $[alt_libs] $[glx_libs]
  538. #endif
  539. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs] $[transitive_link]],]
  540. #set alt_libs $[alt_libs] $[glut_libs]
  541. #endif
  542. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs] $[transitive_link]],]
  543. #set alt_libs $[alt_libs] $[dx_libs]
  544. #endif
  545. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs] $[transitive_link]],]
  546. #set alt_libs $[alt_libs] $[soxst_libs]
  547. #endif
  548. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs] $[transitive_link]],]
  549. #set alt_libs $[alt_libs] $[ipc_libs]
  550. #endif
  551. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs] $[transitive_link]],]
  552. #set alt_libs $[alt_libs] $[net_libs]
  553. #endif
  554. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs] $[transitive_link]],]
  555. #set alt_libs $[alt_libs] $[jpeg_libs]
  556. #endif
  557. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs] $[transitive_link]],]
  558. #set alt_libs $[alt_libs] $[tiff_libs]
  559. #endif
  560. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs] $[transitive_link]],]
  561. #set alt_libs $[alt_libs] $[fftw_libs]
  562. #endif
  563. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs] $[transitive_link]],]
  564. #set alt_libs $[alt_libs] $[nurbspp_libs]
  565. #endif
  566. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs] $[transitive_link]],]
  567. #set alt_libs $[alt_libs] $[vrpn_libs]
  568. #endif
  569. #if $[ne $[USE_RAD_MSS] $[components $[USE_RAD_MSS],$[active_component_libs] $[transitive_link]],]
  570. #set alt_libs $[alt_libs] $[rad_mss_libs]
  571. #endif
  572. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs] $[transitive_link]],]
  573. #set alt_libs $[alt_libs] $[mikmod_libs]
  574. #endif
  575. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs] $[transitive_link]],]
  576. #set alt_libs $[alt_libs] $[gtkmm_libs]
  577. #endif
  578. #if $[ne $[USE_FREETYPE] $[components $[USE_FREETYPE],$[active_component_libs] $[transitive_link]],]
  579. #set alt_libs $[alt_libs] $[freetype_libs]
  580. #endif
  581. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs] $[transitive_link]],]
  582. #set alt_libs $[alt_libs] $[maya_libs]
  583. #endif
  584. #if $[UNIX_PLATFORM]
  585. #set alt_libs $[alt_libs] $[UNIX_SYS_LIBS] $[components $[UNIX_SYS_LIBS],$[active_component_libs] $[transitive_link]]
  586. #endif
  587. #if $[WINDOWS_PLATFORM]
  588. #set alt_libs $[alt_libs] $[WIN_SYS_LIBS] $[components $[WIN_SYS_LIBS],$[active_component_libs] $[transitive_link]]
  589. #endif
  590. $[alt_libs]
  591. #end get_libs
  592. // This function returns the appropriate value for ld for the target.
  593. #defun get_ld
  594. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LD]],]
  595. $[maya_ld]
  596. #endif
  597. #end get_ld
  598. // This function determines the set of libraries our various targets
  599. // depend on. This is a complicated definition. It is the union of
  600. // all of our targets' dependencies, except:
  601. // If a target is part of a metalib, it depends (a) directly on all of
  602. // its normal library dependencies that are part of the same metalib,
  603. // and (b) indirectly on all of the metalibs that every other library
  604. // dependency is part of. If a target is not part of a metalib, it is
  605. // the same as case (b) above.
  606. #defun get_depend_libs
  607. #define depend_libs
  608. #forscopes lib_target noinst_lib_target
  609. #define metalib $[module $[TARGET],$[TARGET]]
  610. #if $[ne $[metalib],]
  611. // This library is included on a metalib.
  612. #foreach depend $[LOCAL_LIBS]
  613. #define depend_metalib $[module $[TARGET],$[depend]]
  614. #if $[eq $[depend_metalib],$[metalib]]
  615. // Here's a dependent library in the *same* metalib.
  616. #set depend_libs $[depend_libs] $[depend]
  617. #elif $[ne $[depend_metalib],]
  618. // This dependent library is in a *different* metalib.
  619. #set depend_libs $[depend_libs] $[depend_metalib]
  620. #else
  621. // This dependent library is not in any metalib.
  622. #set depend_libs $[depend_libs] $[depend]
  623. #endif
  624. #end depend
  625. #else
  626. // This library is *not* included on a metalib.
  627. #foreach depend $[LOCAL_LIBS]
  628. #define depend_metalib $[module $[TARGET],$[depend]]
  629. #if $[ne $[depend_metalib],]
  630. // This dependent library is on a metalib.
  631. #set depend_libs $[depend_libs] $[depend_metalib]
  632. #else
  633. // This dependent library is not in any metalib.
  634. #set depend_libs $[depend_libs] $[depend]
  635. #endif
  636. #end depend
  637. #endif
  638. #end lib_target noinst_lib_target
  639. // These will never be part of a metalib.
  640. #forscopes static_lib_target ss_lib_target bin_target noinst_bin_target metalib_target
  641. #foreach depend $[LOCAL_LIBS]
  642. #define depend_metalib $[module $[TARGET],$[depend]]
  643. #if $[ne $[depend_metalib],]
  644. // This dependent library is on a metalib.
  645. #set depend_libs $[depend_libs] $[depend_metalib]
  646. #else
  647. // This dependent library is not in any metalib.
  648. #set depend_libs $[depend_libs] $[depend]
  649. #endif
  650. #end depend
  651. #end static_lib_target ss_lib_target bin_target noinst_bin_target metalib_target
  652. // In case we're defining any metalibs, these depend directly on
  653. // their components as well.
  654. #set depend_libs $[depend_libs] $[COMPONENT_LIBS(metalib_target)]
  655. $[depend_libs]
  656. #end get_depend_libs
  657. // Define a few directories that will be useful.
  658. #define so_dir $[ODIR_SHARED]
  659. #define st_dir $[ODIR_STATIC]
  660. #define install_dir $[$[upcase $[PACKAGE]]_INSTALL]
  661. #if $[eq $[install_dir],]
  662. #error Variable $[upcase $[PACKAGE]]_INSTALL is not set! Cannot install!
  663. #endif
  664. #define other_trees
  665. #foreach tree $[NEEDS_TREES]
  666. #define tree_install $[$[upcase $[tree]]_INSTALL]
  667. #if $[eq $[tree_install],]
  668. Warning: Variable $[upcase $[tree]]_INSTALL is not set!
  669. #else
  670. #set other_trees $[other_trees] $[tree_install]
  671. #endif
  672. #end tree
  673. #define install_lib_dir $[install_dir]/lib
  674. #define install_bin_dir $[install_dir]/bin
  675. #define install_headers_dir $[install_dir]/include
  676. #define install_data_dir $[install_dir]/shared
  677. #define install_igatedb_dir $[install_dir]/etc
  678. #define install_config_dir $[install_dir]/etc
  679. #if $[ne $[DTOOL_INSTALL],]
  680. #define install_parser_inc_dir $[DTOOL_INSTALL]/include/parser-inc
  681. #else
  682. #define install_parser_inc_dir $[install_headers_dir]/parser-inc
  683. #endif
  684. // Set up the correct interrogate options.
  685. // $[dllext] is redefined in the Windows Global.platform.pp files to
  686. // the string _d if we are building a debug tree. This is inserted
  687. // into the .dll and .in filenames before the extension to make a
  688. // runtime distinction between debug and non-debug builds. For now,
  689. // we make a global definition to empty string, since non-Windows
  690. // platforms will leave this empty.
  691. #define dllext
  692. // Caution! interrogate_ipath might be redefined in the
  693. // Global.platform.pp file.
  694. #defer interrogate_ipath $[target_ipath:%=-I%]
  695. #defer interrogate_spath $[install_parser_inc_dir:%=-S%]
  696. #defer interrogate_options \
  697. -DCPPPARSER -D__cplusplus $[SYSTEM_IGATE_FLAGS] \
  698. $[interrogate_spath] $[interrogate_ipath] \
  699. $[CDEFINES_OPT$[OPTIMIZE]:%=-D%] \
  700. $[filter -D%,$[C++FLAGS]] \
  701. $[INTERROGATE_OPTIONS] \
  702. $[if $[INTERROGATE_PYTHON_INTERFACE],-python] \
  703. $[if $[INTERROGATE_C_INTERFACE],-c] \
  704. $[if $[TRACK_IN_INTERPRETER],-track-interpreter] \
  705. $[if $[<= $[OPTIMIZE], 1],-spam]
  706. #defer interrogate_module_options \
  707. $[if $[INTERROGATE_PYTHON_INTERFACE],-python] \
  708. $[if $[INTERROGATE_C_INTERFACE],-c] \
  709. $[if $[TRACK_IN_INTERPRETER],-track-interpreter]
  710. // Include the global definitions for this particular build_type, if
  711. // the file is there.
  712. #sinclude $[GLOBAL_TYPE_FILE]