Global.pp 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  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. #if $[HAVE_PYTHON]
  61. #define python_ipath $[wildcard $[PYTHON_IPATH]]
  62. #define python_lpath $[wildcard $[PYTHON_LPATH]]
  63. #endif
  64. #if $[HAVE_NSPR]
  65. #define nspr_ipath $[wildcard $[NSPR_IPATH]]
  66. #define nspr_lpath $[wildcard $[NSPR_LPATH]]
  67. #define nspr_cflags $[NSPR_CFLAGS]
  68. #define nspr_libs $[NSPR_LIBS]
  69. #endif
  70. #if $[HAVE_CRYPTO]
  71. #define crypto_ipath $[wildcard $[CRYPTO_IPATH]]
  72. #define crypto_lpath $[wildcard $[CRYPTO_LPATH]]
  73. #define crypto_cflags $[CRYPTO_CFLAGS]
  74. #define crypto_libs $[CRYPTO_LIBS]
  75. #endif
  76. #if $[HAVE_ZLIB]
  77. #define zlib_ipath $[wildcard $[ZLIB_IPATH]]
  78. #define zlib_lpath $[wildcard $[ZLIB_LPATH]]
  79. #define zlib_cflags $[ZLIB_CFLAGS]
  80. #define zlib_libs $[ZLIB_LIBS]
  81. #endif
  82. #if $[HAVE_SOXST]
  83. #define soxst_ipath $[wildcard $[SOXST_IPATH]]
  84. #define soxst_lpath $[wildcard $[SOXST_LPATH]]
  85. #define soxst_cflags $[SOXST_CFLAGS]
  86. #define soxst_libs $[SOXST_LIBS]
  87. #endif
  88. #if $[HAVE_GL]
  89. #define gl_ipath $[wildcard $[GL_IPATH]]
  90. #define gl_lpath $[wildcard $[GL_LPATH]]
  91. #define gl_cflags $[GL_CFLAGS]
  92. #define gl_libs $[GL_LIBS]
  93. #endif
  94. #if $[HAVE_GLX]
  95. #define glx_ipath $[wildcard $[GLX_IPATH]]
  96. #define glx_lpath $[wildcard $[GLX_LPATH]]
  97. #define glx_cflags $[GLX_CFLAGS]
  98. #define glx_libs $[GLX_LIBS]
  99. #endif
  100. #if $[HAVE_GLUT]
  101. #define glut_ipath $[wildcard $[GLUT_IPATH]]
  102. #define glut_lpath $[wildcard $[GLUT_LPATH]]
  103. #define glut_cflags $[GLUT_CFLAGS]
  104. #define glut_libs $[GLUT_LIBS]
  105. #endif
  106. #if $[HAVE_DX]
  107. #define dx_ipath $[wildcard $[DX_IPATH]]
  108. #define dx_lpath $[wildcard $[DX_LPATH]]
  109. #define dx_cflags $[DX_CFLAGS]
  110. #define dx_libs $[DX_LIBS]
  111. #endif
  112. #if $[HAVE_JPEG]
  113. #define jpeg_ipath $[wildcard $[JPEG_IPATH]]
  114. #define jpeg_lpath $[wildcard $[JPEG_LPATH]]
  115. #define jpeg_cflags $[JPEG_CFLAGS]
  116. #define jpeg_libs $[JPEG_LIBS]
  117. #endif
  118. #if $[HAVE_TIFF]
  119. #define tiff_ipath $[wildcard $[TIFF_IPATH]]
  120. #define tiff_lpath $[wildcard $[TIFF_LPATH]]
  121. #define tiff_cflags $[TIFF_CFLAGS]
  122. #define tiff_libs $[TIFF_LIBS]
  123. #endif
  124. #if $[HAVE_FFTW]
  125. #define fftw_ipath $[wildcard $[FFTW_IPATH]]
  126. #define fftw_lpath $[wildcard $[FFTW_LPATH]]
  127. #define fftw_cflags $[FFTW_CFLAGS]
  128. #define fftw_libs $[FFTW_LIBS]
  129. #endif
  130. #if $[HAVE_NURBSPP]
  131. #define nurbspp_ipath $[wildcard $[NURBSPP_IPATH]]
  132. #define nurbspp_lpath $[wildcard $[NURBSPP_LPATH]]
  133. #define nurbspp_cflags $[NURBSPP_CFLAGS]
  134. #define nurbspp_libs $[NURBSPP_LIBS]
  135. #endif
  136. #if $[HAVE_VRPN]
  137. #define vrpn_ipath $[wildcard $[VRPN_IPATH]]
  138. #define vrpn_lpath $[wildcard $[VRPN_LPATH]]
  139. #define vrpn_cflags $[VRPN_CFLAGS]
  140. #define vrpn_libs $[VRPN_LIBS]
  141. #endif
  142. #if $[HAVE_MIKMOD]
  143. #define mikmod_ipath $[wildcard $[MIKMOD_IPATH]]
  144. #define mikmod_lpath $[wildcard $[MIKMOD_LPATH]]
  145. #define mikmod_cflags $[MIKMOD_CFLAGS]
  146. #define mikmod_libs $[MIKMOD_LIBS]
  147. #endif
  148. #if $[HAVE_GTKMM]
  149. #define gtkmm_ipath $[wildcard $[GTKMM_IPATH]]
  150. #define gtkmm_lpath $[wildcard $[GTKMM_LPATH]]
  151. #define gtkmm_cflags $[GTKMM_CFLAGS]
  152. #define gtkmm_libs $[GTKMM_LIBS]
  153. #endif
  154. #if $[and $[HAVE_MAYA],$[MAYA_LOCATION]]
  155. #define maya_ipath $[MAYA_LOCATION]/include
  156. #define maya_lpath $[MAYA_LOCATION]/lib
  157. #define maya_ld $[MAYA_LOCATION]/bin/mayald
  158. #endif
  159. #if $[HAVE_IPC]
  160. #define ipc_ipath $[wildcard $[IPC_IPATH]]
  161. #define ipc_lpath $[wildcard $[IPC_LPATH]]
  162. #define ipc_libs $[IPC_LIBS]
  163. #endif
  164. #if $[HAVE_NET]
  165. #define net_ipath $[wildcard $[NET_IPATH]]
  166. #define net_lpath $[wildcard $[NET_LPATH]]
  167. #define net_libs $[NET_LIBS]
  168. #endif
  169. #if $[HAVE_AUDIO]
  170. #define audio_ipath $[wildcard $[AUDIO_IPATH]]
  171. #define audio_lpath $[wildcard $[AUDIO_LPATH]]
  172. #define audio_libs $[AUDIO_LIBS]
  173. #endif
  174. // This variable, when evaluated in the scope of a particular directory,
  175. // will indicate true (i.e. nonempty) when the directory is truly built,
  176. // or false (empty) when the directory is not to be built.
  177. #defer build_directory \
  178. $[and \
  179. $[or $[not $[DIRECTORY_IF_PYTHON]],$[HAVE_PYTHON]], \
  180. $[or $[not $[DIRECTORY_IF_NSPR]],$[HAVE_NSPR]], \
  181. $[or $[not $[DIRECTORY_IF_CRYPTO]],$[HAVE_CRYPTO]], \
  182. $[or $[not $[DIRECTORY_IF_ZLIB]],$[HAVE_ZLIB]], \
  183. $[or $[not $[DIRECTORY_IF_SOXST]],$[HAVE_SOXST]], \
  184. $[or $[not $[DIRECTORY_IF_GL]],$[HAVE_GL]], \
  185. $[or $[not $[DIRECTORY_IF_DX]],$[HAVE_DX]], \
  186. $[or $[not $[DIRECTORY_IF_GLX]],$[HAVE_GLX]], \
  187. $[or $[not $[DIRECTORY_IF_GLUT]],$[HAVE_GLUT]], \
  188. $[or $[not $[DIRECTORY_IF_WGL]],$[HAVE_WGL]], \
  189. $[or $[not $[DIRECTORY_IF_RIB]],$[HAVE_RIB]], \
  190. $[or $[not $[DIRECTORY_IF_PS2]],$[HAVE_PS2]], \
  191. $[or $[not $[DIRECTORY_IF_SGIGL]],$[HAVE_SGIGL]], \
  192. $[or $[not $[DIRECTORY_IF_JPEG]],$[HAVE_JPEG]], \
  193. $[or $[not $[DIRECTORY_IF_TIFF]],$[HAVE_TIFF]], \
  194. $[or $[not $[DIRECTORY_IF_FFTW]],$[HAVE_FFTW]], \
  195. $[or $[not $[DIRECTORY_IF_VRPN]],$[HAVE_VRPN]], \
  196. $[or $[not $[DIRECTORY_IF_GTKMM]],$[HAVE_GTKMM]], \
  197. $[or $[not $[DIRECTORY_IF_MAYA]],$[HAVE_MAYA]], \
  198. $[or $[not $[DIRECTORY_IF_IPC]],$[HAVE_IPC]], \
  199. $[or $[not $[DIRECTORY_IF_NET]],$[HAVE_NET]], \
  200. $[or $[not $[DIRECTORY_IF_AUDIO]],$[HAVE_AUDIO]], \
  201. 1 ]
  202. // This variable, when evaluated in the scope of a particular target,
  203. // will indicated true when the target should be built, or false when
  204. // the target is not to be built.
  205. #defer build_target \
  206. $[and \
  207. $[or $[not $[TARGET_IF_PYTHON]],$[HAVE_PYTHON]], \
  208. $[or $[not $[TARGET_IF_NSPR]],$[HAVE_NSPR]], \
  209. $[or $[not $[TARGET_IF_CRYPTO]],$[HAVE_CRYPTO]], \
  210. $[or $[not $[TARGET_IF_ZLIB]],$[HAVE_ZLIB]], \
  211. $[or $[not $[TARGET_IF_SOXST]],$[HAVE_SOXST]], \
  212. $[or $[not $[TARGET_IF_GL]],$[HAVE_GL]], \
  213. $[or $[not $[TARGET_IF_DX]],$[HAVE_DX]], \
  214. $[or $[not $[TARGET_IF_GLX]],$[HAVE_GLX]], \
  215. $[or $[not $[TARGET_IF_GLUT]],$[HAVE_GLUT]], \
  216. $[or $[not $[TARGET_IF_WGL]],$[HAVE_WGL]], \
  217. $[or $[not $[TARGET_IF_RIB]],$[HAVE_RIB]], \
  218. $[or $[not $[TARGET_IF_PS2]],$[HAVE_PS2]], \
  219. $[or $[not $[TARGET_IF_SGIGL]],$[HAVE_SGIGL]], \
  220. $[or $[not $[TARGET_IF_JPEG]],$[HAVE_JPEG]], \
  221. $[or $[not $[TARGET_IF_TIFF]],$[HAVE_TIFF]], \
  222. $[or $[not $[TARGET_IF_FFTW]],$[HAVE_FFTW]], \
  223. $[or $[not $[TARGET_IF_VRPN]],$[HAVE_VRPN]], \
  224. $[or $[not $[TARGET_IF_GTKMM]],$[HAVE_GTKMM]], \
  225. $[or $[not $[TARGET_IF_MAYA]],$[HAVE_MAYA]], \
  226. $[or $[not $[TARGET_IF_IPC]],$[HAVE_IPC]], \
  227. $[or $[not $[TARGET_IF_NET]],$[HAVE_NET]], \
  228. $[or $[not $[TARGET_IF_AUDIO]],$[HAVE_AUDIO]], \
  229. 1 ]
  230. // This takes advantage of the above two variables to get the actual
  231. // list of local libraries we are to link with, eliminating those that
  232. // won't be built.
  233. #defer active_local_libs \
  234. $[all_libs $[if $[and $[build_directory],$[build_target]],$[TARGET]],$[LOCAL_LIBS]]
  235. #defer active_component_libs \
  236. $[all_libs $[if $[and $[build_directory],$[build_target]],$[TARGET]],$[COMPONENT_LIBS]]
  237. #defer active_libs $[active_local_libs] $[active_component_libs]
  238. // This variable, when evaluated within a target, will either be empty
  239. // string if the target is not to be built, or the target name if it
  240. // is.
  241. #defer active_target $[if $[build_target],$[TARGET]]
  242. // This subroutine will set up the sources variable to reflect the
  243. // complete set of sources for this target, and also set the
  244. // alt_cflags, alt_libs, etc. as appropriate according to how the
  245. // various USE_* flags are set for the current target.
  246. // This variable returns the complete set of sources for the current
  247. // target.
  248. #defer get_sources \
  249. $[SOURCES] \
  250. $[if $[HAVE_CRYPTO],$[IF_CRYPTO_SOURCES]] \
  251. $[if $[HAVE_JPEG],$[IF_JPEG_SOURCES]] \
  252. $[if $[HAVE_TIFF],$[IF_TIFF_SOURCES]] \
  253. $[if $[HAVE_FFTW],$[IF_FFTW_SOURCES]] \
  254. $[if $[HAVE_NURBSPP],$[IF_NURBSPP_SOURCES]] \
  255. $[if $[HAVE_ZLIB],$[IF_ZLIB_SOURCES]] \
  256. $[if $[HAVE_IPC],$[IF_IPC_SOURCES]] \
  257. $[if $[HAVE_NET],$[IF_NET_SOURCES]] \
  258. $[if $[HAVE_PYTHON],$[IF_PYTHON_SOURCES]]
  259. #defer all_sources \
  260. $[SOURCES] \
  261. $[IF_CRYPTO_SOURCES] \
  262. $[IF_JPEG_SOURCES] \
  263. $[IF_TIFF_SOURCES] \
  264. $[IF_FFTW_SOURCES] \
  265. $[IF_NURBSPP_SOURCES] \
  266. $[IF_ZLIB_SOURCES] \
  267. $[IF_IPC_SOURCES] \
  268. $[IF_NET_SOURCES] \
  269. $[IF_PYTHON_SOURCES]
  270. // This variable returns the set of sources that are to be
  271. // interrogated for the current target.
  272. #defer get_igatescan \
  273. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  274. $[if $[eq $[IGATESCAN], all], \
  275. $[filter-out %.I %.T %.lxx %.yxx %.N,$[get_sources]], \
  276. $[IGATESCAN]]]
  277. // This variable returns the name of the interrogate database file
  278. // that will be generated for a particular target, or empty string if
  279. // the target is not to be interrogated.
  280. #defer get_igatedb \
  281. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  282. lib$[TARGET].in]
  283. // This variable returns the name of the interrogate code file
  284. // that will be generated for a particular target, or empty string if
  285. // the target is not to be interrogated.
  286. #defer get_igateoutput \
  287. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  288. lib$[TARGET]_igate.cxx]
  289. // This variable returns the name of the interrogate module, if the
  290. // current metalib target should include one, or empty string if it
  291. // should not.
  292. #defer get_igatemscan \
  293. $[if $[and $[run_interrogate],$[components $[IGATESCAN],$[active_component_libs]]], \
  294. $[TARGET]]
  295. // This function returns the appropriate cflags for the target, based
  296. // on the various external packages this particular target claims to
  297. // require.
  298. #defun get_cflags
  299. #define alt_cflags $[nspr_cflags] $[python_cflags]
  300. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs]],]
  301. #set alt_cflags $[alt_cflags] $[crypto_cflags]
  302. #endif
  303. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs]],]
  304. #set alt_cflags $[alt_cflags] $[zlib_cflags]
  305. #endif
  306. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs]],]
  307. #set alt_cflags $[alt_cflags] $[gl_cflags]
  308. #endif
  309. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs]],]
  310. #set alt_cflags $[alt_cflags] $[glx_cflags]
  311. #endif
  312. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs]],]
  313. #set alt_cflags $[alt_cflags] $[glut_cflags]
  314. #endif
  315. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs]],]
  316. #set alt_cflags $[alt_cflags] $[dx_cflags]
  317. #endif
  318. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs]],]
  319. #set alt_cflags $[alt_cflags] $[soxst_cflags]
  320. #endif
  321. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs]],]
  322. #set alt_cflags $[alt_cflags] $[ipc_cflags]
  323. #endif
  324. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs]],]
  325. #set alt_cflags $[alt_cflags] $[net_cflags]
  326. #endif
  327. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs]],]
  328. #set alt_cflags $[alt_cflags] $[jpeg_cflags]
  329. #endif
  330. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs]],]
  331. #set alt_cflags $[alt_cflags] $[tiff_cflags]
  332. #endif
  333. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs]],]
  334. #set alt_cflags $[alt_cflags] $[fftw_cflags]
  335. #endif
  336. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs]],]
  337. #set alt_cflags $[alt_cflags] $[nurbspp_cflags]
  338. #endif
  339. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs]],]
  340. #set alt_cflags $[alt_cflags] $[vrpn_cflags]
  341. #endif
  342. #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs]],]
  343. #set alt_cflags $[alt_cflags] $[audio_cflags]
  344. #endif
  345. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs]],]
  346. #set alt_cflags $[alt_cflags] $[mikmod_cflags]
  347. #endif
  348. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs]],]
  349. #set alt_cflags $[alt_cflags] $[gtkmm_cflags]
  350. #endif
  351. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs]],]
  352. #set alt_cflags $[alt_cflags] $[maya_cflags]
  353. #endif
  354. $[alt_cflags]
  355. #end get_cflags
  356. // This function returns the appropriate include path for the target,
  357. // based on the various external packages this particular target
  358. // claims to require. This returns a space-separated set of directory
  359. // names only; the -I switch is not included here.
  360. #defun get_ipath
  361. #define alt_ipath $[nspr_ipath] $[python_ipath]
  362. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs]],]
  363. #set alt_ipath $[alt_ipath] $[crypto_ipath]
  364. #endif
  365. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs]],]
  366. #set alt_ipath $[alt_ipath] $[zlib_ipath]
  367. #endif
  368. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs]],]
  369. #set alt_ipath $[alt_ipath] $[gl_ipath]
  370. #endif
  371. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs]],]
  372. #set alt_ipath $[alt_ipath] $[glx_ipath]
  373. #endif
  374. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs]],]
  375. #set alt_ipath $[alt_ipath] $[glut_ipath]
  376. #endif
  377. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs]],]
  378. #set alt_ipath $[alt_ipath] $[dx_ipath]
  379. #endif
  380. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs]],]
  381. #set alt_ipath $[alt_ipath] $[soxst_ipath]
  382. #endif
  383. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs]],]
  384. #set alt_ipath $[alt_ipath] $[ipc_ipath]
  385. #endif
  386. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs]],]
  387. #set alt_ipath $[alt_ipath] $[net_ipath]
  388. #endif
  389. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs]],]
  390. #set alt_ipath $[alt_ipath] $[jpeg_ipath]
  391. #endif
  392. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs]],]
  393. #set alt_ipath $[alt_ipath] $[tiff_ipath]
  394. #endif
  395. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs]],]
  396. #set alt_ipath $[alt_ipath] $[fftw_ipath]
  397. #endif
  398. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs]],]
  399. #set alt_ipath $[alt_ipath] $[nurbspp_ipath]
  400. #endif
  401. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs]],]
  402. #set alt_ipath $[alt_ipath] $[vrpn_ipath]
  403. #endif
  404. #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs]],]
  405. #set alt_ipath $[alt_ipath] $[audio_ipath]
  406. #endif
  407. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs]],]
  408. #set alt_ipath $[alt_ipath] $[mikmod_ipath]
  409. #endif
  410. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs]],]
  411. #set alt_ipath $[alt_ipath] $[gtkmm_ipath]
  412. #endif
  413. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs]],]
  414. #set alt_ipath $[alt_ipath] $[maya_ipath]
  415. #endif
  416. $[alt_ipath]
  417. #end get_ipath
  418. // This function returns the appropriate library search path for the
  419. // target, based on the various external packages this particular
  420. // target claims to require. This returns a space-separated set of
  421. // directory names only; the -L switch is not included here.
  422. #defun get_lpath
  423. #define alt_lpath $[nspr_lpath] $[python_lpath]
  424. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs] $[transitive_link]],]
  425. #set alt_lpath $[alt_lpath] $[crypto_lpath]
  426. #endif
  427. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs] $[transitive_link]],]
  428. #set alt_lpath $[alt_lpath] $[zlib_lpath]
  429. #endif
  430. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs] $[transitive_link]],]
  431. #set alt_lpath $[alt_lpath] $[gl_lpath]
  432. #endif
  433. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs] $[transitive_link]],]
  434. #set alt_lpath $[alt_lpath] $[glx_lpath]
  435. #endif
  436. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs] $[transitive_link]],]
  437. #set alt_lpath $[alt_lpath] $[glut_lpath]
  438. #endif
  439. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs] $[transitive_link]],]
  440. #set alt_lpath $[alt_lpath] $[dx_lpath]
  441. #endif
  442. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs] $[transitive_link]],]
  443. #set alt_lpath $[alt_lpath] $[soxst_lpath]
  444. #endif
  445. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs] $[transitive_link]],]
  446. #set alt_lpath $[alt_lpath] $[ipc_lpath]
  447. #endif
  448. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs] $[transitive_link]],]
  449. #set alt_lpath $[alt_lpath] $[net_lpath]
  450. #endif
  451. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs] $[transitive_link]],]
  452. #set alt_lpath $[alt_lpath] $[jpeg_lpath]
  453. #endif
  454. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs] $[transitive_link]],]
  455. #set alt_lpath $[alt_lpath] $[tiff_lpath]
  456. #endif
  457. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs] $[transitive_link]],]
  458. #set alt_lpath $[alt_lpath] $[fftw_lpath]
  459. #endif
  460. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs] $[transitive_link]],]
  461. #set alt_lpath $[alt_lpath] $[nurbspp_lpath]
  462. #endif
  463. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs] $[transitive_link]],]
  464. #set alt_lpath $[alt_lpath] $[vrpn_lpath]
  465. #endif
  466. #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs] $[transitive_link]],]
  467. #set alt_lpath $[alt_lpath] $[audio_lpath]
  468. #endif
  469. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs] $[transitive_link]],]
  470. #set alt_lpath $[alt_lpath] $[mikmod_lpath]
  471. #endif
  472. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs] $[transitive_link]],]
  473. #set alt_lpath $[alt_lpath] $[gtkmm_lpath]
  474. #endif
  475. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs] $[transitive_link]],]
  476. #set alt_lpath $[alt_lpath] $[maya_lpath]
  477. #endif
  478. $[alt_lpath]
  479. #end get_lpath
  480. // This function returns the appropriate set of library names to link
  481. // with for the target, based on the various external packages this
  482. // particular target claims to require. This returns a
  483. // space-separated set of library names only; the -l switch is not
  484. // included here.
  485. #defun get_libs
  486. #define alt_libs $[nspr_libs] $[python_libs]
  487. #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs] $[transitive_link]],]
  488. #set alt_libs $[alt_libs] $[crypto_libs]
  489. #endif
  490. #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs] $[transitive_link]],]
  491. #set alt_libs $[alt_libs] $[zlib_libs]
  492. #endif
  493. #if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs] $[transitive_link]],]
  494. #set alt_libs $[alt_libs] $[gl_libs]
  495. #endif
  496. #if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs] $[transitive_link]],]
  497. #set alt_libs $[alt_libs] $[glx_libs]
  498. #endif
  499. #if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs] $[transitive_link]],]
  500. #set alt_libs $[alt_libs] $[glut_libs]
  501. #endif
  502. #if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs] $[transitive_link]],]
  503. #set alt_libs $[alt_libs] $[dx_libs]
  504. #endif
  505. #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs] $[transitive_link]],]
  506. #set alt_libs $[alt_libs] $[soxst_libs]
  507. #endif
  508. #if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs] $[transitive_link]],]
  509. #set alt_libs $[alt_libs] $[ipc_libs]
  510. #endif
  511. #if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs] $[transitive_link]],]
  512. #set alt_libs $[alt_libs] $[net_libs]
  513. #endif
  514. #if $[ne $[USE_JPEG] $[components $[USE_JPEG],$[active_component_libs] $[transitive_link]],]
  515. #set alt_libs $[alt_libs] $[jpeg_libs]
  516. #endif
  517. #if $[ne $[USE_TIFF] $[components $[USE_TIFF],$[active_component_libs] $[transitive_link]],]
  518. #set alt_libs $[alt_libs] $[tiff_libs]
  519. #endif
  520. #if $[ne $[USE_FFTW] $[components $[USE_FFTW],$[active_component_libs] $[transitive_link]],]
  521. #set alt_libs $[alt_libs] $[fftw_libs]
  522. #endif
  523. #if $[ne $[USE_NURBSPP] $[components $[USE_NURBSPP],$[active_component_libs] $[transitive_link]],]
  524. #set alt_libs $[alt_libs] $[nurbspp_libs]
  525. #endif
  526. #if $[ne $[USE_VRPN] $[components $[USE_VRPN],$[active_component_libs] $[transitive_link]],]
  527. #set alt_libs $[alt_libs] $[vrpn_libs]
  528. #endif
  529. #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs] $[transitive_link]],]
  530. #set alt_libs $[alt_libs] $[audio_libs]
  531. #endif
  532. #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs] $[transitive_link]],]
  533. #set alt_libs $[alt_libs] $[mikmod_libs]
  534. #endif
  535. #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs] $[transitive_link]],]
  536. #set alt_libs $[alt_libs] $[gtkmm_libs]
  537. #endif
  538. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs] $[transitive_link]],]
  539. #set alt_libs $[alt_libs] $[maya_libs]
  540. #endif
  541. #if $[UNIX_PLATFORM]
  542. #set alt_libs $[alt_libs] $[UNIX_SYS_LIBS] $[components $[UNIX_SYS_LIBS],$[active_component_libs] $[transitive_link]]
  543. #endif
  544. $[alt_libs]
  545. #end get_libs
  546. // This function returns the appropriate value for ld for the target.
  547. #defun get_ld
  548. #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LD]],]
  549. $[maya_ld]
  550. #endif
  551. #end get_ld
  552. // This function determines the set of libraries our various targets
  553. // depend on. This is a complicated definition. It is the union of
  554. // all of our targets' dependencies, except:
  555. // If a target is part of a metalib, it depends (a) directly on all of
  556. // its normal library dependencies that are part of the same metalib,
  557. // and (b) indirectly on all of the metalibs that every other library
  558. // dependency is part of. If a target is not part of a metalib, it is
  559. // the same as case (b) above.
  560. #defun get_depend_libs
  561. #define depend_libs
  562. #forscopes lib_target noinst_lib_target
  563. #define metalib $[module $[TARGET],$[TARGET]]
  564. #if $[ne $[metalib],]
  565. // This library is included on a metalib.
  566. #foreach depend $[LOCAL_LIBS]
  567. #define depend_metalib $[module $[TARGET],$[depend]]
  568. #if $[eq $[depend_metalib],$[metalib]]
  569. // Here's a dependent library in the *same* metalib.
  570. #set depend_libs $[depend_libs] $[depend]
  571. #elif $[ne $[depend_metalib],]
  572. // This dependent library is in a *different* metalib.
  573. #set depend_libs $[depend_libs] $[depend_metalib]
  574. #else
  575. // This dependent library is not in any metalib.
  576. #set depend_libs $[depend_libs] $[depend]
  577. #endif
  578. #end depend
  579. #else
  580. // This library is *not* included on a metalib.
  581. #foreach depend $[LOCAL_LIBS]
  582. #define depend_metalib $[module $[TARGET],$[depend]]
  583. #if $[ne $[depend_metalib],]
  584. // This dependent library is on a metalib.
  585. #set depend_libs $[depend_libs] $[depend_metalib]
  586. #else
  587. // This dependent library is not in any metalib.
  588. #set depend_libs $[depend_libs] $[depend]
  589. #endif
  590. #end depend
  591. #endif
  592. #end lib_target noinst_lib_target
  593. // These will never be part of a metalib.
  594. #forscopes static_lib_target ss_lib_target bin_target noinst_bin_target metalib_target
  595. #foreach depend $[LOCAL_LIBS]
  596. #define depend_metalib $[module $[TARGET],$[depend]]
  597. #if $[ne $[depend_metalib],]
  598. // This dependent library is on a metalib.
  599. #set depend_libs $[depend_libs] $[depend_metalib]
  600. #else
  601. // This dependent library is not in any metalib.
  602. #set depend_libs $[depend_libs] $[depend]
  603. #endif
  604. #end depend
  605. #end static_lib_target ss_lib_target bin_target noinst_bin_target metalib_target
  606. // In case we're defining any metalibs, these depend directly on
  607. // their components as well.
  608. #set depend_libs $[depend_libs] $[COMPONENT_LIBS(metalib_target)]
  609. $[depend_libs]
  610. #end get_depend_libs
  611. // Define a few directories that will be useful.
  612. #define so_dir $[ODIR_SHARED]
  613. #define st_dir $[ODIR_STATIC]
  614. #define install_dir $[$[upcase $[PACKAGE]]_INSTALL]
  615. #if $[eq $[install_dir],]
  616. #error Variable $[upcase $[PACKAGE]]_INSTALL is not set! Cannot install!
  617. #endif
  618. #define other_trees
  619. #foreach tree $[NEEDS_TREES]
  620. #define tree_install $[$[upcase $[tree]]_INSTALL]
  621. #if $[eq $[tree_install],]
  622. Warning: Variable $[upcase $[tree]]_INSTALL is not set!
  623. #else
  624. #set other_trees $[other_trees] $[tree_install]
  625. #endif
  626. #end tree
  627. #define install_lib_dir $[install_dir]/lib
  628. #define install_bin_dir $[install_dir]/bin
  629. #define install_headers_dir $[install_dir]/include
  630. #define install_data_dir $[install_dir]/shared
  631. #define install_igatedb_dir $[install_dir]/etc
  632. #define install_config_dir $[install_dir]/etc
  633. #if $[ne $[DTOOL_INSTALL],]
  634. #define install_parser_inc_dir $[DTOOL_INSTALL]/include/parser-inc
  635. #else
  636. #define install_parser_inc_dir $[install_headers_dir]/parser-inc
  637. #endif
  638. // Set up the correct interrogate options.
  639. #defer interrogate_ipath $[target_ipath:%=-I%]
  640. #defer interrogate_spath $[install_parser_inc_dir:%=-S%]
  641. #defer interrogate_options \
  642. -DCPPPARSER -D__cplusplus $[SYSTEM_IGATE_FLAGS] \
  643. $[interrogate_spath] $[interrogate_ipath] \
  644. $[CDEFINES_OPT$[OPTIMIZE]:%=-D%] \
  645. $[filter -D%,$[C++FLAGS]] \
  646. $[INTERROGATE_OPTIONS] \
  647. $[if $[INTERROGATE_PYTHON_INTERFACE],-python] \
  648. $[if $[<= $[OPTIMIZE], 1],-spam] \
  649. $[if $[INTERROGATE_C_INTERFACE],-c]
  650. // Include the global definitions for this particular build_type, if
  651. // the file is there.
  652. #sinclude $[GLOBAL_TYPE_FILE]