Config.pp 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  1. //
  2. // dtool/Config.pp
  3. //
  4. // This file defines certain configuration variables that are written
  5. // into the various make scripts. It is processed by ppremake (along
  6. // with the Sources.pp files in each of the various directories) to
  7. // generate build scripts appropriate to each environment.
  8. //
  9. // *******************************************************************
  10. // NOTE: you should not attempt to copy this file verbatim as your own
  11. // personal Config.pp file. Instead, you should start with an empty
  12. // Config.pp file, and add lines to it when you wish to override
  13. // settings given in here. In the normal ppremake system, this file
  14. // will always be read first, and then your personal Config.pp file
  15. // will be read later, which gives you a chance to override the
  16. // default settings found in this file. However, if you start by
  17. // copying the entire file, it will be difficult to tell which
  18. // settings you have customized, and it will be difficult to upgrade
  19. // to a subsequent version of Panda.
  20. // *******************************************************************
  21. //
  22. // ppremake is capable of generating makefiles for Unix compilers such
  23. // as gcc or SGI's MipsPRO compiler, as well as for Windows
  24. // environments like Microsoft's Visual C++. It can also,
  25. // potentially, generate Microsoft Developer's Studio project files
  26. // directly, although we haven't written the scripts to do this yet.
  27. // In principle, it can be extended to generate suitable build script
  28. // files for any number of different build environments.
  29. //
  30. // All of these build scripts can be tuned for a particular
  31. // environment via this file. This is the place for the user to
  32. // specify which external packages are installed and where, or to
  33. // enable or disable certain optional features. However, it is
  34. // suggested that rather than modify this file directly, you create a
  35. // custom file in your home directory and there redefine whatever
  36. // variables are appropriate, and set the environment variable
  37. // PPREMAKE_CONFIG to refer to it. In this way, you can easily get an
  38. // updated source tree (including a new Config.pp) without risking
  39. // accidentally losing your customizations. This also avoids having
  40. // to redefine the same variables in different packages (for instance,
  41. // in dtool and in panda).
  42. //
  43. // The syntax in this file resembles some hybrid between C++
  44. // preprocessor declarations and GNU make variables. This is the same
  45. // syntax used in the various ppremake system configure files; it's
  46. // designed to be easy to use as a macro language to generate
  47. // makefiles and their ilk.
  48. //
  49. // Some of the variables below are defined using the #define command,
  50. // and others are defined using #defer. The two are very similar in
  51. // their purpose; the difference is that, if the variable definition
  52. // includes references to other variables (e.g. $[varname]), then
  53. // #define will evaluate all of the other variable references
  54. // immediately and store the resulting expansion, while #defer will
  55. // store only the variable references themselves, and expand them when
  56. // the variable is later referenced. It is very similar to the
  57. // relationship between := and = in GNU Make.
  58. // dtool/Config.pp
  59. // In general, #defer is used in this file, to allow the user to
  60. // redefine critical variables in his or her own Config.pp file.
  61. // What kind of build scripts are we generating? This selects a
  62. // suitable template file from the ppremake system files. The
  63. // allowable choices, at present, are:
  64. //
  65. // unix - Generate makefiles suitable for most Unix platforms.
  66. // msvc - Generate Visual C++ project files (still a work in progress)
  67. // nmake - Generate makefiles for Microsoft Visual C++, using
  68. // Microsoft's nmake utility.
  69. // gmsvc - Generate makefiles similar to the above, using Microsoft
  70. // Visual C++, but uses the Cygwin-supplied GNU make
  71. // instead of Microsoft nmake. This is potentially
  72. // faster if you have multiple CPU's, since it supports
  73. // distributed make. It's a tiny bit slower if you're
  74. // not taking advantage of distributed make, because of
  75. // the overhead associated with Cygwin fork() calls.
  76. #if $[eq $[PLATFORM], Win32]
  77. #define BUILD_TYPE nmake
  78. #elif $[eq $[PLATFORM], Cygwin]
  79. #define BUILD_TYPE gmsvc
  80. #elif $[OSX_PLATFORM]
  81. #define BUILD_TYPE unix
  82. #else
  83. #define BUILD_TYPE unix
  84. #endif
  85. // What is the default install directory for all trees in the Panda
  86. // suite? The default value for this variable is provided by
  87. // ppremake; on Unix machines it is the value of --prefix passed in to
  88. // the configure script, and on Windows machines the default is
  89. // hardcoded in config_msvc.h to C:\Panda3d.
  90. // You may also override this for a particular tree by defining a
  91. // variable name like DTOOL_INSTALL or PANDA_INSTALL. (The
  92. // INSTALL_DIR variable will have no effect if you are using the
  93. // ctattach tools to control your attachment to the trees; but this
  94. // will be the case only if you are a member of the VR Studio.)
  95. // #define INSTALL_DIR /usr/local/panda
  96. // If you intend to use Panda only as a Python module, you may find
  97. // the following define useful (but you should put in the correct path
  98. // to site-packages within your own installed Python). This will
  99. // install the Panda libraries into the standard Python search space
  100. // so that they can be accessed as Python modules. (Also see the
  101. // PYTHON_IPATH variable, below.)
  102. // If you don't do this, you can still use Panda as a Python module,
  103. // but you must put /usr/local/panda/lib (or $INSTALL_DIR/lib) on
  104. // your PYTHONPATH.
  105. // #define INSTALL_LIB_DIR /usr/lib/python2.2/site-packages
  106. // The character used to separate components of an OS-specific
  107. // directory name depends on the platform (it is '/' on Unix, '\' on
  108. // Windows). That character selection is hardcoded into Panda and
  109. // cannot be changed here. (Note that an internal Panda filename
  110. // always uses the forward slash, '/', to separate the components of a
  111. // directory name.)
  112. // There's a different character used to separate the complete
  113. // directory names in a search path specification. On Unix, the
  114. // normal convention is ':', on Windows, it has to be ';', because the
  115. // colon is already used to mark the drive letter. This character is
  116. // selectable here. Most users won't want to change this. If
  117. // multiple characters are placed in this string, any one of them may
  118. // be used as a separator character.
  119. #define DEFAULT_PATHSEP $[if $[WINDOWS_PLATFORM],;,:]
  120. // What level of compiler optimization/debug symbols should we build?
  121. // The various optimize levels are defined as follows:
  122. //
  123. // 1 - No compiler optimizations, debug symbols, debug heap, lots of checks
  124. // 2 - Full compiler optimizations, debug symbols, debug heap, lots of checks
  125. // 3 - Full compiler optimizations, full debug symbols, fewer checks
  126. // 4 - Full optimizations, no debug symbols, and asserts removed
  127. //
  128. #define OPTIMIZE 3
  129. // On OSX, you may or may not want to compile universal binaries.
  130. // Turning this option on allows your compiled version of Panda to run
  131. // on any version of OSX (PPC or Intel-based), but it will also
  132. // increase the compilation time, as well as the resulting binary
  133. // size. I believe you have to be building on an Intel-based platform
  134. // to generate universal binaries using this technique. This option
  135. // has no effect on non-OSX platforms.
  136. #define UNIVERSAL_BINARIES
  137. // Panda uses prc files for runtime configuration. There are many
  138. // compiled-in options to customize the behavior of the prc config
  139. // system; most users won't need to change any of them. Feel free to
  140. // skip over all of the PRC_* variables defined here.
  141. // The default behavior is to search for files names *.prc in the
  142. // directory specified by the PRC_DIR environment variable, and then
  143. // to search along all of the directories named by the PRC_PATH
  144. // environment variable. Either of these variables might be
  145. // undefined; if both of them are undefined, the default is to search
  146. // in the directory named here by DEFAULT_PRC_DIR.
  147. // By default, we specify the install/etc dir, which is where the
  148. // system-provided PRC files get copied to.
  149. #defer DEFAULT_PRC_DIR $[INSTALL_DIR]/etc
  150. // You can specify the names of the environment variables that are
  151. // used to specify the search location(s) for prc files at runtime.
  152. // These are space-separated lists of environment variable names.
  153. // Specify empty string for either one of these to disable the
  154. // feature. For instance, redefining PRC_DIR_ENVVARS here to
  155. // PANDA_PRC_DIR would cause the environment variable $PANDA_PRC_DIR
  156. // to be consulted at startup instead of the default value of
  157. // $PRC_DIR.
  158. #define PRC_DIR_ENVVARS PRC_DIR
  159. #define PRC_PATH_ENVVARS PRC_PATH
  160. // You can specify the name of the file(s) to search for in the above
  161. // paths to be considered a config file. This should be a
  162. // space-separated list of filename patterns. This is *.prc by
  163. // default; normally there's no reason to change this.
  164. #define PRC_PATTERNS *.prc
  165. // You can optionally encrypt your prc file(s) to help protect them
  166. // from curious eyes. You have to specify the encryption key, which
  167. // gets hard-coded into the executable. (This feature provides mere
  168. // obfuscation, not real security, since the encryption key can
  169. // potentially be extracted by a hacker.) This requires building with
  170. // OpenSSL (see below).
  171. #define PRC_ENCRYPTED_PATTERNS *.prc.pe
  172. #define PRC_ENCRYPTION_KEY ""
  173. // One unusual feature of config is the ability to execute one or more
  174. // of the files it discovers as if it were a program, and then treat
  175. // the output of this program as a prc file. If you want to use this
  176. // feature, define this variable to the filename pattern or patterns
  177. // for such executable-style config programs (e.g. *prc.exe). This
  178. // can be the same as the above if you like this sort of ambiguity; in
  179. // that case, config will execute the file if it appears to be
  180. // executable; otherwise, it will simply read it.
  181. #define PRC_EXECUTABLE_PATTERNS
  182. // If you do use the above feature, you'll need another environment
  183. // variable that specifies additional arguments to pass to the
  184. // executable programs. The default definition, given here, makes
  185. // that variable be $PRC_EXECUTABLE_ARGS. Sorry, the same arguments
  186. // must be supplied to all executables in a given runtime session.
  187. #define PRC_EXECUTABLE_ARGS_ENVVAR PRC_EXECUTABLE_ARGS
  188. // You can implement signed prc files, if you require this advanced
  189. // feature. This allows certain config variables to be set only by a
  190. // prc file that has been provided by a trusted source. To do this,
  191. // first install and compile Dtool with OpenSSL (below) and run the
  192. // program make-prc-key, and then specify here the output filename
  193. // generated by that program, and then recompile Dtool (ppremake; make
  194. // install).
  195. #define PRC_PUBLIC_KEYS_FILENAME
  196. // By default, the signed-prc feature, above, is enabled only for a
  197. // release build (OPTIMIZE = 4). In a normal development environment
  198. // (OPTIMIZE < 4), any prc file can set any config variable, whether
  199. // or not it is signed. Set this variable true (nonempty) or false
  200. // (empty) to explicitly enable or disable this feature.
  201. #defer PRC_RESPECT_TRUST_LEVEL $[= $[OPTIMIZE],4]
  202. // If trust level is in effect, this specifies the default trust level
  203. // for any legacy (Dconfig) config variables (that is, variables
  204. // created using the config.GetBool(), etc. interface, rather than the
  205. // newer ConfigVariableBool interface).
  206. #defer PRC_DCONFIG_TRUST_LEVEL 0
  207. // If trust level is in effect, you may globally increment the
  208. // (mis)trust level of all variables by the specified amount.
  209. // Incrementing this value by 1 will cause all variables to require at
  210. // least a level 1 signature.
  211. #define PRC_INC_TRUST_LEVEL 0
  212. // Similarly, the descriptions are normally saved only in a
  213. // development build, not in a release build. Set this value true to
  214. // explicitly save them anyway.
  215. #defer PRC_SAVE_DESCRIPTIONS $[< $[OPTIMIZE],4]
  216. // This is the end of the PRC variable customization section. The
  217. // remaining variables are of general interest to everyone.
  218. // NOTE: In the following, to indicate "yes" to a yes/no question,
  219. // define the variable to be a nonempty string. To indicate "no",
  220. // define the variable to be an empty string.
  221. // Many of the HAVE_* variables are defined in terms of expressions
  222. // based on the paths and library names, etc., defined above. These
  223. // are defined using the "defer" command, so that they are not
  224. // evaluated right away, giving the user an opportunity to redefine
  225. // the variables they depend on, or to redefine the HAVE_* variables
  226. // themselves (you can explicitly define a HAVE_* variable to some
  227. // nonempty string to force the package to be marked as installed).
  228. // Do you want to generate a Python-callable interrogate interface?
  229. // This is only necessary if you plan to make calls into Panda from a
  230. // program written in Python. This is done only if HAVE_PYTHON,
  231. // below, is also true.
  232. #define INTERROGATE_PYTHON_INTERFACE 1
  233. // Define this true to use the new interrogate feature to generate
  234. // Python-native objects directly, rather than requiring a separate
  235. // FFI step. This loads and runs much more quickly than the original
  236. // mechanism. Define this false (that is, empty) to use the original
  237. // interfaces.
  238. #define PYTHON_NATIVE 1
  239. // Do you want to generate a C-callable interrogate interface? This
  240. // generates an interface similar to the Python interface above, with
  241. // a C calling convention. It should be useful for most other kinds
  242. // of scripting language; the VR Studio used to use this to make calls
  243. // into Panda from Squeak. This is not presently used by any VR
  244. // Studio code.
  245. #define INTERROGATE_C_INTERFACE
  246. // Do you even want to build interrogate at all? This is the program
  247. // that reads our C++ source files and generates one of the above
  248. // interfaces. If you won't be building the interfaces, you don't
  249. // need the program.
  250. #defer HAVE_INTERROGATE $[or $[INTERROGATE_PYTHON_INTERFACE],$[INTERROGATE_C_INTERFACE]]
  251. // What additional options should be passed to interrogate when
  252. // generating either of the above two interfaces? Generally, you
  253. // probably don't want to mess with this.
  254. #define INTERROGATE_OPTIONS -fnames -string -refcount -assert
  255. // What's the name of the interrogate binary to run? The default
  256. // specified is the one that is built as part of DTOOL. If you have a
  257. // prebuilt binary standing by (for instance, one built opt4), specify
  258. // its name instead.
  259. #define INTERROGATE interrogate
  260. #define INTERROGATE_MODULE interrogate_module
  261. // Is Python installed, and should Python interfaces be generated? If
  262. // Python is installed, which directory is it in?
  263. #define PYTHON_IPATH /usr/include/python2.4
  264. #define PYTHON_LPATH
  265. #define PYTHON_FPATH
  266. #define PYTHON_COMMAND python
  267. #defer PYTHON_DEBUG_COMMAND $[PYTHON_COMMAND]$[if $[WINDOWS_PLATFORM],_d]
  268. #define PYTHON_FRAMEWORK
  269. #defer HAVE_PYTHON $[isdir $[PYTHON_IPATH]]
  270. // By default, we'll assume the user only wants to run with Debug
  271. // python if he has to--that is, on Windows when building a debug build.
  272. #defer USE_DEBUG_PYTHON $[and $[< $[OPTIMIZE],3],$[WINDOWS_PLATFORM]]
  273. // Define the default set of libraries to be instrumented by
  274. // genPyCode. You may wish to add to this list to add your own
  275. // libraries, or if you want to use some of the more obscure
  276. // interfaces like libpandaegg and libpandafx.
  277. #define GENPYCODE_LIBS libpandaexpress libpanda libpandaphysics libdirect libpandafx
  278. // Normally, Python source files are copied into the INSTALL_LIB_DIR
  279. // defined above, along with the compiled C++ library objects, when
  280. // you make install. If you prefer not to copy these Python source
  281. // files, but would rather run them directly out of the source
  282. // directory (presumably so you can develop them and make changes
  283. // without having to reinstall), comment out this definition and put
  284. // your source directory on your PYTHONPATH.
  285. #define INSTALL_PYTHON_SOURCE 1
  286. // Do you want to enable the "in_interpreter" global variable? This
  287. // will enable some callbacks, particularly the MemoryUsage object, to
  288. // know whether they were called from Python code (or other high-level
  289. // show code) and react accordingly, generally for debugging
  290. // purporses. It adds a bit of runtime overhead, and isn't usually
  291. // useful unless we're building a debug tree anyway. The default is
  292. // to enable it only for optimize levels 1 and 2.
  293. #defer TRACK_IN_INTERPRETER $[<= $[OPTIMIZE], 2]
  294. // Do you want to compile in support for tracking memory usage? This
  295. // enables you to define the variable "track-memory-usage" at runtime
  296. // to help track memory leaks, and also report total memory usage on
  297. // PStats. There is some small overhead for having this ability
  298. // available, even if it is unused.
  299. #defer DO_MEMORY_USAGE $[<= $[OPTIMIZE], 3]
  300. // Should we attempt to override the global new and delete operators?
  301. // It turns out this is usually a bad idea, but may be useful for
  302. // development.
  303. #define REDEFINE_GLOBAL_OPERATOR_NEW
  304. // This option compiles in support for simulating network delay via
  305. // the min-lag and max-lag prc variables. It adds a tiny bit of
  306. // overhead even when it is not activated, so it is typically enabled
  307. // only in a development build.
  308. #defer SIMULATE_NETWORK_DELAY $[<= $[OPTIMIZE], 3]
  309. // This option compiles in support for immediate-mode OpenGL
  310. // rendering. Since this is normally useful only for researching
  311. // buggy drivers, and since there is a tiny bit of per-primitive
  312. // overhead to have this option available even if it is unused, it is
  313. // by default enabled only in a development build. This has no effect
  314. // on DirectX rendering.
  315. #define SUPPORT_IMMEDIATE_MODE $[<= $[OPTIMIZE], 3]
  316. // Do you want to compile in support for pipelining? This enables
  317. // setting and accessing multiple different copies of frame-specific
  318. // data stored in nodes, etc. This is necessary, in conjunction with
  319. // HAVE_THREADS, to implement threaded multistage rendering in Panda.
  320. // However, compiling this option in does add some additional runtime
  321. // overhead even if it is not used. By default, we enable pipelining
  322. // whenever threads are enabled, assuming that if you have threads,
  323. // you also want to use pipelining. We also enable it at OPTIMIZE
  324. // level 1, since that enables additional runtime checks.
  325. //#defer DO_PIPELINING $[or $[<= $[OPTIMIZE], 1],$[HAVE_THREADS]]
  326. // Actually, let's *not* assume that threading implies pipelining, at
  327. // least not until pipelining is less of a performance hit.
  328. #defer DO_PIPELINING $[<= $[OPTIMIZE], 1]
  329. // Do you want to use one of the alternative malloc implementations?
  330. // This is almost always a good idea on Windows, where the standard
  331. // malloc implementation appears to be pretty poor, but probably
  332. // doesn't matter much on Linux (which is likely to implement
  333. // ptmalloc2 anyway). We always define this by default on Windows; on
  334. // Linux, we define it by default only when DO_MEMORY_USAGE is enabled
  335. // (since in that case, we'll be paying the overhead for the extra
  336. // call anyway) or when HAVE_THREADS is not defined (since the
  337. // non-thread-safe dlmalloc is a tiny bit faster than the system
  338. // library).
  339. // In hindsight, let's not enable this at all. It just causes
  340. // problems.
  341. //#defer ALTERNATIVE_MALLOC $[or $[WINDOWS_PLATFORM],$[DO_MEMORY_USAGE],$[not $[HAVE_THREADS]]]
  342. #define ALTERNATIVE_MALLOC
  343. // Define this true to build the low-level native network
  344. // implementation. Normally this should be set true.
  345. #define WANT_NATIVE_NET 1
  346. #define NATIVE_NET_IPATH
  347. #define NATIVE_NET_LPATH
  348. #define NATIVE_NET_LIBS $[if $[WINDOWS_PLATFORM],wsock32.lib]
  349. // Do you want to build the high-level network interface? This layers
  350. // on top of the low-level native_net interface, specified above.
  351. // Normally, if you build NATIVE_NET, you will also build NET.
  352. #defer HAVE_NET $[WANT_NATIVE_NET]
  353. // Is a third-party STL library installed, and where? This is only
  354. // necessary if the default include and link lines that come with the
  355. // compiler don't provide adequate STL support. At least some form of
  356. // STL is absolutely required in order to build Panda.
  357. #define STL_IPATH
  358. #define STL_LPATH
  359. #define STL_CFLAGS
  360. #define STL_LIBS
  361. // Does your STL library provide hashed associative containers like
  362. // hash_map and hash_set? Define this true if you have a nonstandard
  363. // STL library that provides these, like Visual Studio .NET's. (These
  364. // hashtable containers are not part of the C++ standard yet, but the
  365. // Dinkum STL library that VC7 ships with includes a preliminary
  366. // implementation that Panda can optionally use.) For now, we assume
  367. // you have this by default only on a Windows platform.
  368. // On second thought, it turns out that this API is still too
  369. // volatile. The interface seems to have changed with the next
  370. // version of .NET, and it didn't present any measureable performance
  371. // gain anyway. Never mind.
  372. #define HAVE_STL_HASH
  373. // Is OpenSSL installed, and where?
  374. #define OPENSSL_IPATH /usr/local/ssl/include
  375. #define OPENSSL_LPATH /usr/local/ssl/lib
  376. #define OPENSSL_LIBS ssl crypto
  377. #defer HAVE_OPENSSL $[libtest $[OPENSSL_LPATH],$[OPENSSL_LIBS]]
  378. // Redefine this to empty if your version of OpenSSL is prior to 0.9.7.
  379. #define OPENSSL_097 1
  380. // Define this true to include the OpenSSL code to report verbose
  381. // error messages when they occur.
  382. #defer REPORT_OPENSSL_ERRORS $[< $[OPTIMIZE], 4]
  383. // Is libjpeg installed, and where?
  384. #define JPEG_IPATH
  385. #define JPEG_LPATH
  386. #define JPEG_LIBS jpeg
  387. #defer HAVE_JPEG $[libtest $[JPEG_LPATH],$[JPEG_LIBS]]
  388. // Is libpng installed, and where?
  389. #define PNG_IPATH
  390. #define PNG_LPATH
  391. #define PNG_LIBS png
  392. #defer HAVE_PNG $[libtest $[PNG_LPATH],$[PNG_LIBS]]
  393. // Is libtiff installed, and where?
  394. #define TIFF_IPATH
  395. #define TIFF_LPATH
  396. #define TIFF_LIBS tiff z
  397. #defer HAVE_TIFF $[libtest $[TIFF_LPATH],$[TIFF_LIBS]]
  398. // Is libfftw installed, and where?
  399. #define FFTW_IPATH /usr/local/include
  400. #define FFTW_LPATH /usr/local/lib
  401. #define FFTW_LIBS rfftw fftw
  402. #defer HAVE_FFTW $[libtest $[FFTW_LPATH],$[FFTW_LIBS]]
  403. // Is Berkeley DB installed, and where? Presently, this is only used
  404. // for some applications (egg-optchar in particular) in Pandatool, and
  405. // it is completely optional there. If available, egg-optchar takes
  406. // advantage of it to allow the optimization of very large numbers of
  407. // models in one pass, that might otherwise exceed available memory.
  408. // Actually, this isn't even true anymore. At the time of this writing,
  409. // no system in Panda makes use of Berkeley DB. So don't bother to
  410. // define this.
  411. #define BDB_IPATH
  412. #define BDB_LPATH
  413. #define BDB_LIBS db db_cxx
  414. #defer HAVE_BDB $[libtest $[BDB_LPATH],$[BDB_LIBS]]
  415. // Is Cg installed, and where?
  416. #if $[WINDOWS_PLATFORM]
  417. #define CG_IPATH
  418. #define CG_LPATH
  419. #define CG_LIBS cg.lib
  420. #else
  421. #define CG_IPATH
  422. #define CG_LPATH
  423. #define CG_LIBS Cg
  424. #endif
  425. #defer HAVE_CG $[libtest $[CG_LPATH],$[CG_LIBS]]
  426. // Is CgGL installed, and where?
  427. #defer CGGL_IPATH $[CG_IPATH]
  428. #defer CGGL_LPATH $[CG_LPATH]
  429. #define CGGL_LIBS $[if $[WINDOWS_PLATFORM],cgGL.lib,CgGL]
  430. #defer HAVE_CGGL $[and $[HAVE_CG],$[libtest $[CGGL_LPATH],$[CGGL_LIBS]]]
  431. // Is CgDX8 installed, and where?
  432. #defer CGDX8_IPATH $[CG_IPATH]
  433. #defer CGDX8_LPATH $[CG_LPATH]
  434. #define CGDX8_LIBS $[if $[WINDOWS_PLATFORM],cgD3D8.lib,CgDX8]
  435. #defer HAVE_CGDX8 $[and $[HAVE_CG],$[libtest $[CGDX8_LPATH],$[CGDX8_LIBS]]]
  436. // Is CgDX9 installed, and where?
  437. #defer CGDX9_IPATH $[CG_IPATH]
  438. #defer CGDX9_LPATH $[CG_LPATH]
  439. #define CGDX9_LIBS $[if $[WINDOWS_PLATFORM],cgD3D9.lib,CgDX9]
  440. #defer HAVE_CGDX9 $[and $[HAVE_CG],$[libtest $[CGDX9_LPATH],$[CGDX9_LIBS]]]
  441. // Is CgDX10 installed, and where?
  442. #defer CGDX10_IPATH $[CG_IPATH]
  443. #defer CGDX10_LPATH $[CG_LPATH]
  444. #define CGDX10_LIBS $[if $[WINDOWS_PLATFORM],cgD3D10.lib,CgDX10]
  445. #defer HAVE_CGDX10 $[and $[HAVE_CG],$[libtest $[CGDX10_LPATH],$[CGDX10_LIBS]]]
  446. // Is VRPN installed, and where?
  447. #define VRPN_IPATH
  448. #define VRPN_LPATH
  449. #define VRPN_LIBS
  450. #defer HAVE_VRPN $[libtest $[VRPN_LPATH],$[VRPN_LIBS]]
  451. // Is HELIX installed, and where?
  452. #define HELIX_IPATH
  453. #define HELIX_LPATH
  454. #define HELIX_LIBS
  455. #defer HAVE_HELIX $[libtest $[HELIX_LPATH],$[HELIX_LIBS]]
  456. // Is ZLIB installed, and where?
  457. #define ZLIB_IPATH
  458. #define ZLIB_LPATH
  459. #define ZLIB_LIBS z
  460. #defer HAVE_ZLIB $[libtest $[ZLIB_LPATH],$[ZLIB_LIBS]]
  461. // Is OpenGL installed, and where? This should include libGL as well
  462. // as libGLU, if they are in different places.
  463. #defer GL_IPATH /usr/include
  464. #defer GL_LPATH
  465. #defer GL_LIBS
  466. #defer GLU_LIBS
  467. #if $[WINDOWS_PLATFORM]
  468. #define GL_LIBS opengl32.lib
  469. #define GLU_LIBS glu32.lib
  470. #elif $[OSX_PLATFORM]
  471. #defer GL_FRAMEWORK OpenGL
  472. #else
  473. #defer GL_LPATH /usr/X11R6/lib
  474. #defer GL_LIBS GL
  475. #defer GLU_LIBS GLU
  476. #endif
  477. #defer HAVE_GL $[libtest $[GL_LPATH],$[GL_LIBS]]
  478. // GLU is an auxiliary library that is usually provided with OpenGL,
  479. // but is sometimes missing (e.g. the default FC5 installation).
  480. #defer HAVE_GLU $[libtest $[GL_LPATH],$[GLU_LIBS]]
  481. // Is Mesa installed separately from OpenGL? Mesa is an open-source
  482. // software-only OpenGL renderer. Panda can link with it
  483. // independently from OpenGL (and if Mesa is built statically, and/or
  484. // with -DUSE_MGL_NAMESPACE declared to rename gl* to mgl*, it can
  485. // switch between the system OpenGL implementation and the Mesa
  486. // implementation at runtime).
  487. // Also, Mesa includes some core libraries (in libOSMesa.so) that
  488. // allow totally headless rendering, handy if you want to run a
  489. // renderer as a batch service, and you don't want to insist that a
  490. // user be logged on to the desktop or otherwise deal with X11 or
  491. // Windows.
  492. // If you define HAVE_MESA here, and the appropriate paths to headers
  493. // and libraries, then Panda will build libmesadisplay, which can be
  494. // used in lieu of libpandagl or libpandadx to do rendering. However,
  495. // for most applications, you don't need to do this, since (a) if you
  496. // have hardware rendering capability, you probably don't want to use
  497. // Mesa, since it's software-only, and (b) if you don't have hardware
  498. // rendering, you can install Mesa as the system's OpenGL
  499. // implementation, so you can just use the normal libpandagl. You
  500. // only need to define HAVE_MESA if you want to run totally headless,
  501. // or if you want to be able to easily switch between Mesa and the
  502. // system OpenGL implementation at runtime. If you compiled Mesa with
  503. // USE_MGL_NAMESPACE defined, define MESA_MGL here.
  504. #define MESA_IPATH
  505. #define MESA_LPATH
  506. #define MESA_LIBS
  507. #define MESA_MGL
  508. #defer HAVE_MESA $[libtest $[MESA_LPATH],$[MESA_LIBS]]
  509. // Is the Chromium remote-rendering library installed, and where?
  510. // This should include libcr_opengl32.
  511. #defer CHROMIUM_IPATH
  512. #defer CHROMIUM_LPATH
  513. #defer CHROMIUM_LIBS
  514. #defer HAVE_CHROMIUM $[libtest $[CHROMIUM_LPATH],$[CHROMIUM_LIBS]]
  515. // How about GLX?
  516. #define GLX_IPATH
  517. #define GLX_LPATH
  518. #defer HAVE_GLX $[and $[HAVE_GL],$[UNIX_PLATFORM]]
  519. // glXGetProcAddress() is the function used to query OpenGL extensions
  520. // under X. However, this function is itself an extension function,
  521. // leading to a chicken-and-egg problem. One approach is to compile
  522. // in a hard reference to the function, another is to pull the
  523. // function address from the dynamic runtime. Each has its share of
  524. // problems. Panda's default behavior is to pull it from the dynamic
  525. // runtime; define this to compile in a reference to the function.
  526. // This is only relevant from platforms using OpenGL under X (for
  527. // instance, Linux).
  528. #define LINK_IN_GLXGETPROCADDRESS
  529. // Should we try to build the WGL interface?
  530. #defer HAVE_WGL $[and $[HAVE_GL],$[WINDOWS_PLATFORM]]
  531. // Should we try to build the SGI-specific glxdisplay?
  532. #define HAVE_SGIGL $[eq $[PLATFORM],Irix]
  533. // Is DirectX8 available, and should we try to build with it?
  534. #define DX8_IPATH
  535. #define DX8_LPATH
  536. #define DX8_LIBS d3d8.lib d3dx8.lib dxerr8.lib
  537. #defer HAVE_DX8 $[libtest $[DX8_LPATH],$[DX8_LIBS]]
  538. // Is DirectX9 available, and should we try to build with it?
  539. #define DX9_IPATH
  540. #define DX9_LPATH
  541. #define DX9_LIBS d3d9.lib d3dx9.lib dxerr9.lib
  542. #defer HAVE_DX9 $[libtest $[DX9_LPATH],$[DX9_LIBS]]
  543. // Is OpenCV installed, and where?
  544. #define OPENCV_IPATH /usr/local/include/opencv
  545. #define OPENCV_LPATH /usr/local/lib
  546. #define OPENCV_LIBS $[if $[WINDOWS_PLATFORM],cv.lib highgui.lib cxcore.lib,cv highgui cxcore]
  547. #defer HAVE_OPENCV $[libtest $[OPENCV_LPATH],$[OPENCV_LIBS]]
  548. // Is FFMPEG installed, and where?
  549. #define FFMPEG_IPATH /usr/include/ffmpeg
  550. #define FFMPEG_LPATH
  551. #define FFMPEG_LIBS $[if $[WINDOWS_PLATFORM],libavcodec.lib libavformat.lib libavutil.lib libgcc.lib,avcodec avformat avutil]
  552. #defer HAVE_FFMPEG $[libtest $[FFMPEG_LPATH],$[FFMPEG_LIBS]]
  553. // Is ODE installed, and where?
  554. #define ODE_IPATH
  555. #define ODE_LPATH
  556. #define ODE_LIBS $[if $[WINDOWS_PLATFORM],ode.lib,ode]
  557. #defer HAVE_ODE $[libtest $[ODE_LPATH],$[ODE_LIBS]]
  558. // Do you want to build the DirectD tools for starting Panda clients
  559. // remotely? This only affects the direct tree. Enabling this may
  560. // cause libdirect.dll to fail to load on Win98 clients.
  561. #define HAVE_DIRECTD
  562. // If your system supports the Posix threads interface
  563. // (pthread_create(), etc.), define this true.
  564. #define HAVE_POSIX_THREADS $[and $[isfile /usr/include/pthread.h],$[not $[WINDOWS_PLATFORM]]]
  565. // If you're building for an i386 Linux machine, kernel version 2.6 or
  566. // higher, and you want to use native Linux threading operations
  567. // instead of Posix threads, define this. Warning: this is highly
  568. // experimental code, is likely to crash, and will probably be removed
  569. // in the future. Use Posix threads instead; they're much better.
  570. #define HAVE_LINUX_NATIVE_THREADS
  571. // Do you want to build in support for threading (multiprocessing)?
  572. // Building in support for threading will enable Panda to take
  573. // advantage of multiple CPU's if you have them (and if the OS
  574. // supports kernel threads running on different CPU's), but it will
  575. // slightly slow down Panda for the single CPU case, so this is not
  576. // enabled by default.
  577. // You should only turn this on if you have some threading library
  578. // available (most people will have one). Windows has one built-in.
  579. // Linux uses Posix threads, which most Linuxes provide.
  580. #define HAVE_THREADS
  581. #define THREADS_LIBS $[if $[not $[WINDOWS_PLATFORM]],pthread]
  582. // Whether threading is defined or not, you might want to validate the
  583. // thread and synchronization operations. With threading enabled,
  584. // defining this will also enable deadlock detection and logging.
  585. // Without threading enabled, defining this will simply verify that a
  586. // mutex is not recursively locked. There is, of course, additional
  587. // run-time overhead for these tests.
  588. #defer DEBUG_THREADS $[<= $[OPTIMIZE], 2]
  589. // Define this true to implement mutexes and condition variables via
  590. // user-space spinlocks, instead of via OS-provided constructs. This
  591. // is almost never a good idea, except possibly in very specialized
  592. // cases when you are building Panda for a particular application, on
  593. // a particular platform, and you are sure you won't have more threads
  594. // than CPU's. Even then, OS-based locking is probably better.
  595. #define MUTEX_SPINLOCK
  596. // Do you want to build the PStats interface, for graphical run-time
  597. // performance statistics? This requires NET to be available. By
  598. // default, we don't build PStats when OPTIMIZE = 4, although this is
  599. // possible.
  600. #defer DO_PSTATS $[or $[and $[HAVE_NET],$[< $[OPTIMIZE], 4]], $[DO_PSTATS]]
  601. // Do you want to type-check downcasts? This is a good idea during
  602. // development, but does impose some run-time overhead.
  603. #defer DO_DCAST $[< $[OPTIMIZE], 4]
  604. // Do you want to build the debugging tools for recording and
  605. // visualizing intersection tests by the collision system? Enabling
  606. // this increases runtime collision overhead just a tiny bit.
  607. #defer DO_COLLISION_RECORDING $[< $[OPTIMIZE], 4]
  608. // Do you want to include the "debug" and "spam" Notify messages?
  609. // Normally, these are stripped out when we build with OPTIMIZE = 4, but
  610. // sometimes it's useful to keep them around. Redefine this in your
  611. // own Config.pp to achieve that.
  612. #defer NOTIFY_DEBUG $[< $[OPTIMIZE], 4]
  613. // Do you want to build the audio interface?
  614. #define HAVE_AUDIO 1
  615. // The Tau profiler provides a multiplatform, thread-aware profiler.
  616. // To use it, define USE_TAU to 1, and set TAU_MAKEFILE to the
  617. // filename that contains the Tau-provided Makefile for your platform.
  618. // Then rebuild the code with ppremake; make install. Alternatively,
  619. // instead of setting TAU_MAKEFILE, you can also define TAU_ROOT and
  620. // PDT_ROOT, to point to the root directory of the tau and pdtoolkit
  621. // installations, respectively; then the individual Tau components
  622. // will be invoked directly. This is especially useful on Windows,
  623. // where there is no Tau Makefile.
  624. #define TAU_MAKEFILE
  625. #define TAU_ROOT
  626. #define PDT_ROOT
  627. #define TAU_OPTS -optKeepFiles
  628. #define TAU_CFLAGS -D_GNU_SOURCE
  629. #define USE_TAU
  630. // Info for the RAD game tools, Miles Sound System
  631. // note this may be overwritten in wintools Config.pp
  632. #define RAD_MSS_IPATH /usr/include/Miles6/include
  633. #define RAD_MSS_LPATH /usr/lib/Miles6/lib/win
  634. #define RAD_MSS_LIBS Mss32
  635. #defer HAVE_RAD_MSS $[libtest $[RAD_MSS_LPATH],$[RAD_MSS_LIBS]]
  636. // Info for the Fmod audio engine
  637. // note this may be overwritten in wintools Config.pp
  638. #define FMODEX_IPATH /usr/local/fmod/api/inc
  639. #define FMODEX_LPATH /usr/local/fmod/api/lib
  640. #define FMODEX_LIBS fmodex
  641. #defer HAVE_FMODEX $[libtest $[FMODEX_LPATH],$[FMODEX_LIBS]]
  642. // Info for http://www.sourceforge.net/projects/chromium
  643. // note this may be overwritten in wintools Config.pp
  644. #define CHROMIUM_IPATH /usr/include/chromium/include
  645. #define CHROMIUM_LPATH /usr/lib/chromium/bin/WINT_NT
  646. #define CHROMIUM_LIBS spuload
  647. #defer HAVE_CHROMIUM $[libtest $[CHROMIUM_LPATH],$[CHROMIUM_LIBS]]
  648. // Is gtk+-2 installed? This is only needed to build the pstats
  649. // program on Unix (or non-Windows) platforms.
  650. #define PKG_CONFIG pkg-config
  651. #define HAVE_GTK
  652. // Do we have Freetype 2.0 (or better)? If available, this package is
  653. // used to generate dynamic in-the-world text from font files.
  654. // On Unix, freetype comes with the freetype-config executable, which
  655. // tells us where to look for the various files. On Windows, we need to
  656. // supply this information explicitly.
  657. #defer FREETYPE_CONFIG $[if $[not $[WINDOWS_PLATFORM]],freetype-config]
  658. #defer HAVE_FREETYPE $[or $[libtest $[FREETYPE_LPATH],$[FREETYPE_LIBS]],$[bintest $[FREETYPE_CONFIG]]]
  659. #define FREETYPE_CFLAGS
  660. #define FREETYPE_IPATH
  661. #define FREETYPE_LPATH
  662. #define FREETYPE_LIBS
  663. // Define this true to compile in a default font, so every TextNode
  664. // will always have a font available without requiring the user to
  665. // specify one. Define it empty not to do this, saving a few
  666. // kilobytes on the generated library. Sorry, you can't pick a
  667. // particular font to be the default; it's hardcoded in the source
  668. // (although you can use the text-default-font prc variable to specify
  669. // a particular font file to load as the default, overriding the
  670. // compiled-in font).
  671. #define COMPILE_IN_DEFAULT_FONT 1
  672. // Is Maya installed? This matters only to programs in PANDATOOL.
  673. // Also, as of Maya 5.0 it seems the Maya library will not compile
  674. // properly with optimize level 4 set (we get link errors with ostream).
  675. #define MAYA_LOCATION /usr/aw/maya
  676. #defer MAYA_LIBS $[if $[WINDOWS_PLATFORM],Foundation.lib OpenMaya.lib OpenMayaAnim.lib OpenMayaUI.lib,Foundation OpenMaya OpenMayaAnim OpenMayaUI]
  677. // Optionally define this to the value of LM_LICENSE_FILE that should
  678. // be set before invoking Maya.
  679. #define MAYA_LICENSE_FILE
  680. #defer HAVE_MAYA $[and $[<= $[OPTIMIZE], 3],$[isdir $[MAYA_LOCATION]/include/maya]]
  681. // Define this if your version of Maya is earlier than 5.0 (e.g. Maya 4.5).
  682. #define MAYA_PRE_5_0
  683. // In the same fashion as mayaegg converter above, set softimage to egg converter as well
  684. #define SOFTIMAGE_LOCATION /c/Softimage/sdk_18sp2/SDK_1.8SP2/SAAPHIRE
  685. #defer SOFTIMAGE_LIBS SAA.lib
  686. #defer HAVE_SOFTIMAGE $[isdir $[SOFTIMAGE_LOCATION]/h]
  687. // Define this to generate static libraries and executables, rather than
  688. // dynamic libraries.
  689. //#define LINK_ALL_STATIC yes
  690. // Define this to export the templates from the DLL. This is only
  691. // meaningful if LINK_ALL_STATIC is not defined, and we are building
  692. // on Windows. Some Windows compilers may not support this syntax.
  693. #defer EXPORT_TEMPLATES yes
  694. // Define this to explicitly link in the various external drivers, which
  695. // are normally separate, as part of the Panda library.
  696. //#define LINK_IN_GL yes
  697. //#define LINK_IN_DX yes
  698. //#define LINK_IN_EGG yes
  699. //#define LINK_IN_PHYSICS yes
  700. // Define USE_COMPILER to switch the particular compiler that should
  701. // be used. A handful of tokens are recognized, depending on BUILD_TYPE.
  702. // This may also be further customized within Global.$[BUILD_TYPE].pp.
  703. // If BUILD_TYPE is "unix", this may be one of:
  704. // GCC (gcc/g++)
  705. // MIPS (Irix MIPSPro compiler)
  706. //
  707. // If BUILD_TYPE is "msvc" or "gmsvc", this may be one of:
  708. // MSVC (Microsoft Visual C++ 6.0)
  709. // MSVC7 (Microsoft Visual C++ 7.0)
  710. // BOUNDS (BoundsChecker)
  711. // INTEL (Intel C/C++ compiler)
  712. #if $[WINDOWS_PLATFORM]
  713. #if $[eq $[USE_COMPILER],]
  714. #define USE_COMPILER MSVC7
  715. #endif
  716. #elif $[eq $[PLATFORM], Irix]
  717. #define USE_COMPILER MIPS
  718. #elif $[eq $[PLATFORM], Linux]
  719. #define USE_COMPILER GCC
  720. #elif $[OSX_PLATFORM]
  721. #define USE_COMPILER GCC
  722. #elif $[eq $[PLATFORM], FreeBSD]
  723. #define USE_COMPILER GCC
  724. #endif
  725. // Permission masks to install data and executable files,
  726. // respectively. This is only meaningful for Unix systems.
  727. #define INSTALL_UMASK_DATA 644
  728. #define INSTALL_UMASK_PROG 755
  729. // How to invoke bison and flex. Panda takes advantage of some
  730. // bison/flex features, and therefore specifically requires bison and
  731. // flex, not some other versions of yacc and lex. However, you only
  732. // need to have these programs if you need to make changes to the
  733. // bison or flex sources (see the next point, below).
  734. #defer BISON bison
  735. #defer FLEX flex
  736. // You may not even have bison and flex installed. If you don't, no
  737. // sweat; Panda ships with the pre-generated output of these programs,
  738. // so you don't need them unless you want to make changes to the
  739. // grammars themselves (files named *.yxx or *.lxx).
  740. #defer HAVE_BISON $[bintest $[BISON]]
  741. // How to invoke sed. A handful of make rules use this. Since some
  742. // platforms (specifically, non-Unix platforms like Windows) don't
  743. // have any kind of sed, ppremake performs some limited sed-like
  744. // functions. The default is to use ppremake in this capacity. In
  745. // this variable, $[source] is the name of the file to read, $[target]
  746. // is the name of the file to generate, and $[script] is the one-line
  747. // sed script to run.
  748. #defer SED ppremake -s "$[script]" <$[source] >$[target]
  749. // What directory name (within each source directory) should the .o
  750. // (or .obj) files be written to? This can be any name, and it can be
  751. // used to differentiate different builds within the same tree.
  752. // However, don't define this to be '.', or you will be very sad the
  753. // next time you run 'make clean'.
  754. //#defer ODIR Opt$[OPTIMIZE]-$[PLATFORM]$[USE_COMPILER]
  755. // ODIR_SUFFIX is optional, usually empty
  756. #defer ODIR Opt$[OPTIMIZE]-$[PLATFORM]$[ODIR_SUFFIX]
  757. // What is the normal extension of a compiled object file?
  758. #if $[WINDOWS_PLATFORM]
  759. #define OBJ .obj
  760. #else
  761. #define OBJ .o
  762. #endif
  763. ///////////////////////////////////////////////////////////////////////
  764. // The following variables are only meaningful when BUILD_TYPE is
  765. // "unix". These define the commands to invoke the compiler, linker,
  766. // etc.
  767. //////////////////////////////////////////////////////////////////////
  768. // How to invoke the C and C++ compilers.
  769. #if $[eq $[USE_COMPILER], GCC]
  770. #define CC gcc
  771. #define CXX g++
  772. // gcc might run into template limits on some parts of Panda.
  773. // I upped this from 25 to build on OS X (GCC 3.3) -- skyler.
  774. #define C++FLAGS_GEN -ftemplate-depth-30
  775. #else
  776. #define CC cc
  777. #define CXX CC
  778. #endif
  779. // Configure for universal binaries on OSX.
  780. #defer ARCH_FLAGS $[if $[and $[OSX_PLATFORM],$[UNIVERSAL_BINARIES]],-arch i386 -arch ppc,]
  781. // How to compile a C or C++ file into a .o file. $[target] is the
  782. // name of the .o file, $[source] is the name of the source file,
  783. // $[ipath] is a space-separated list of directories to search for
  784. // include files, and $[flags] is a list of additional flags to pass
  785. // to the compiler.
  786. #defer COMPILE_C $[CC] $[CFLAGS_GEN] $[ARCH_FLAGS] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
  787. #defer COMPILE_C++ $[CXX] $[C++FLAGS_GEN] $[ARCH_FLAGS] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
  788. // What flags should be passed to both C and C++ compilers to enable
  789. // debug symbols? This will be supplied when OPTIMIZE (above) is set
  790. // to 1, 2, or 3.
  791. #defer DEBUGFLAGS -g
  792. // What flags should be passed to both C and C++ compilers to enable
  793. // compiler optimizations? This will be supplied when OPTIMIZE
  794. // (above) is set to 2, 3, or 4.
  795. #defer OPTFLAGS -O2
  796. // What define variables should be passed to the compilers for each
  797. // value of OPTIMIZE? We separate this so we can pass these same
  798. // options to interrogate, guaranteeing that the correct interfaces
  799. // are generated. Do not include -D here; that will be supplied
  800. // automatically.
  801. #defer CDEFINES_OPT1 _DEBUG $[EXTRA_CDEFS]
  802. #defer CDEFINES_OPT2 _DEBUG $[EXTRA_CDEFS]
  803. #defer CDEFINES_OPT3 $[EXTRA_CDEFS]
  804. #defer CDEFINES_OPT4 NDEBUG $[EXTRA_CDEFS]
  805. // What additional flags should be passed for each value of OPTIMIZE
  806. // (above)? We separate out the compiler-optimization flags, above,
  807. // so we can compile certain files that give optimizers trouble (like
  808. // the output of lex and yacc) without them, but with all the other
  809. // relevant flags.
  810. #defer CFLAGS_OPT1 $[CDEFINES_OPT1:%=-D%] -Wall $[DEBUGFLAGS]
  811. #defer CFLAGS_OPT2 $[CDEFINES_OPT2:%=-D%] -Wall $[DEBUGFLAGS] $[OPTFLAGS]
  812. #defer CFLAGS_OPT3 $[CDEFINES_OPT3:%=-D%] $[DEBUGFLAGS] $[OPTFLAGS]
  813. #defer CFLAGS_OPT4 $[CDEFINES_OPT4:%=-D%] $[OPTFLAGS]
  814. // What additional flags should be passed to both compilers when
  815. // building shared (relocatable) sources? Some architectures require
  816. // special support for this.
  817. #defer CFLAGS_SHARED -fPIC
  818. // How to generate a C or C++ executable from a collection of .o
  819. // files. $[target] is the name of the binary to generate, and
  820. // $[sources] is the list of .o files. $[libs] is a space-separated
  821. // list of dependent libraries, and $[lpath] is a space-separated list
  822. // of directories in which those libraries can be found.
  823. #defer LINK_BIN_C $[cc_ld] $[ARCH_FLAGS] -o $[target] $[sources] $[flags] $[lpath:%=-L%] $[libs:%=-l%]\
  824. $[fpath:%=-Wl,-F%] $[patsubst %,-framework %, $[bin_frameworks]]
  825. #defer LINK_BIN_C++ $[cxx_ld] $[ARCH_FLAGS] \
  826. -o $[target] $[sources]\
  827. $[flags]\
  828. $[lpath:%=-L%] $[libs:%=-l%]\
  829. $[fpath:%=-Wl,-F%] $[patsubst %,-framework %, $[bin_frameworks]]
  830. // How to generate a static C or C++ library. $[target] is the
  831. // name of the library to generate, and $[sources] is the list of .o
  832. // files that will go into the library.
  833. #if $[OSX_PLATFORM]
  834. #defer STATIC_LIB_C libtool -static -o $[target] $[sources]
  835. #defer STATIC_LIB_C++ libtool -static -o $[target] $[sources]
  836. //#elif $[eq $[PLATFORM], FreeBSD]
  837. // #defer STATIC_LIB_C libtool --mode=link -static -o $[target] $[sources]
  838. // #defer STATIC_LIB_C++ libtool --mode=link -static -o $[target] $[sources]
  839. #else
  840. #defer STATIC_LIB_C ar cru $[target] $[sources]
  841. #defer STATIC_LIB_C++ ar cru $[target] $[sources]
  842. #endif
  843. // How to run ranlib, if necessary, after generating a static library.
  844. // $[target] is the name of the library. Set this to the empty string
  845. // if ranlib is not necessary on your platform.
  846. #defer RANLIB ranlib $[target]
  847. // Where to put the so_locations file, used by an Irix MIPSPro
  848. // compiler, to generate a map of shared library memory locations.
  849. #defer SO_LOCATIONS $[DTOOL_INSTALL]/etc/so_locations
  850. // How to generate a shared C or C++ library. $[source] and $[target]
  851. // as above, and $[libs] is a space-separated list of dependent
  852. // libraries, and $[lpath] is a space-separated list of directories in
  853. // which those libraries can be found.
  854. #if $[OSX_PLATFORM]
  855. #defer SHARED_LIB_C $[cc_ld] $[ARCH_FLAGS] -o $[target] -install_name $[notdir $[target]] $[sources] $[lpath:%=-L%] $[libs:%=-l%] $[patsubst %,-framework %, $[frameworks]]
  856. #defer SHARED_LIB_C++ $[cxx_ld] $[ARCH_FLAGS] -undefined dynamic_lookup -dynamic -dynamiclib -o $[target] -install_name $[notdir $[target]] $[sources] $[lpath:%=-L%] $[libs:%=-l%] $[patsubst %,-framework %, $[frameworks]]
  857. #defer BUNDLE_LIB_C++ $[cxx_ld] $[ARCH_FLAGS] -undefined dynamic_lookup -bundle -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%] $[patsubst %,-framework %, $[frameworks]]
  858. #else
  859. #defer SHARED_LIB_C $[cc_ld] -shared $[LFLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  860. #defer SHARED_LIB_C++ $[cxx_ld] -shared $[LFLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  861. #define BUNDLE_LIB_C++
  862. #endif
  863. // How to install a data file or executable file. $[local] is the
  864. // local name of the file to install, and $[dest] is the name of the
  865. // directory to put it in.
  866. // On Unix systems, we strongly prefer using the install program to
  867. // install files. This has nice features like automatically setting
  868. // the permissions bits, and also is usually clever enough to install
  869. // a running program without crashing the running instance. However,
  870. // it doesn't understanding installing a program from a subdirectory,
  871. // so we have to cd into the source directory first.
  872. #defer install_dash_p $[if $[KEEP_TIMESTAMPS],-p,]
  873. #defer INSTALL $[if $[ne $[dir $[local]], ./],cd ./$[dir $[local]] &&] install -m $[INSTALL_UMASK_DATA] $[install_dash_p] $[notdir $[local]] $[dest]/
  874. #defer INSTALL_PROG $[if $[ne $[dir $[local]], ./],cd ./$[dir $[local]] &&] install -m $[INSTALL_UMASK_PROG] $[install_dash_p] $[notdir $[local]] $[dest]/
  875. // Variable definitions for building with the Irix MIPSPro compiler.
  876. #if $[eq $[USE_COMPILER], MIPS]
  877. #define CC cc -n32 -mips3
  878. #define CXX CC -n32 -mips3
  879. // Turn off a few annoying warning messages.
  880. // 1174 - function 'blah' was declared but never used
  881. // 1201 - trailing comma is nonstandard.
  882. // 1209 - controlling expression is constant, e.g. if (0) { ... }
  883. // 1234 - access control not specified, 'public' by default
  884. // 1355 - extra ";" ignored
  885. // 1375 - destructor for base class is not virtual.
  886. // this one actually is bad. But we got alot of them from the classes
  887. // that we've derived from STL collections. Beware of this.
  888. // 3322 - omission of explicit type is nonstandard ("int" assumed)
  889. #define WOFF_LIST -woff 1174,1201,1209,1234,1355,1375,3322
  890. // Linker warnings
  891. // 85 - definition of SOMESYMBOL in SOMELIB preempts that of definition in
  892. // SOMEOTHERLIB.
  893. #define WOFF_LIST $[WOFF_LIST] -Wl,-LD_MSG:off=85
  894. #defer OPTFLAGS -O2 -OPT:Olimit=2500
  895. #defer CFLAGS_OPT1 $[CDEFINES_OPT1:%=-D%] $[WOFF_LIST] -g
  896. #defer CFLAGS_OPT2 $[CDEFINES_OPT2:%=-D%] $[WOFF_LIST]
  897. #defer CFLAGS_OPT3 $[CDEFINES_OPT3:%=-D%] $[WOFF_LIST]
  898. #defer CFLAGS_OPT4 $[CDEFINES_OPT4:%=-D%] $[WOFF_LIST]
  899. #defer CFLAGS_SHARED
  900. #defer STATIC_LIB_C $[CC] -ar -o $[target] $[sources]
  901. #defer STATIC_LIB_C++ $[CXX] -ar -o $[target] $[sources]
  902. #defer RANLIB
  903. #defer SHARED_FLAGS -Wl,-none -Wl,-update_registry,$[SO_LOCATIONS]
  904. #defer SHARED_LIB_C $[cc_ld] -shared $[SHARED_FLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  905. #defer SHARED_LIB_C++ $[cxx_ld] -shared $[SHARED_FLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  906. #endif
  907. //////////////////////////////////////////////////////////////////////
  908. // There are also some additional variables that control specific
  909. // compiler/platform features or characteristics, defined in the
  910. // platform specific file Config.platform.pp. Be sure to inspect
  911. // these variables for correctness too.
  912. //////////////////////////////////////////////////////////////////////