Global.pp 26 KB

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