Global.pp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  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 */test_lib_target */metalib_target)
  33. // This map variable allows us to look up global variables that might
  34. // be defined in a particular Sources.pp, e.g. in the "toplevel" file.
  35. #map dir_type DIR_TYPE(*/)
  36. // These allow us to determine whether a particular local library is a
  37. // static or a dynamic library. If the library name appears in the
  38. // static_libs map, it is a static library (i.e. libname.a);
  39. // otherwise, it is a dynamic library (libname.so). The target
  40. // ss_lib_target is a special case: these libraries are dynamic where
  41. // it's easy to make them so (e.g. on Unix platforms), and static on
  42. // platforms where dynamic libraries aren't quite so robust (e.g. on
  43. // Windows).
  44. #if $[WINDOWS_PLATFORM]
  45. #map static_libs TARGET(*/static_lib_target */ss_lib_target)
  46. #map dynamic_libs TARGET(*/lib_target */noinst_lib_target */test_lib_target */metalib_target)
  47. #else
  48. #map static_libs TARGET(*/static_lib_target)
  49. #map dynamic_libs TARGET(*/lib_target */ss_lib_target */noinst_lib_target */test_lib_target */metalib_target)
  50. #endif
  51. // This lets us identify which metalib, if any, is including each
  52. // named library. That is, $[module $[TARGET],name] will return
  53. // the name of the metalib that includes library name.
  54. #map module COMPONENT_LIBS(*/metalib_target)
  55. // This lets up look up components of a particular metalib.
  56. #map components TARGET(*/lib_target */noinst_lib_target */test_lib_target)
  57. // And this lets us look up source directories by dirname.
  58. #map dirnames DIRNAME(*/)
  59. // This is used by Template.models.pp.
  60. #if $[HAVE_SOFTIMAGE]
  61. #define SOFT2EGG soft -D libsoftegg soft2egg
  62. #else
  63. // Temporary: use the old converter from pre-Panda days.
  64. #define SOFT2EGG soft2egg
  65. #endif
  66. // Define some various compile flags, derived from the variables set
  67. // in Config.pp.
  68. #set INTERROGATE_PYTHON_INTERFACE $[and $[HAVE_PYTHON],$[INTERROGATE_PYTHON_INTERFACE]]
  69. #define run_interrogate $[HAVE_INTERROGATE]
  70. #define stl_ipath $[wildcard $[STL_IPATH]]
  71. #define stl_lpath $[wildcard $[STL_LPATH]]
  72. #define stl_cflags $[STL_CFLAGS]
  73. #define stl_libs $[STL_LIBS]
  74. #if $[HAVE_PYTHON]
  75. #define python_ipath $[wildcard $[PYTHON_IPATH]]
  76. #define python_lpath $[wildcard $[PYTHON_LPATH]]
  77. #define python_fpath $[wildcard $[PYTHON_FPATH]]
  78. #define python_cflags $[PYTHON_CFLAGS]
  79. #define python_lflags $[PYTHON_LFLAGS]
  80. #define python_libs $[PYTHON_LIBS]
  81. #define python_framework $[PYTHON_FRAMEWORK]
  82. #endif
  83. #if $[HAVE_NSPR]
  84. #define nspr_ipath $[wildcard $[NSPR_IPATH]]
  85. #define nspr_lpath $[wildcard $[NSPR_LPATH]]
  86. #define nspr_cflags $[NSPR_CFLAGS]
  87. #define nspr_libs $[NSPR_LIBS]
  88. #endif
  89. #if $[HAVE_SSL]
  90. #define ssl_ipath $[wildcard $[SSL_IPATH]]
  91. #define ssl_lpath $[wildcard $[SSL_LPATH]]
  92. #define ssl_cflags $[SSL_CFLAGS]
  93. #define ssl_libs $[SSL_LIBS]
  94. #endif
  95. #if $[HAVE_ZLIB]
  96. #define zlib_ipath $[wildcard $[ZLIB_IPATH]]
  97. #define zlib_lpath $[wildcard $[ZLIB_LPATH]]
  98. #define zlib_cflags $[ZLIB_CFLAGS]
  99. #define zlib_libs $[ZLIB_LIBS]
  100. #endif
  101. #if $[HAVE_GL]
  102. #define gl_ipath $[wildcard $[GL_IPATH]]
  103. #define gl_lpath $[wildcard $[GL_LPATH]]
  104. #define gl_cflags $[GL_CFLAGS]
  105. #define gl_libs $[GL_LIBS]
  106. #endif
  107. #if $[HAVE_MESA]
  108. #define mesa_ipath $[wildcard $[MESA_IPATH]]
  109. #define mesa_lpath $[wildcard $[MESA_LPATH]]
  110. #define mesa_cflags $[MESA_CFLAGS]
  111. #define mesa_libs $[MESA_LIBS]
  112. #endif
  113. #if $[HAVE_CHROMIUM]
  114. #define chromium_ipath $[wildcard $[CHROMIUM_IPATH]]
  115. #define chromium_lpath $[wildcard $[CHROMIUM_LPATH]]
  116. #define chromium_cflags $[CHROMIUM_CFLAGS]
  117. #define chromium_libs $[CHROMIUM_LIBS]
  118. #endif
  119. #if $[HAVE_GLX]
  120. #define glx_ipath $[wildcard $[GLX_IPATH]]
  121. #define glx_lpath $[wildcard $[GLX_LPATH]]
  122. #define glx_cflags $[GLX_CFLAGS]
  123. #define glx_libs $[GLX_LIBS]
  124. #endif
  125. #if $[HAVE_GLUT]
  126. #define glut_ipath $[wildcard $[GLUT_IPATH]]
  127. #define glut_lpath $[wildcard $[GLUT_LPATH]]
  128. #define glut_cflags $[GLUT_CFLAGS]
  129. #define glut_libs $[GLUT_LIBS]
  130. #endif
  131. #if $[HAVE_DX]
  132. #define dx_ipath $[wildcard $[DX_IPATH]]
  133. #define dx_lpath $[wildcard $[DX_LPATH]]
  134. #define dx_cflags $[DX_CFLAGS]
  135. #define dx_libs $[DX_LIBS]
  136. #endif
  137. #if $[HAVE_JPEG]
  138. #define jpeg_ipath $[wildcard $[JPEG_IPATH]]
  139. #define jpeg_lpath $[wildcard $[JPEG_LPATH]]
  140. #define jpeg_cflags $[JPEG_CFLAGS]
  141. #define jpeg_libs $[JPEG_LIBS]
  142. #endif
  143. #if $[HAVE_PNG]
  144. #define png_ipath $[wildcard $[PNG_IPATH]]
  145. #define png_lpath $[wildcard $[PNG_LPATH]]
  146. #define png_cflags $[PNG_CFLAGS]
  147. #define png_libs $[PNG_LIBS]
  148. #endif
  149. #if $[HAVE_TIFF]
  150. #define tiff_ipath $[wildcard $[TIFF_IPATH]]
  151. #define tiff_lpath $[wildcard $[TIFF_LPATH]]
  152. #define tiff_cflags $[TIFF_CFLAGS]
  153. #define tiff_libs $[TIFF_LIBS]
  154. #endif
  155. #if $[HAVE_FFTW]
  156. #define fftw_ipath $[wildcard $[FFTW_IPATH]]
  157. #define fftw_lpath $[wildcard $[FFTW_LPATH]]
  158. #define fftw_cflags $[FFTW_CFLAGS]
  159. #define fftw_libs $[FFTW_LIBS]
  160. #endif
  161. #if $[HAVE_NURBSPP]
  162. #define nurbspp_ipath $[wildcard $[NURBSPP_IPATH]]
  163. #define nurbspp_lpath $[wildcard $[NURBSPP_LPATH]]
  164. #define nurbspp_cflags $[NURBSPP_CFLAGS]
  165. #define nurbspp_libs $[NURBSPP_LIBS]
  166. #endif
  167. #if $[HAVE_VRPN]
  168. #define vrpn_ipath $[wildcard $[VRPN_IPATH]]
  169. #define vrpn_lpath $[wildcard $[VRPN_LPATH]]
  170. #define vrpn_cflags $[VRPN_CFLAGS]
  171. #define vrpn_libs $[VRPN_LIBS]
  172. #endif
  173. #if $[HAVE_MIKMOD]
  174. #define mikmod_ipath $[wildcard $[MIKMOD_IPATH]]
  175. #define mikmod_lpath $[wildcard $[MIKMOD_LPATH]]
  176. #define mikmod_cflags $[MIKMOD_CFLAGS]
  177. #define mikmod_libs $[MIKMOD_LIBS]
  178. #endif
  179. #if $[HAVE_GTKMM]
  180. #define gtkmm_ipath $[wildcard $[GTKMM_IPATH]]
  181. #define gtkmm_lpath $[wildcard $[GTKMM_LPATH]]
  182. #define gtkmm_cflags $[GTKMM_CFLAGS]
  183. #define gtkmm_libs $[GTKMM_LIBS]
  184. #endif
  185. #if $[HAVE_FREETYPE]
  186. #define freetype_ipath $[wildcard $[FREETYPE_IPATH]]
  187. #define freetype_lpath $[wildcard $[FREETYPE_LPATH]]
  188. #define freetype_cflags $[FREETYPE_CFLAGS]
  189. #define freetype_libs $[FREETYPE_LIBS]
  190. #endif
  191. #if $[and $[HAVE_MAYA],$[MAYA_LOCATION]]
  192. #define maya_ipath $[MAYA_LOCATION]/include
  193. #define maya_lpath $[MAYA_LOCATION]/lib
  194. #define maya_ld $[wildcard $[MAYA_LOCATION]/bin/mayald]
  195. #define maya_libs $[MAYA_LIBS]
  196. #endif
  197. #if $[and $[HAVE_SOFTIMAGE],$[SOFTIMAGE_LOCATION]]
  198. #define softimage_ipath $[SOFTIMAGE_LOCATION]/h
  199. #define softimage_lpath $[SOFTIMAGE_LOCATION]/dso
  200. #define softimage_libs $[SOFTIMAGE_LIBS]
  201. #endif
  202. #if $[HAVE_NET]
  203. #define net_ipath $[wildcard $[NET_IPATH]]
  204. #define net_lpath $[wildcard $[NET_LPATH]]
  205. #define net_libs $[NET_LIBS]
  206. #endif
  207. #if $[HAVE_RAD_MSS]
  208. #define rad_mss_ipath $[wildcard $[RAD_MSS_IPATH]]
  209. #define rad_mss_lpath $[wildcard $[RAD_MSS_LPATH]]
  210. #define rad_mss_libs $[RAD_MSS_LIBS]
  211. #endif
  212. #if $[HAVE_FMOD]
  213. #define fmod_ipath $[wildcard $[FMOD_IPATH]]
  214. #define fmod_lpath $[wildcard $[FMOD_LPATH]]
  215. #define fmod_libs $[FMOD_LIBS]
  216. #endif
  217. #if $[HAVE_CHROMIUM]
  218. #define chromium_ipath $[wildcard $[CHROMIUM_IPATH]]
  219. #define chromium_lpath $[wildcard $[CHROMIUM_LPATH]]
  220. #define chromium_libs $[CHROMIUM_LIBS]
  221. #endif
  222. // We define these two variables true here in the global scope; a
  223. // particular Sources.pp file can redefine these to be false to
  224. // prevent a particular directory or target from being built in
  225. // certain circumstances.
  226. #define BUILD_DIRECTORY 1
  227. #define BUILD_TARGET 1
  228. // This variable, when evaluated in the scope of a particular directory,
  229. // will indicate true (i.e. nonempty) when the directory is truly built,
  230. // or false (empty) when the directory is not to be built.
  231. #defer build_directory $[BUILD_DIRECTORY]
  232. // It maps to a direct evaluation of the user-set variable,
  233. // BUILD_DIRECTORY, for historical reasons. This also allows us to
  234. // reserve the right to extend this variable to test other conditions
  235. // as well, should the need arise.
  236. // This variable, when evaluated in the scope of a particular target,
  237. // will indicated true when the target should be built, or false when
  238. // the target is not to be built.
  239. #defer build_target $[BUILD_TARGET]
  240. // This takes advantage of the above two variables to get the actual
  241. // list of local libraries we are to link with, eliminating those that
  242. // won't be built.
  243. #defer active_local_libs \
  244. $[all_libs $[if $[and $[build_directory],$[build_target]],$[TARGET]],$[LOCAL_LIBS]]
  245. #defer active_component_libs \
  246. $[all_libs $[if $[and $[build_directory],$[build_target]],$[TARGET]],$[COMPONENT_LIBS]]
  247. #defer active_libs $[active_local_libs] $[active_component_libs]
  248. // This variable, when evaluated within a target, will either be empty
  249. // string if the target is not to be built, or the target name if it
  250. // is.
  251. #defer active_target $[if $[build_target],$[TARGET]]
  252. #defer get_combined_sources $[COMBINED_SOURCES]
  253. // This subroutine will set up the sources variable to reflect the
  254. // complete set of sources for this target, and also set the
  255. // alt_cflags, alt_libs, etc. as appropriate according to how the
  256. // various USE_* flags are set for the current target.
  257. // This variable returns the complete set of sources for the current
  258. // target.
  259. #defer get_sources \
  260. $[SOURCES] \
  261. $[if $[ne $[NO_COMBINED_SOURCES],], $[INCLUDED_SOURCES], $[get_combined_sources]]
  262. #defer included_sources $[INCLUDED_SOURCES]
  263. // This variable returns the set of sources that are to be
  264. // interrogated for the current target.
  265. #defer get_igatescan \
  266. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  267. $[if $[eq $[IGATESCAN], all], \
  268. $[filter-out %.I %.T %.lxx %.yxx %.N %_src.cxx,$[get_sources]], \
  269. $[IGATESCAN]]]
  270. // This variable returns the name of the interrogate database file
  271. // that will be generated for a particular target, or empty string if
  272. // the target is not to be interrogated.
  273. #defer get_igatedb \
  274. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  275. $[ODIR]/lib$[TARGET]$[dllext].in]
  276. // This variable returns the name of the interrogate code file
  277. // that will be generated for a particular target, or empty string if
  278. // the target is not to be interrogated.
  279. #defer get_igateoutput \
  280. $[if $[and $[run_interrogate],$[IGATESCAN]], \
  281. $[ODIR]/lib$[TARGET]_igate.cxx]
  282. // This variable is the set of .in files generated by all of our
  283. // component libraries. If it is nonempty, then we do need to
  284. // generate a module, and $[get_igatemout] is the name of the .cxx file
  285. // that interrogate will produce to make this module.
  286. #defer get_igatemscan $[components $[get_igatedb:%=$[RELDIR]/%],$[active_component_libs]]
  287. #defer get_igatemout $[if $[get_igatemscan],$[ODIR]/lib$[TARGET]_module.cxx]
  288. // This variable returns the set of external packages used by this
  289. // target, and by all the components shared by this target.
  290. #defer use_packages $[sort $[USE_PACKAGES] $[components $[USE_PACKAGES],$[active_component_libs]]]
  291. // This function returns the appropriate cflags for the target, based
  292. // on the various external packages this particular target claims to
  293. // require.
  294. #defun get_cflags
  295. // hack to add stl,nspr,python. should be removed
  296. #define alt_cflags $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_cflags] $[nspr_cflags] $[python_cflags]]
  297. #foreach package $[use_packages]
  298. #set alt_cflags $[alt_cflags] $[$[package]_cflags]
  299. #end package
  300. $[alt_cflags]
  301. #end get_cflags
  302. // This function returns the appropriate lflags for the target, based
  303. // on the various external packages this particular target claims to
  304. // require.
  305. #defun get_lflags
  306. // hack to add stl,nspr,python. should be removed
  307. #define alt_lflags $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_lflags] $[nspr_lflags] $[python_lflags]]
  308. #foreach package $[use_packages]
  309. #set alt_lflags $[alt_lflags] $[$[package]_lflags]
  310. #end package
  311. $[alt_lflags]
  312. #end get_lflags
  313. // This function returns the appropriate include path for the target,
  314. // based on the various external packages this particular target
  315. // claims to require. This returns a space-separated set of directory
  316. // names only; the -I switch is not included here.
  317. #defun get_ipath
  318. // hack to add stl,nspr,python. should be removed
  319. #define alt_ipath $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_ipath] $[nspr_ipath] $[python_ipath]]
  320. #foreach package $[use_packages]
  321. #set alt_ipath $[alt_ipath] $[$[package]_ipath]
  322. #end package
  323. $[alt_ipath]
  324. #end get_ipath
  325. // This function returns the appropriate library search path for the
  326. // target, based on the various external packages this particular
  327. // target claims to require. This returns a space-separated set of
  328. // directory names only; the -L switch is not included here.
  329. #defun get_lpath
  330. #define alt_lpath $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_lpath] $[nspr_lpath] $[python_lpath]]
  331. #if $[WINDOWS_PLATFORM]
  332. #set alt_lpath $[WIN32_PLATFORMSDK_LIBPATH] $[alt_lpath]
  333. #endif
  334. #foreach package $[use_packages]
  335. #set alt_lpath $[alt_lpath] $[$[package]_lpath]
  336. #end package
  337. $[alt_lpath]
  338. #end get_lpath
  339. // This function returns the appropriate framework search path for the
  340. // target, based on the various external frameworks this particular
  341. // target claims to require. This returns a space-separated set of
  342. // directory names only; the -F switch is not included here.
  343. #defun get_fpath
  344. #define alt_fpath $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_fpath] $[nspr_fpath] $[python_fpath]]
  345. #foreach package $[use_packages]
  346. #set alt_fpath $[alt_fpath] $[$[package]_fpath]
  347. #end package
  348. $[alt_fpath]
  349. #end get_fpath
  350. // This function returns the appropriate framework for the
  351. // target, based on the various external frameworks this particular
  352. // target claims to require. This returns a space-separated set of
  353. // framework names only; the -framework switch is not included here.
  354. #defun get_frameworks
  355. #define alt_framework $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_framework] $[nspr_framework] $[python_framework]]
  356. #foreach package $[use_packages]
  357. #set alt_framework $[alt_framework] $[$[package]_framework]
  358. #end package
  359. $[alt_framework]
  360. #end get_frameworks
  361. // This function returns the appropriate set of library names to link
  362. // with for the target, based on the various external packages this
  363. // particular target claims to require. This returns a
  364. // space-separated set of library names only; the -l switch is not
  365. // included here.
  366. #defun get_libs
  367. #define alt_libs $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_libs] $[nspr_libs] $[python_libs]]
  368. #if $[WINDOWS_PLATFORM]
  369. #set alt_libs $[alt_libs] $[WIN_SYS_LIBS] $[components $[WIN_SYS_LIBS],$[active_component_libs] $[transitive_link]]
  370. #elif $[OSX_PLATFORM]
  371. #set alt_libs $[alt_libs] $[OSX_SYS_LIBS] $[components $[OSX_SYS_LIBS],$[active_component_libs] $[transitive_link]]
  372. #else
  373. #set alt_libs $[alt_libs] $[UNIX_SYS_LIBS] $[components $[UNIX_SYS_LIBS],$[active_component_libs] $[transitive_link]]
  374. #endif
  375. #foreach package $[use_packages]
  376. #set alt_libs $[alt_libs] $[$[package]_libs]
  377. #end package
  378. $[alt_libs]
  379. #end get_libs
  380. // This function returns the appropriate value for ld for the target.
  381. #defun get_ld
  382. #if $[filter maya,$[use_packages]]
  383. $[maya_ld]
  384. #endif
  385. #end get_ld
  386. // This function determines the set of files a given source file
  387. // depends on. It is based on the setting of the $[filename]_sources
  388. // variable to indicate the sources for composite files, etc.
  389. #defun get_depends source
  390. #if $[$[source]_sources]
  391. #if $[ne $[$[source]_sources],none]
  392. $[$[source]_sources] $[dependencies $[$[source]_sources]]
  393. #endif
  394. #else
  395. $[dependencies $[source]]
  396. #endif
  397. #end get_depends
  398. // This function determines the set of libraries our various targets
  399. // depend on. This is a complicated definition. It is the union of
  400. // all of our targets' dependencies, except:
  401. // If a target is part of a metalib, it depends (a) directly on all of
  402. // its normal library dependencies that are part of the same metalib,
  403. // and (b) indirectly on all of the metalibs that every other library
  404. // dependency is part of. If a target is not part of a metalib, it is
  405. // the same as case (b) above.
  406. #defun get_depend_libs
  407. #define depend_libs
  408. #forscopes lib_target noinst_lib_target test_lib_target
  409. #define metalib $[module $[TARGET],$[TARGET]]
  410. #if $[ne $[metalib],]
  411. // This library is included on a metalib.
  412. #foreach depend $[LOCAL_LIBS]
  413. #define depend_metalib $[module $[TARGET],$[depend]]
  414. #if $[eq $[depend_metalib],$[metalib]]
  415. // Here's a dependent library in the *same* metalib.
  416. #set depend_libs $[depend_libs] $[depend]
  417. #elif $[ne $[depend_metalib],]
  418. // This dependent library is in a *different* metalib.
  419. #set depend_libs $[depend_libs] $[depend_metalib]
  420. #else
  421. // This dependent library is not in any metalib.
  422. #set depend_libs $[depend_libs] $[depend]
  423. #endif
  424. #end depend
  425. #else
  426. // This library is *not* included on a metalib.
  427. #foreach depend $[LOCAL_LIBS]
  428. #define depend_metalib $[module $[TARGET],$[depend]]
  429. #if $[ne $[depend_metalib],]
  430. // This dependent library is on a metalib.
  431. #set depend_libs $[depend_libs] $[depend_metalib]
  432. #else
  433. // This dependent library is not in any metalib.
  434. #set depend_libs $[depend_libs] $[depend]
  435. #endif
  436. #end depend
  437. #endif
  438. #end lib_target noinst_lib_target test_lib_target
  439. // These will never be part of a metalib.
  440. #forscopes static_lib_target ss_lib_target bin_target noinst_bin_target metalib_target
  441. #foreach depend $[LOCAL_LIBS]
  442. #define depend_metalib $[module $[TARGET],$[depend]]
  443. #if $[ne $[depend_metalib],]
  444. // This dependent library is on a metalib.
  445. #if $[eq $[depend_metalib],$[TARGET]]
  446. #print Warning: $[TARGET] circularly depends on $[depend].
  447. #else
  448. #set depend_libs $[depend_libs] $[depend_metalib]
  449. #endif
  450. #else
  451. // This dependent library is not in any metalib.
  452. #set depend_libs $[depend_libs] $[depend]
  453. #endif
  454. #end depend
  455. #end static_lib_target ss_lib_target bin_target noinst_bin_target metalib_target
  456. // In case we're defining any metalibs, these depend directly on
  457. // their components as well.
  458. #set depend_libs $[depend_libs] $[COMPONENT_LIBS(metalib_target)]
  459. $[depend_libs]
  460. #end get_depend_libs
  461. // dtool/pptempl/Global.pp
  462. // Define a few directories that will be useful.
  463. #define install_dir $[$[upcase $[PACKAGE]]_INSTALL]
  464. #if $[eq $[install_dir],]
  465. #error Variable $[upcase $[PACKAGE]]_INSTALL is not set! Cannot install!
  466. #endif
  467. #define other_trees
  468. #define other_trees_lib
  469. #define other_trees_include
  470. #foreach tree $[NEEDS_TREES]
  471. #define tree_install $[$[upcase $[tree]]_INSTALL]
  472. #if $[eq $[tree_install],]
  473. Warning: Variable $[upcase $[tree]]_INSTALL is not set!
  474. #else
  475. #set other_trees $[other_trees] $[tree_install]
  476. #set other_trees_lib $[other_trees_lib] $[tree_install]/lib
  477. #set other_trees_include $[other_trees_include] $[tree_install]/include
  478. #endif
  479. #end tree
  480. #define install_lib_dir $[or $[INSTALL_LIB_DIR],$[install_dir]/lib]
  481. #define other_trees_lib $[or $[INSTALL_LIB_DIR],$[other_trees_lib]]
  482. #define install_headers_dir $[or $[INSTALL_HEADERS_DIR],$[install_dir]/include]
  483. #define other_trees_include $[or $[INSTALL_HEADERS_DIR],$[other_trees_include]]
  484. #define install_bin_dir $[or $[INSTALL_BIN_DIR],$[install_dir]/bin]
  485. #define install_data_dir $[or $[INSTALL_DATA_DIR],$[install_dir]/shared]
  486. #define install_igatedb_dir $[or $[INSTALL_IGATEDB_DIR],$[install_dir]/etc]
  487. #define install_config_dir $[or $[INSTALL_CONFIG_DIR],$[install_dir]/etc]
  488. #defer install_py_dir $[install_lib_dir]/$[PACKAGE]/$[DIRNAME]
  489. #defer install_py_package_dir $[install_lib_dir]/$[PACKAGE]
  490. #if $[ne $[DTOOL_INSTALL],]
  491. #define install_parser_inc_dir $[DTOOL_INSTALL]/include/parser-inc
  492. #else
  493. #define install_parser_inc_dir $[install_headers_dir]/parser-inc
  494. #endif
  495. // Set up the correct interrogate options.
  496. // $[dllext] is redefined in the Windows Global.platform.pp files to
  497. // the string _d if we are building a debug tree. This is inserted
  498. // into the .dll and .in filenames before the extension to make a
  499. // runtime distinction between debug and non-debug builds. For now,
  500. // we make a global definition to empty string, since non-Windows
  501. // platforms will leave this empty.
  502. #define dllext
  503. // $[obj_prefix] defines the prefix that is prepended to the name of
  504. // the object files. It can be used to avoid potential collisions
  505. // when a source file is used by multiple targets but with different
  506. // compile options for each.
  507. //
  508. // $[obj_prefix] may be redefined by one of the Global.platform.pp
  509. // files.
  510. #defer obj_prefix $[TARGET]_
  511. // Caution! interrogate_ipath might be redefined in the
  512. // Global.platform.pp file.
  513. #defer interrogate_ipath $[target_ipath:%=-I%]
  514. #defer interrogate_spath $[install_parser_inc_dir:%=-S%] -S/usr/include
  515. #defer interrogate_options \
  516. -DCPPPARSER -D__STDC__=1 -D__cplusplus $[SYSTEM_IGATE_FLAGS] \
  517. $[interrogate_spath] $[interrogate_ipath] \
  518. $[CDEFINES_OPT$[OPTIMIZE]:%=-D%] \
  519. $[filter -D%,$[C++FLAGS]] \
  520. $[INTERROGATE_OPTIONS] \
  521. $[if $[INTERROGATE_PYTHON_INTERFACE],-python] \
  522. $[if $[INTERROGATE_C_INTERFACE],-c] \
  523. $[if $[TRACK_IN_INTERPRETER],-track-interpreter] \
  524. $[if $[<= $[OPTIMIZE], 1],-spam]
  525. #defer interrogate_module_options \
  526. $[if $[INTERROGATE_PYTHON_INTERFACE],-python] \
  527. $[if $[INTERROGATE_C_INTERFACE],-c] \
  528. $[if $[TRACK_IN_INTERPRETER],-track-interpreter]
  529. // The language stuff is used by model builds only.
  530. // Set language_filters to be "%_english %_castillian %_japanese %_german" etc.
  531. #if $[LANGUAGES]
  532. #define language_filters $[subst <pct>,%,$[LANGUAGES:%=<pct>_%]]
  533. #print Using language $[LANGUAGE]
  534. #else
  535. #define language_filters
  536. #endif
  537. #define language_egg_filters $[language_filters:%=%.egg]
  538. #define language_dna_filters $[language_filters:%=%.dna]
  539. // This is used for evaluating SoftImage unpack rules in Template.models.pp.
  540. #defer soft_scene_files $[matrix $[DATABASE]/SCENES/$[SCENE_PREFIX],$[MODEL] $[ANIMS],.1-0.dsc]
  541. // Include the global definitions for this particular build_type, if
  542. // the file is there.
  543. #sinclude $[GLOBAL_TYPE_FILE]