Global.pp 27 KB

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