Global.pp 25 KB

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