Global.pp 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  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 $[and $[HAVE_MAYA],$[MAYA_LOCATION]]
  159. #define maya_ipath $[MAYA_LOCATION]/include
  160. #define maya_lpath $[MAYA_LOCATION]/lib
  161. #define maya_ld $[MAYA_LOCATION]/bin/mayald
  162. #endif
  163. #if $[HAVE_IPC]
  164. #define ipc_ipath $[wildcard $[IPC_IPATH]]
  165. #define ipc_lpath $[wildcard $[IPC_LPATH]]
  166. #define ipc_libs $[IPC_LIBS]
  167. #endif
  168. #if $[HAVE_NET]
  169. #define net_ipath $[wildcard $[NET_IPATH]]
  170. #define net_lpath $[wildcard $[NET_LPATH]]
  171. #define net_libs $[NET_LIBS]
  172. #endif
  173. #if $[and $[eq $[PLATFORM],Win32], $[ne $[USE_RAD_MSS],]]
  174. // Info for the RAD game tools, Miles Sound System
  175. #define AUDIO_IPATH $[RAD_MSS_IPATH]
  176. #define AUDIO_LPATH $[RAD_MSS_LPATH]
  177. #define AUDIO_LIBS $[RAD_MSS_LIBS]
  178. // Miles will play mp3, so we dont need the mpg123 lib
  179. #define USE_MPG123
  180. #endif
  181. #if $[HAVE_AUDIO]
  182. #define audio_ipath $[wildcard $[AUDIO_IPATH]]
  183. #define audio_lpath $[wildcard $[AUDIO_LPATH]]
  184. #define audio_libs $[AUDIO_LIBS]
  185. #endif
  186. // This variable, when evaluated in the scope of a particular directory,
  187. // will indicate true (i.e. nonempty) when the directory is truly built,
  188. // or false (empty) when the directory is not to be built.
  189. #defer build_directory \
  190. $[and \
  191. $[or $[not $[DIRECTORY_IF_PYTHON]],$[HAVE_PYTHON]], \
  192. $[or $[not $[DIRECTORY_IF_NSPR]],$[HAVE_NSPR]], \
  193. $[or $[not $[DIRECTORY_IF_CRYPTO]],$[HAVE_CRYPTO]], \
  194. $[or $[not $[DIRECTORY_IF_ZLIB]],$[HAVE_ZLIB]], \
  195. $[or $[not $[DIRECTORY_IF_SOXST]],$[HAVE_SOXST]], \
  196. $[or $[not $[DIRECTORY_IF_GL]],$[HAVE_GL]], \
  197. $[or $[not $[DIRECTORY_IF_DX]],$[HAVE_DX]], \
  198. $[or $[not $[DIRECTORY_IF_GLX]],$[HAVE_GLX]], \
  199. $[or $[not $[DIRECTORY_IF_GLUT]],$[HAVE_GLUT]], \
  200. $[or $[not $[DIRECTORY_IF_WGL]],$[HAVE_WGL]], \
  201. $[or $[not $[DIRECTORY_IF_RIB]],$[HAVE_RIB]], \
  202. $[or $[not $[DIRECTORY_IF_PS2]],$[HAVE_PS2]], \
  203. $[or $[not $[DIRECTORY_IF_SGIGL]],$[HAVE_SGIGL]], \
  204. $[or $[not $[DIRECTORY_IF_JPEG]],$[HAVE_JPEG]], \
  205. $[or $[not $[DIRECTORY_IF_TIFF]],$[HAVE_TIFF]], \
  206. $[or $[not $[DIRECTORY_IF_FFTW]],$[HAVE_FFTW]], \
  207. $[or $[not $[DIRECTORY_IF_VRPN]],$[HAVE_VRPN]], \
  208. $[or $[not $[DIRECTORY_IF_GTKMM]],$[HAVE_GTKMM]], \
  209. $[or $[not $[DIRECTORY_IF_MAYA]],$[HAVE_MAYA]], \
  210. $[or $[not $[DIRECTORY_IF_IPC]],$[HAVE_IPC]], \
  211. $[or $[not $[DIRECTORY_IF_NET]],$[HAVE_NET]], \
  212. $[or $[not $[DIRECTORY_IF_AUDIO]],$[HAVE_AUDIO]], \
  213. $[or $[not $[DIRECTORY_IF_MPG123]],$[USE_MPG123]], \
  214. $[or $[not $[DIRECTORY_IF_INTERROGATE]],$[HAVE_INTERROGATE]], \
  215. 1 ]
  216. // This variable, when evaluated in the scope of a particular target,
  217. // will indicated true when the target should be built, or false when
  218. // the target is not to be built.
  219. #defer build_target \
  220. $[and \
  221. $[or $[not $[TARGET_IF_PYTHON]],$[HAVE_PYTHON]], \
  222. $[or $[not $[TARGET_IF_NSPR]],$[HAVE_NSPR]], \
  223. $[or $[not $[TARGET_IF_CRYPTO]],$[HAVE_CRYPTO]], \
  224. $[or $[not $[TARGET_IF_ZLIB]],$[HAVE_ZLIB]], \
  225. $[or $[not $[TARGET_IF_SOXST]],$[HAVE_SOXST]], \
  226. $[or $[not $[TARGET_IF_GL]],$[HAVE_GL]], \
  227. $[or $[not $[TARGET_IF_DX]],$[HAVE_DX]], \
  228. $[or $[not $[TARGET_IF_GLX]],$[HAVE_GLX]], \
  229. $[or $[not $[TARGET_IF_GLUT]],$[HAVE_GLUT]], \
  230. $[or $[not $[TARGET_IF_WGL]],$[HAVE_WGL]], \
  231. $[or $[not $[TARGET_IF_RIB]],$[HAVE_RIB]], \
  232. $[or $[not $[TARGET_IF_PS2]],$[HAVE_PS2]], \
  233. $[or $[not $[TARGET_IF_SGIGL]],$[HAVE_SGIGL]], \
  234. $[or $[not $[TARGET_IF_JPEG]],$[HAVE_JPEG]], \
  235. $[or $[not $[TARGET_IF_TIFF]],$[HAVE_TIFF]], \
  236. $[or $[not $[TARGET_IF_FFTW]],$[HAVE_FFTW]], \
  237. $[or $[not $[TARGET_IF_VRPN]],$[HAVE_VRPN]], \
  238. $[or $[not $[TARGET_IF_GTKMM]],$[HAVE_GTKMM]], \
  239. $[or $[not $[TARGET_IF_MAYA]],$[HAVE_MAYA]], \
  240. $[or $[not $[TARGET_IF_IPC]],$[HAVE_IPC]], \
  241. $[or $[not $[TARGET_IF_NET]],$[HAVE_NET]], \
  242. $[or $[not $[TARGET_IF_AUDIO]],$[HAVE_AUDIO]], \
  243. $[or $[not $[TARGET_IF_MPG123]],$[USE_MPG123]], \
  244. 1 ]
  245. // This takes advantage of the above two variables to get the actual
  246. // list of local libraries we are to link with, eliminating those that
  247. // won't be built.
  248. #defer active_local_libs \
  249. $[all_libs $[if $[and $[build_directory],$[build_target]],$[TARGET]],$[LOCAL_LIBS]]
  250. #defer active_component_libs \
  251. $[all_libs $[if $[and $[build_directory],$[build_target]],$[TARGET]],$[COMPONENT_LIBS]]
  252. #defer active_libs $[active_local_libs] $[active_component_libs]
  253. // This variable, when evaluated within a target, will either be empty
  254. // string if the target is not to be built, or the target name if it
  255. // is.
  256. #defer active_target $[if $[build_target],$[TARGET]]
  257. // This subroutine will set up the sources variable to reflect the
  258. // complete set of sources for this target, and also set the
  259. // alt_cflags, alt_libs, etc. as appropriate according to how the
  260. // various USE_* flags are set for the current target.
  261. // This variable returns the complete set of sources for the current
  262. // target.
  263. #defer get_sources \
  264. $[SOURCES] \
  265. $[PRECOMPILED_HEADER] \
  266. $[if $[ne $[NO_COMBINED_SOURCES],], $[INCLUDED_SOURCES], $[COMBINED_SOURCES]] \
  267. $[if $[HAVE_CRYPTO],$[IF_CRYPTO_SOURCES]] \
  268. $[if $[HAVE_JPEG],$[IF_JPEG_SOURCES]] \
  269. $[if $[HAVE_TIFF],$[IF_TIFF_SOURCES]] \
  270. $[if $[HAVE_FFTW],$[IF_FFTW_SOURCES]] \
  271. $[if $[HAVE_NURBSPP],$[IF_NURBSPP_SOURCES]] \
  272. $[if $[HAVE_ZLIB], $[IF_ZLIB_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_ZLIB_INCLUDED_SOURCES], $[IF_ZLIB_COMBINED_SOURCES]]] \
  273. $[if $[HAVE_NET], $[IF_NET_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_NET_INCLUDED_SOURCES], $[IF_NET_COMBINED_SOURCES]]] \
  274. $[if $[HAVE_IPC],$[IF_IPC_SOURCES]] \
  275. $[if $[HAVE_PYTHON],$[IF_PYTHON_SOURCES]]
  276. #defer all_sources \
  277. $[SOURCES] \
  278. $[PRECOMPILED_HEADER] \
  279. $[if $[ne $[NO_COMBINED_SOURCES],], $[INCLUDED_SOURCES], $[COMBINED_SOURCES]] \
  280. $[IF_CRYPTO_SOURCES] \
  281. $[IF_JPEG_SOURCES] \
  282. $[IF_TIFF_SOURCES] \
  283. $[IF_FFTW_SOURCES] \
  284. $[IF_NURBSPP_SOURCES] \
  285. $[if $[HAVE_ZLIB], $[IF_ZLIB_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_ZLIB_INCLUDED_SOURCES], $[IF_ZLIB_COMBINED_SOURCES]]] \
  286. $[if $[HAVE_NET], $[IF_NET_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_NET_INCLUDED_SOURCES], $[IF_NET_COMBINED_SOURCES]]] \
  287. $[IF_IPC_SOURCES] \
  288. $[IF_PYTHON_SOURCES]
  289. #defer included_sources $[INCLUDED_SOURCES] $[if $[HAVE_ZLIB],$[IF_ZLIB_INCLUDED_SOURCES]] $[if $[HAVE_NET],$[IF_NET_INCLUDED_SOURCES]]
  290. // This variable returns the set of sources that are to be
  291. // interrogated for the current target.
  292. #defer get_igatescan \
  293. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  294. $[if $[eq $[IGATESCAN], all], \
  295. $[filter-out %.I %.T %.lxx %.yxx %.N %_src.cxx,$[get_sources]], \
  296. $[IGATESCAN]]]
  297. // This variable returns the name of the interrogate database file
  298. // that will be generated for a particular target, or empty string if
  299. // the target is not to be interrogated.
  300. #defer get_igatedb \
  301. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  302. lib$[TARGET].in]
  303. // This variable returns the name of the interrogate code file
  304. // that will be generated for a particular target, or empty string if
  305. // the target is not to be interrogated.
  306. #defer get_igateoutput \
  307. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  308. lib$[TARGET]_igate.cxx]
  309. #defer get_precompiled_header $[PRECOMPILED_HEADER]
  310. // This variable returns the name of the fake precompiled header cxx
  311. // that will be used to force linking of the generated pch .obj into libs
  312. #defer get_pch_outputcxx \
  313. $[if $[and $[DO_PCH], $[PRECOMPILED_HEADER]], \
  314. $[patsubst %.h,%.cxx, $[PRECOMPILED_HEADER]]]
  315. // This variable returns the name of the interrogate module, if the
  316. // current metalib target should include one, or empty string if it
  317. // should not.
  318. #defer get_igatemscan \
  319. $[if $[and $[run_interrogate],$[components $[IGATESCAN],$[active_component_libs]]], \
  320. $[TARGET]]
  321. // This function returns the appropriate cflags for the target, based
  322. // on the various external packages this particular target claims to
  323. // require.
  324. #defun get_cflags
  325. #define alt_cflags $[stl_cflags] $[nspr_cflags] $[python_cflags]
  326. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs]],]
  327. #set alt_cflags $[alt_cflags] $[crypto_cflags]
  328. #endif
  329. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs]],]
  330. #set alt_cflags $[alt_cflags] $[zlib_cflags]
  331. #endif
  332. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs]],]
  333. #set alt_cflags $[alt_cflags] $[gl_cflags]
  334. #endif
  335. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs]],]
  336. #set alt_cflags $[alt_cflags] $[glx_cflags]
  337. #endif
  338. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs]],]
  339. #set alt_cflags $[alt_cflags] $[glut_cflags]
  340. #endif
  341. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs]],]
  342. #set alt_cflags $[alt_cflags] $[dx_cflags]
  343. #endif
  344. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs]],]
  345. #set alt_cflags $[alt_cflags] $[soxst_cflags]
  346. #endif
  347. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs]],]
  348. #set alt_cflags $[alt_cflags] $[ipc_cflags]
  349. #endif
  350. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs]],]
  351. #set alt_cflags $[alt_cflags] $[net_cflags]
  352. #endif
  353. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs]],]
  354. #set alt_cflags $[alt_cflags] $[jpeg_cflags]
  355. #endif
  356. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs]],]
  357. #set alt_cflags $[alt_cflags] $[tiff_cflags]
  358. #endif
  359. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs]],]
  360. #set alt_cflags $[alt_cflags] $[fftw_cflags]
  361. #endif
  362. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs]],]
  363. #set alt_cflags $[alt_cflags] $[nurbspp_cflags]
  364. #endif
  365. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs]],]
  366. #set alt_cflags $[alt_cflags] $[vrpn_cflags]
  367. #endif
  368. #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs]],]
  369. #set alt_cflags $[alt_cflags] $[audio_cflags]
  370. #endif
  371. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs]],]
  372. #set alt_cflags $[alt_cflags] $[mikmod_cflags]
  373. #endif
  374. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs]],]
  375. #set alt_cflags $[alt_cflags] $[gtkmm_cflags]
  376. #endif
  377. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs]],]
  378. #set alt_cflags $[alt_cflags] $[maya_cflags]
  379. #endif
  380. $[alt_cflags]
  381. #end get_cflags
  382. // This function returns the appropriate include path for the target,
  383. // based on the various external packages this particular target
  384. // claims to require. This returns a space-separated set of directory
  385. // names only; the -I switch is not included here.
  386. #defun get_ipath
  387. #define alt_ipath $[stl_ipath] $[nspr_ipath] $[python_ipath]
  388. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs]],]
  389. #set alt_ipath $[alt_ipath] $[crypto_ipath]
  390. #endif
  391. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs]],]
  392. #set alt_ipath $[alt_ipath] $[zlib_ipath]
  393. #endif
  394. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs]],]
  395. #set alt_ipath $[alt_ipath] $[gl_ipath]
  396. #endif
  397. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs]],]
  398. #set alt_ipath $[alt_ipath] $[glx_ipath]
  399. #endif
  400. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs]],]
  401. #set alt_ipath $[alt_ipath] $[glut_ipath]
  402. #endif
  403. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs]],]
  404. #set alt_ipath $[alt_ipath] $[dx_ipath]
  405. #endif
  406. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs]],]
  407. #set alt_ipath $[alt_ipath] $[soxst_ipath]
  408. #endif
  409. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs]],]
  410. #set alt_ipath $[alt_ipath] $[ipc_ipath]
  411. #endif
  412. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs]],]
  413. #set alt_ipath $[alt_ipath] $[net_ipath]
  414. #endif
  415. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs]],]
  416. #set alt_ipath $[alt_ipath] $[jpeg_ipath]
  417. #endif
  418. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs]],]
  419. #set alt_ipath $[alt_ipath] $[tiff_ipath]
  420. #endif
  421. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs]],]
  422. #set alt_ipath $[alt_ipath] $[fftw_ipath]
  423. #endif
  424. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs]],]
  425. #set alt_ipath $[alt_ipath] $[nurbspp_ipath]
  426. #endif
  427. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs]],]
  428. #set alt_ipath $[alt_ipath] $[vrpn_ipath]
  429. #endif
  430. #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs]],]
  431. #set alt_ipath $[alt_ipath] $[audio_ipath]
  432. #endif
  433. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs]],]
  434. #set alt_ipath $[alt_ipath] $[mikmod_ipath]
  435. #endif
  436. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs]],]
  437. #set alt_ipath $[alt_ipath] $[gtkmm_ipath]
  438. #endif
  439. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs]],]
  440. #set alt_ipath $[alt_ipath] $[maya_ipath]
  441. #endif
  442. $[alt_ipath]
  443. #end get_ipath
  444. // This function returns the appropriate library search path for the
  445. // target, based on the various external packages this particular
  446. // target claims to require. This returns a space-separated set of
  447. // directory names only; the -L switch is not included here.
  448. #defun get_lpath
  449. #define alt_lpath $[stl_lpath] $[nspr_lpath] $[python_lpath]
  450. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs] $[transitive_link]],]
  451. #set alt_lpath $[alt_lpath] $[crypto_lpath]
  452. #endif
  453. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs] $[transitive_link]],]
  454. #set alt_lpath $[alt_lpath] $[zlib_lpath]
  455. #endif
  456. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs] $[transitive_link]],]
  457. #set alt_lpath $[alt_lpath] $[gl_lpath]
  458. #endif
  459. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs] $[transitive_link]],]
  460. #set alt_lpath $[alt_lpath] $[glx_lpath]
  461. #endif
  462. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs] $[transitive_link]],]
  463. #set alt_lpath $[alt_lpath] $[glut_lpath]
  464. #endif
  465. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs] $[transitive_link]],]
  466. #set alt_lpath $[alt_lpath] $[dx_lpath]
  467. #endif
  468. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs] $[transitive_link]],]
  469. #set alt_lpath $[alt_lpath] $[soxst_lpath]
  470. #endif
  471. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs] $[transitive_link]],]
  472. #set alt_lpath $[alt_lpath] $[ipc_lpath]
  473. #endif
  474. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs] $[transitive_link]],]
  475. #set alt_lpath $[alt_lpath] $[net_lpath]
  476. #endif
  477. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs] $[transitive_link]],]
  478. #set alt_lpath $[alt_lpath] $[jpeg_lpath]
  479. #endif
  480. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs] $[transitive_link]],]
  481. #set alt_lpath $[alt_lpath] $[tiff_lpath]
  482. #endif
  483. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs] $[transitive_link]],]
  484. #set alt_lpath $[alt_lpath] $[fftw_lpath]
  485. #endif
  486. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs] $[transitive_link]],]
  487. #set alt_lpath $[alt_lpath] $[nurbspp_lpath]
  488. #endif
  489. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs] $[transitive_link]],]
  490. #set alt_lpath $[alt_lpath] $[vrpn_lpath]
  491. #endif
  492. #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs] $[transitive_link]],]
  493. #set alt_lpath $[alt_lpath] $[audio_lpath]
  494. #endif
  495. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs] $[transitive_link]],]
  496. #set alt_lpath $[alt_lpath] $[mikmod_lpath]
  497. #endif
  498. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs] $[transitive_link]],]
  499. #set alt_lpath $[alt_lpath] $[gtkmm_lpath]
  500. #endif
  501. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs] $[transitive_link]],]
  502. #set alt_lpath $[alt_lpath] $[maya_lpath]
  503. #endif
  504. $[alt_lpath]
  505. #end get_lpath
  506. // This function returns the appropriate set of library names to link
  507. // with for the target, based on the various external packages this
  508. // particular target claims to require. This returns a
  509. // space-separated set of library names only; the -l switch is not
  510. // included here.
  511. #defun get_libs
  512. #define alt_libs $[stl_libs] $[nspr_libs] $[python_libs]
  513. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs] $[transitive_link]],]
  514. #set alt_libs $[alt_libs] $[crypto_libs]
  515. #endif
  516. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs] $[transitive_link]],]
  517. #set alt_libs $[alt_libs] $[zlib_libs]
  518. #endif
  519. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs] $[transitive_link]],]
  520. #set alt_libs $[alt_libs] $[gl_libs]
  521. #endif
  522. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs] $[transitive_link]],]
  523. #set alt_libs $[alt_libs] $[glx_libs]
  524. #endif
  525. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs] $[transitive_link]],]
  526. #set alt_libs $[alt_libs] $[glut_libs]
  527. #endif
  528. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs] $[transitive_link]],]
  529. #set alt_libs $[alt_libs] $[dx_libs]
  530. #endif
  531. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs] $[transitive_link]],]
  532. #set alt_libs $[alt_libs] $[soxst_libs]
  533. #endif
  534. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs] $[transitive_link]],]
  535. #set alt_libs $[alt_libs] $[ipc_libs]
  536. #endif
  537. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs] $[transitive_link]],]
  538. #set alt_libs $[alt_libs] $[net_libs]
  539. #endif
  540. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs] $[transitive_link]],]
  541. #set alt_libs $[alt_libs] $[jpeg_libs]
  542. #endif
  543. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs] $[transitive_link]],]
  544. #set alt_libs $[alt_libs] $[tiff_libs]
  545. #endif
  546. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs] $[transitive_link]],]
  547. #set alt_libs $[alt_libs] $[fftw_libs]
  548. #endif
  549. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs] $[transitive_link]],]
  550. #set alt_libs $[alt_libs] $[nurbspp_libs]
  551. #endif
  552. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs] $[transitive_link]],]
  553. #set alt_libs $[alt_libs] $[vrpn_libs]
  554. #endif
  555. #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs] $[transitive_link]],]
  556. #set alt_libs $[alt_libs] $[audio_libs]
  557. #endif
  558. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs] $[transitive_link]],]
  559. #set alt_libs $[alt_libs] $[mikmod_libs]
  560. #endif
  561. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs] $[transitive_link]],]
  562. #set alt_libs $[alt_libs] $[gtkmm_libs]
  563. #endif
  564. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs] $[transitive_link]],]
  565. #set alt_libs $[alt_libs] $[maya_libs]
  566. #endif
  567. #if $[UNIX_PLATFORM]
  568. #set alt_libs $[alt_libs] $[UNIX_SYS_LIBS] $[components $[UNIX_SYS_LIBS],$[active_component_libs] $[transitive_link]]
  569. #endif
  570. #if $[WINDOWS_PLATFORM]
  571. #set alt_libs $[alt_libs] $[WIN_SYS_LIBS] $[components $[WIN_SYS_LIBS],$[active_component_libs] $[transitive_link]]
  572. #endif
  573. $[alt_libs]
  574. #end get_libs
  575. // This function returns the appropriate value for ld for the target.
  576. #defun get_ld
  577. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LD]],]
  578. $[maya_ld]
  579. #endif
  580. #end get_ld
  581. // This function determines the set of libraries our various targets
  582. // depend on. This is a complicated definition. It is the union of
  583. // all of our targets' dependencies, except:
  584. // If a target is part of a metalib, it depends (a) directly on all of
  585. // its normal library dependencies that are part of the same metalib,
  586. // and (b) indirectly on all of the metalibs that every other library
  587. // dependency is part of. If a target is not part of a metalib, it is
  588. // the same as case (b) above.
  589. #defun get_depend_libs
  590. #define depend_libs
  591. #forscopes lib_target noinst_lib_target
  592. #define metalib $[module $[TARGET],$[TARGET]]
  593. #if $[ne $[metalib],]
  594. // This library is included on a metalib.
  595. #foreach depend $[LOCAL_LIBS]
  596. #define depend_metalib $[module $[TARGET],$[depend]]
  597. #if $[eq $[depend_metalib],$[metalib]]
  598. // Here's a dependent library in the *same* metalib.
  599. #set depend_libs $[depend_libs] $[depend]
  600. #elif $[ne $[depend_metalib],]
  601. // This dependent library is in a *different* metalib.
  602. #set depend_libs $[depend_libs] $[depend_metalib]
  603. #else
  604. // This dependent library is not in any metalib.
  605. #set depend_libs $[depend_libs] $[depend]
  606. #endif
  607. #end depend
  608. #else
  609. // This library is *not* included on a metalib.
  610. #foreach depend $[LOCAL_LIBS]
  611. #define depend_metalib $[module $[TARGET],$[depend]]
  612. #if $[ne $[depend_metalib],]
  613. // This dependent library is on a metalib.
  614. #set depend_libs $[depend_libs] $[depend_metalib]
  615. #else
  616. // This dependent library is not in any metalib.
  617. #set depend_libs $[depend_libs] $[depend]
  618. #endif
  619. #end depend
  620. #endif
  621. #end lib_target noinst_lib_target
  622. // These will never be part of a metalib.
  623. #forscopes static_lib_target ss_lib_target bin_target noinst_bin_target metalib_target
  624. #foreach depend $[LOCAL_LIBS]
  625. #define depend_metalib $[module $[TARGET],$[depend]]
  626. #if $[ne $[depend_metalib],]
  627. // This dependent library is on a metalib.
  628. #set depend_libs $[depend_libs] $[depend_metalib]
  629. #else
  630. // This dependent library is not in any metalib.
  631. #set depend_libs $[depend_libs] $[depend]
  632. #endif
  633. #end depend
  634. #end static_lib_target ss_lib_target bin_target noinst_bin_target metalib_target
  635. // In case we're defining any metalibs, these depend directly on
  636. // their components as well.
  637. #set depend_libs $[depend_libs] $[COMPONENT_LIBS(metalib_target)]
  638. $[depend_libs]
  639. #end get_depend_libs
  640. // Define a few directories that will be useful.
  641. #define so_dir $[ODIR_SHARED]
  642. #define st_dir $[ODIR_STATIC]
  643. #define install_dir $[$[upcase $[PACKAGE]]_INSTALL]
  644. #if $[eq $[install_dir],]
  645. #error Variable $[upcase $[PACKAGE]]_INSTALL is not set! Cannot install!
  646. #endif
  647. #define other_trees
  648. #foreach tree $[NEEDS_TREES]
  649. #define tree_install $[$[upcase $[tree]]_INSTALL]
  650. #if $[eq $[tree_install],]
  651. Warning: Variable $[upcase $[tree]]_INSTALL is not set!
  652. #else
  653. #set other_trees $[other_trees] $[tree_install]
  654. #endif
  655. #end tree
  656. #define install_lib_dir $[install_dir]/lib
  657. #define install_bin_dir $[install_dir]/bin
  658. #define install_headers_dir $[install_dir]/include
  659. #define install_data_dir $[install_dir]/shared
  660. #define install_igatedb_dir $[install_dir]/etc
  661. #define install_config_dir $[install_dir]/etc
  662. #if $[ne $[DTOOL_INSTALL],]
  663. #define install_parser_inc_dir $[DTOOL_INSTALL]/include/parser-inc
  664. #else
  665. #define install_parser_inc_dir $[install_headers_dir]/parser-inc
  666. #endif
  667. // Set up the correct interrogate options.
  668. #defer interrogate_ipath $[target_ipath:%=-I%]
  669. #defer interrogate_spath $[install_parser_inc_dir:%=-S%]
  670. #defer interrogate_options \
  671. -DCPPPARSER -D__cplusplus $[SYSTEM_IGATE_FLAGS] \
  672. $[interrogate_spath] $[interrogate_ipath] \
  673. $[CDEFINES_OPT$[OPTIMIZE]:%=-D%] \
  674. $[filter -D%,$[C++FLAGS]] \
  675. $[INTERROGATE_OPTIONS] \
  676. $[if $[INTERROGATE_PYTHON_INTERFACE],-python] \
  677. $[if $[INTERROGATE_C_INTERFACE],-c] \
  678. $[if $[TRACK_IN_INTERPRETER],-track-interpreter] \
  679. $[if $[<= $[OPTIMIZE], 1],-spam]
  680. #defer interrogate_module_options \
  681. $[if $[INTERROGATE_PYTHON_INTERFACE],-python] \
  682. $[if $[INTERROGATE_C_INTERFACE],-c] \
  683. $[if $[TRACK_IN_INTERPRETER],-track-interpreter]
  684. // Include the global definitions for this particular build_type, if
  685. // the file is there.
  686. #sinclude $[GLOBAL_TYPE_FILE]