2
0

Config.pp 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. //
  2. // 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. // ppremake is capable of generating makefiles for Unix compilers such
  10. // as gcc or SGI's MipsPRO compiler, as well as for Windows
  11. // environments like Microsoft's Visual C++. It can also,
  12. // potentially, generate Microsoft Developer's Studio project files
  13. // directly, although we haven't written the scripts to do this yet.
  14. // In principle, it can be extended to generate suitable build script
  15. // files for any number of different build environments.
  16. //
  17. // All of these build scripts can be tuned for a particular
  18. // environment via this file. This is the place for the user to
  19. // specify which external packages are installed and where, or to
  20. // enable or disable certain optional features. However, it is
  21. // suggested that rather than modify this file directly, you create a
  22. // custom file in your home directory and there redefine whatever
  23. // variables are appropriate, and set the environment variable
  24. // PPREMAKE_CONFIG to refer to it. In this way, you can easily get an
  25. // updated source tree (including a new Config.pp) without risking
  26. // accidentally losing your customizations. This also avoids having
  27. // to redefine the same variables in different packages (for instance,
  28. // in dtool and in panda).
  29. //
  30. // The syntax in this file resembles some hybrid between C++
  31. // preprocessor declarations and GNU make variables. This is the same
  32. // syntax used in the various ppremake system configure files; it's
  33. // designed to be easy to use as a macro language to generate
  34. // makefiles and their ilk.
  35. //
  36. // Some of the variables below are defined using the #define command,
  37. // and others are defined using #defer. The two are very similar in
  38. // their purpose; the difference is that, if the variable definition
  39. // includes references to other variables (e.g. $[varname]), then
  40. // #define will evaluate all of the other variable references
  41. // immediately and store the resulting expansion, while #defer will
  42. // store only the variable references themselves, and expand them when
  43. // the variable is later referenced. It is very similar to the
  44. // relationship between := and = in GNU Make.
  45. //
  46. // In general, #defer is used in this file, to allow the user to
  47. // redefine critical variables in his or her own Config.pp file.
  48. // What kind of build scripts are we generating? This selects a
  49. // suitable template file from the ppremake system files. The
  50. // allowable choices, at present, are:
  51. //
  52. // unix - Generate makefiles suitable for most Unix platforms.
  53. // msvc - Generate Visual C++ project files (still a work in progress)
  54. // gmsvc - Generate makefiles similar to the above, using Microsoft
  55. // Visual C++, but uses the Cygwin-supplied GNU make
  56. // instead of Microsoft nmake. This is potentially
  57. // faster if you have multiple CPU's, since it supports
  58. // distributed make. It's a tiny bit slower if you're
  59. // not taking advantage of distributed make, because of
  60. // the overhead associated with Cygwin fork() calls.
  61. #if $[eq $[PLATFORM], Win32]
  62. // #define BUILD_TYPE msvc // not ready yet.
  63. #define BUILD_TYPE gmsvc
  64. #elif $[eq $[PLATFORM], Cygwin]
  65. #define BUILD_TYPE gmsvc
  66. #else
  67. #define BUILD_TYPE unix
  68. #endif
  69. // What is the default install directory for all trees in the Panda
  70. // suite? You may also override this for a particular tree by
  71. // defining a variable name like DTOOL_INSTALL or PANDA_INSTALL. This
  72. // variable will have no effect when you are using the cttools to
  73. // control your attachment to the trees; in this case, the install
  74. // directory for each tree will by default be the root of the tree
  75. // itself (although this may be overridden).
  76. #define INSTALL_DIR /usr/local/panda
  77. // What level of compiler optimization/debug symbols should we build?
  78. // The various optimize levels are defined as follows:
  79. //
  80. // 1 - No compiler optimizations, full debug symbols
  81. // 2 - Full compiler optimizations, full debug symbols
  82. // (if the compiler supports this)
  83. // 3 - Full compiler optimizations, no debug symbols
  84. // 4 - Full optimizations, no debug symbols, and asserts removed
  85. //
  86. #define OPTIMIZE 3
  87. // NOTE: In the following, to indicate "yes" to a yes/no question,
  88. // define the variable to be a nonempty string. To indicate "no",
  89. // define the variable to be an empty string.
  90. // Many of the HAVE_* variables are defined in terms of expressions
  91. // based on the paths and library names, etc., defined above. These
  92. // are defined using the "defer" command, so that they are not
  93. // evaluated right away, giving the user an opportunity to redefine
  94. // the variables they depend on, or to redefine the HAVE_* variables
  95. // themselves (you can explicitly define a HAVE_* variable to some
  96. // nonempty string to force the package to be marked as installed).
  97. // Do you want to generate a Python-callable interrogate interface?
  98. // This is only necessary if you plan to make calls into Panda from a
  99. // program written in Python. This is done only if HAVE_PYTHON,
  100. // below, is also true.
  101. #define INTERROGATE_PYTHON_INTERFACE 1
  102. // Do you want to generate a C-callable interrogate interface? This
  103. // generates an interface similar to the Python interface above, with
  104. // a C calling convention. It should be useful for most other kinds
  105. // of scripting language; the VR Studio used to use this to make calls
  106. // into Panda from Squeak. This is not presently used by any VR
  107. // Studio code.
  108. #define INTERROGATE_C_INTERFACE
  109. // Do you even want to build interrogate at all? This is the program
  110. // that reads our C++ source files and generates one of the above
  111. // interfaces. If you won't be building the interfaces, you don't
  112. // need the program.
  113. #defer HAVE_INTERROGATE $[or $[INTERROGATE_PYTHON_INTERFACE],$[INTERROGATE_C_INTERFACE]]
  114. // What additional options should be passed to interrogate when
  115. // generating either of the above two interfaces? Generally, you
  116. // probably don't want to mess with this.
  117. #define INTERROGATE_OPTIONS -fnames -string -refcount -assert
  118. // What's the name of the interrogate binary to run? The default
  119. // specified is the one that is built as part of DTOOL. If you have a
  120. // prebuilt binary standing by (for instance, one built opt4), specify
  121. // its name instead.
  122. #define INTERROGATE interrogate
  123. #define INTERROGATE_MODULE interrogate_module
  124. // Is Python installed, and should Python interfaces be generated? If
  125. // Python is installed, which directory is it in? (If the directory
  126. // is someplace standard like /usr/include, you may leave it blank.)
  127. #define PYTHON_IPATH /usr/local/include/python1.6
  128. #define PYTHON_LPATH
  129. #defer HAVE_PYTHON $[isdir $[PYTHON_IPATH]]
  130. // Do you want to enable the "in_interpreter" global variable? This
  131. // will enable some callbacks, particularly the MemoryUsage object, to
  132. // know whether they were called from Python code (or other high-level
  133. // show code) and react accordingly, generally for debugging
  134. // purporses. It adds a bit of runtime overhead, and isn't usually
  135. // useful unless we're building a debug tree anyway. The default is
  136. // to enable it only for optimize levels 1 and 2.
  137. #defer TRACK_IN_INTERPRETER $[<= $[OPTIMIZE], 2]
  138. // Do you want to compile in support for tracking memory usage? This
  139. // enables you to define the variable "track-memory-usage" at runtime
  140. // to help track memory leaks, and also report total memory usage on
  141. // PStats. There is some small overhead for having this ability
  142. // available, even if it is unused.
  143. #defer DO_MEMORY_USAGE $[<= $[OPTIMIZE], 3]
  144. // Do you want to compile in support for pipelining? This enables
  145. // setting and accessing multiple different copies of frame-specific
  146. // data stored in nodes, etc. At the moment, Panda cannot actually
  147. // take advantage of this support to do anything useful, but
  148. // eventually this will enable multi-stage pipelining of the render
  149. // process, as well as potentially remote rendering using a
  150. // distributed scene graph. For now, we enable this when building
  151. // optimize 1 only, since turning this on does perform some additional
  152. // sanity checks, but doesn't do anything else useful other than
  153. // increase run-time overhead.
  154. #defer DO_PIPELINING $[<= $[OPTIMIZE], 1]
  155. // Is NSPR installed, and where? This is the Netscape Portable
  156. // Runtime library, downloadable as part of the Mozilla package from
  157. // mozilla.org. It provides portable threading and networking
  158. // services to Panda. Panda should compile without it, although
  159. // without any threading or networking capabilities; eventually,
  160. // native support for these capabilities may be added for certain
  161. // platforms. See also HAVE_IPC and HAVE_NET.
  162. #define NSPR_IPATH /usr/include/nspr
  163. #define NSPR_LPATH
  164. #define NSPR_LIBS nspr4
  165. #defer HAVE_NSPR $[libtest $[NSPR_LPATH],$[NSPR_LIBS]]
  166. // Is a third-party STL library installed, and where? This is only
  167. // necessary if the default include and link lines that come with the
  168. // compiler don't provide adequate STL support. At least some form of
  169. // STL is absolutely required in order to build Panda.
  170. #define STL_IPATH
  171. #define STL_LPATH
  172. #define STL_CFLAGS
  173. #define STL_LIBS
  174. // Is OpenSSL installed, and where?
  175. #define SSL_IPATH /usr/local/ssl/include
  176. #define SSL_LPATH /usr/local/ssl/lib
  177. #define SSL_LIBS ssl crypto
  178. #defer HAVE_SSL $[libtest $[SSL_LPATH],$[SSL_LIBS]]
  179. // Define this nonempty if your version of OpenSSL is 0.9.7 or better.
  180. #define SSL_097
  181. // Define this true to include the OpenSSL code to report verbose
  182. // error messages when they occur.
  183. #defer REPORT_OPENSSL_ERRORS $[< $[OPTIMIZE], 4]
  184. // Is Crypto++ installed, and where?
  185. #define CRYPTO_IPATH /usr/include/crypto++
  186. #define CRYPTO_LPATH /usr/lib
  187. #define CRYPTO_LIBS cryptlib
  188. #defer HAVE_CRYPTO $[libtest $[CRYPTO_LPATH],$[CRYPTO_LIBS]]
  189. // Is libjpeg installed, and where?
  190. #define JPEG_IPATH
  191. #define JPEG_LPATH
  192. #define JPEG_LIBS jpeg
  193. #defer HAVE_JPEG $[libtest $[JPEG_LPATH],$[JPEG_LIBS]]
  194. // Is libjasper installed, and where?
  195. #define JPEG2000_IPATH
  196. #define JPEG2000_LPATH
  197. #define JPEG2000_LIBS jasper
  198. #defer HAVE_JPEG2000 $[libtest $[JPEG2000_LPATH],$[JPEG2000_LIBS]]
  199. // Is libtiff installed, and where?
  200. #define TIFF_IPATH
  201. #define TIFF_LPATH
  202. #define TIFF_LIBS tiff
  203. #defer HAVE_TIFF $[libtest $[TIFF_LPATH],$[TIFF_LIBS]]
  204. // Is libfftw installed, and where?
  205. #define FFTW_IPATH /usr/local/include
  206. #define FFTW_LPATH /usr/local/lib
  207. #define FFTW_LIBS rfftw fftw
  208. #defer HAVE_FFTW $[libtest $[FFTW_LPATH],$[FFTW_LIBS]]
  209. // Is NURBS++ installed, and where?
  210. #define NURBSPP_IPATH /usr/local/include/nurbs++
  211. #define NURBSPP_LPATH /usr/local/lib
  212. #define NURBSPP_LIBS nurbsf matrixN matrixI matrix
  213. #defer HAVE_NURBSPP $[libtest $[NURBSPP_LPATH],$[NURBSPP_LIBS]]
  214. // Is VRPN installed, and where?
  215. #define VRPN_IPATH
  216. #define VRPN_LPATH
  217. #define VRPN_LIBS
  218. #defer HAVE_VRPN $[libtest $[VRPN_LPATH],$[VRPN_LIBS]]
  219. // Is ZLIB installed, and where?
  220. #define ZLIB_IPATH
  221. #define ZLIB_LPATH
  222. #define ZLIB_LIBS z
  223. #defer HAVE_ZLIB $[libtest $[ZLIB_LPATH],$[ZLIB_LIBS]]
  224. // Is the sox libst library installed, and where?
  225. #define SOXST_IPATH
  226. #define SOXST_LPATH
  227. #define SOXST_LIBS st
  228. #defer HAVE_SOXST $[libtest $[SOXST_LPATH],$[SOXST_LIBS]]
  229. // Is OpenGL installed, and where? This should include libGL as well
  230. // as libGLU, if they are in different places.
  231. #if $[WINDOWS_PLATFORM]
  232. #defer GL_IPATH
  233. #defer GL_LPATH
  234. #define GL_LIBS opengl32.lib glu32.lib
  235. #else
  236. #defer GL_IPATH
  237. #defer GL_LPATH /usr/X11R6/lib
  238. #defer GL_LIBS GL GLU
  239. #endif
  240. #defer HAVE_GL $[libtest $[GL_LPATH],$[GL_LIBS]]
  241. // Is Chromium OpenGL installed, and where? This should include libcr_opengl32.
  242. #defer CHROMIUM_IPATH
  243. #defer CHROMIUM_LPATH /usr/X11R6/lib
  244. #defer GL_LIBS GL GLU
  245. #defer HAVE_CHROMIUM $[libtest $[CHROMIUM_LPATH],$[CHROMIUM_LIBS]]
  246. // Should we try to build the WCR interface?
  247. #define HAVE_WCR $[and $[HAVE_CHROMIUM], $[WINDOWS_PLATFORM]]
  248. // How about GLX?
  249. #define GLX_IPATH
  250. #define GLX_LPATH
  251. #defer HAVE_GLX $[and $[HAVE_GL],$[UNIX_PLATFORM]]
  252. // Glut?
  253. #define GLUT_IPATH
  254. #define GLUT_LPATH
  255. #define GLUT_LIBS glut
  256. //#defer HAVE_GLUT $[libtest $[GLUT_LPATH],$[GLUT_LIBS]]
  257. // For now, glut is broken. Don't even try to build it.
  258. #define HAVE_GLUT
  259. // Should we try to build the WGL interface?
  260. #defer HAVE_WGL $[and $[HAVE_GL],$[WINDOWS_PLATFORM]]
  261. // Should we try to build the SGI-specific glxdisplay?
  262. #define HAVE_SGIGL $[eq $[PLATFORM],Irix]
  263. // Is DirectX available, and should we try to build with it?
  264. #define DX_IPATH
  265. #define DX_LPATH
  266. #define DX_LIBS d3d8.lib d3dx8.lib dxerr8.lib
  267. #defer HAVE_DX $[libtest $[DX_LPATH],$[DX_LIBS]]
  268. // Do you want to build the Renderman interface?
  269. #define HAVE_RIB
  270. // Do you want to build the DirectD tools for starting Panda clients
  271. // remotely? This only affects the direct tree. Enabling this may
  272. // cause libdirect.dll to fail to load on Win98 clients.
  273. #define HAVE_DIRECTD
  274. // Is Mikmod installed? How should we run the libmikmod-config program?
  275. #define MIKMOD_CONFIG libmikmod-config
  276. #defer HAVE_MIKMOD $[bintest $[MIKMOD_CONFIG]]
  277. // Do you want to build in support for threading (multiprocessing)?
  278. // Building in support for threading will enable Panda to take
  279. // advantage of multiple CPU's if you have them (and if the OS
  280. // supports kernel threads running on different CPU's), but it will
  281. // slightly slow down Panda for the single CPU case, so this is not
  282. // enabled by default.
  283. // Currently, threading support requires NSPR, so you should not
  284. // define this true unless you have NSPR installed.
  285. #define HAVE_THREADS
  286. // Do you want to build the network interface? What additional libraries
  287. // are required? Currently, this requires NSPR.
  288. #define NET_IPATH
  289. #define NET_LPATH
  290. #if $[WINDOWS_PLATFORM]
  291. #define NET_LIBS wsock32.lib
  292. #else
  293. #define NET_LIBS
  294. #endif
  295. #defer HAVE_NET $[HAVE_NSPR]
  296. // Do you want to build the PStats interface, for graphical run-time
  297. // performance statistics? This requires NET to be available. By
  298. // default, we don't build PStats when OPTIMIZE = 4, although this is
  299. // possible.
  300. #defer DO_PSTATS $[or $[and $[HAVE_NET],$[< $[OPTIMIZE], 4]], $[DO_PSTATS]]
  301. // Do you want to build the debugging tools for recording and
  302. // visualizing intersection tests by the collision system? Enabling
  303. // this increases runtime collision overhead just a tiny bit.
  304. #defer DO_COLLISION_RECORDING $[< $[OPTIMIZE], 4]
  305. // Do you want to include the "debug" and "spam" Notify messages?
  306. // Normally, these are stripped out when we build with OPTIMIZE = 4, but
  307. // sometimes it's useful to keep them around. Redefine this in your
  308. // own Config.pp to achieve that.
  309. #defer NOTIFY_DEBUG $[< $[OPTIMIZE], 4]
  310. // Do you want to build the audio interface?
  311. #define HAVE_AUDIO 1
  312. // Info for the RAD game tools, Miles Sound System
  313. // note this may be overwritten in wintools Config.pp
  314. #define RAD_MSS_IPATH /usr/include/Miles6/include
  315. #define RAD_MSS_LPATH /usr/lib/Miles6/lib/win
  316. #define RAD_MSS_LIBS Mss32
  317. #defer HAVE_RAD_MSS $[libtest $[RAD_MSS_LPATH],$[RAD_MSS_LIBS]]
  318. // Info for the Fmod audio engine
  319. // note this may be overwritten in wintools Config.pp
  320. #define FMOD_IPATH
  321. #define FMOD_LPATH
  322. #define FMOD_LIBS fmod
  323. #defer HAVE_FMOD $[libtest $[FMOD_LPATH],$[FMOD_LIBS]]
  324. // Info for http://www.sourceforge.net/projects/chromium
  325. // note this may be overwritten in wintools Config.pp
  326. #define CHROMIUM_IPATH /usr/include/chromium/include
  327. #define CHROMIUM_LPATH /usr/lib/chromium/bin/WINT_NT
  328. #define CHROMIUM_LIBS spuload
  329. #defer HAVE_CHROMIUM $[libtest $[CHROMIUM_LPATH],$[CHROMIUM_LIBS]]
  330. // Is Gtk-- installed? How should we run the gtkmm-config program?
  331. // This matters only to programs in PANDATOOL.
  332. #define GTKMM_CONFIG gtkmm-config
  333. #defer HAVE_GTKMM $[bintest $[GTKMM_CONFIG]]
  334. // Do we have Freetype 2.0 (or better)? If available, this package is
  335. // used to generate dynamic in-the-world text from font files.
  336. // On Unix, freetype comes with the freetype-config executable, which
  337. // tells us where to look for the various files. On Windows, we need to
  338. // supply this information explicitly.
  339. #define FREETYPE_CONFIG freetype-config
  340. #defer HAVE_FREETYPE $[or $[libtest $[FREETYPE_LPATH],$[FREETYPE_LIBS]],$[bintest $[FREETYPE_CONFIG]]]
  341. #define FREETYPE_CFLAGS
  342. #define FREETYPE_IPATH
  343. #define FREETYPE_LPATH
  344. #define FREETYPE_LIBS
  345. // Define this true to compile in a default font, so every TextNode
  346. // will always have a font available without requiring the user to
  347. // specify one. Define it empty not to do this, saving a few
  348. // kilobytes on the generated library. Sorry, you can't pick a
  349. // particular font to be the default; it's hardcoded in the source
  350. // (although you can use the text-default-font Configrc variable to
  351. // specify a particular font file to load as the default, overriding
  352. // the compiled-in font).
  353. #define COMPILE_IN_DEFAULT_FONT 1
  354. // Is Maya installed? This matters only to programs in PANDATOOL.
  355. #define MAYA_LOCATION /usr/aw/maya
  356. #defer MAYA_LIBS $[if $[WINDOWS_PLATFORM],Foundation.lib OpenMaya.lib OpenMayaAnim.lib,Foundation OpenMaya OpenMayaAnim]
  357. // Optionally define this to the value of LM_LICENSE_FILE that should
  358. // be set before invoking Maya.
  359. #define MAYA_LICENSE_FILE
  360. #defer HAVE_MAYA $[isdir $[MAYA_LOCATION]/include/maya]
  361. // Define this to generate static libraries and executables, rather than
  362. // dynamic libraries.
  363. //#define LINK_ALL_STATIC yes
  364. // Define this to export the templates from the DLL. This is only
  365. // meaningful if LINK_ALL_STATIC is not defined, and we are building
  366. // on Windows. Some Windows compilers may not support this syntax.
  367. #defer EXPORT_TEMPLATES yes
  368. // Define this to explicitly link in the various external drivers, which
  369. // are normally separate, as part of the Panda library.
  370. //#define LINK_IN_GL yes
  371. //#define LINK_IN_DX yes
  372. //#define LINK_IN_EGG yes
  373. //#define LINK_IN_PHYSICS yes
  374. // Define USE_COMPILER to switch the particular compiler that should
  375. // be used. A handful of tokens are recognized, depending on BUILD_TYPE.
  376. // This may also be further customized within Global.$[BUILD_TYPE].pp.
  377. // If BUILD_TYPE is "unix", this may be one of:
  378. // GCC (gcc/g++)
  379. // MIPS (Irix MIPSPro compiler)
  380. //
  381. // If BUILD_TYPE is "msvc" or "gmsvc", this may be one of:
  382. // MSVC (Microsoft Visual C++ 6.0)
  383. // MSVC7 (Microsoft Visual C++ 7.0)
  384. // BOUNDS (BoundsChecker)
  385. // INTEL (Intel C/C++ compiler)
  386. #if $[WINDOWS_PLATFORM]
  387. #if $[eq $[USE_COMPILER],]
  388. #define USE_COMPILER MSVC7
  389. #endif
  390. #elif $[eq $[PLATFORM], Irix]
  391. #define USE_COMPILER MIPS
  392. #elif $[eq $[PLATFORM], Linux]
  393. #define USE_COMPILER GCC
  394. #endif
  395. // How to invoke bison and flex. Panda takes advantage of some
  396. // bison/flex features, and therefore specifically requires bison and
  397. // flex, not some other versions of yacc and lex. However, you only
  398. // need to have these programs if you need to make changes to the
  399. // bison or flex sources (see the next point, below).
  400. #defer BISON bison
  401. #defer FLEX flex
  402. // You may not even have bison and flex installed. If you don't, no
  403. // sweat; Panda ships with the pre-generated output of these programs,
  404. // so you don't need them unless you want to make changes to the
  405. // grammars themselves (files named *.yxx or *.lxx).
  406. #defer HAVE_BISON $[bintest $[BISON]]
  407. // How to invoke sed. A handful of make rules use this. Since some
  408. // platforms (specifically, non-Unix platforms like Windows) don't
  409. // have any kind of sed, ppremake performs some limited sed-like
  410. // functions. The default is to use ppremake in this capacity. In
  411. // this variable, $[source] is the name of the file to read, $[target]
  412. // is the name of the file to generate, and $[script] is the one-line
  413. // sed script to run.
  414. #defer SED ppremake -s "$[script]" <$[source] >$[target]
  415. // What directory name (within each source directory) should the .o
  416. // (or .obj) files be written to? This can be any name, and it can be
  417. // used to differentiate different builds within the same tree.
  418. // However, don't define this to be '.', or you will be very sad the
  419. // next time you run 'make clean'.
  420. //#defer ODIR Opt$[OPTIMIZE]-$[PLATFORM]$[USE_COMPILER]
  421. // ODIR_SUFFIX is optional, usually empty
  422. #defer ODIR Opt$[OPTIMIZE]-$[PLATFORM]$[ODIR_SUFFIX]
  423. // What is the normal extension of a compiled object file?
  424. #if $[WINDOWS_PLATFORM]
  425. #define OBJ .obj
  426. #else
  427. #define OBJ .o
  428. #endif
  429. ///////////////////////////////////////////////////////////////////////
  430. // The following variables are only meaningful when BUILD_TYPE is
  431. // "unix". These define the commands to invoke the compiler, linker,
  432. // etc.
  433. //////////////////////////////////////////////////////////////////////
  434. // How to invoke the C and C++ compilers.
  435. #if $[eq $[USE_COMPILER], GCC]
  436. #define CC gcc
  437. #define CXX g++
  438. // gcc might run into template limits on some parts of Panda.
  439. #define C++FLAGS_GEN -ftemplate-depth-25
  440. #else
  441. #define CC cc
  442. #define CXX CC
  443. #endif
  444. // How to compile a C or C++ file into a .o file. $[target] is the
  445. // name of the .o file, $[source] is the name of the source file,
  446. // $[ipath] is a space-separated list of directories to search for
  447. // include files, and $[flags] is a list of additional flags to pass
  448. // to the compiler.
  449. #defer COMPILE_C $[CC] $[CFLAGS_GEN] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
  450. #defer COMPILE_C++ $[CXX] $[C++FLAGS_GEN] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
  451. // What flags should be passed to both C and C++ compilers to enable
  452. // compiler optimizations? This will be supplied when OPTIMIZE
  453. // (above) is set to 2, 3, or 4.
  454. #defer OPTFLAGS -O2
  455. // What define variables should be passed to the compilers for each
  456. // value of OPTIMIZE? We separate this so we can pass these same
  457. // options to interrogate, guaranteeing that the correct interfaces
  458. // are generated. Do not include -D here; that will be supplied
  459. // automatically.
  460. #defer CDEFINES_OPT1 _DEBUG $[EXTRA_CDEFS]
  461. #defer CDEFINES_OPT2 _DEBUG $[EXTRA_CDEFS]
  462. #defer CDEFINES_OPT3 $[EXTRA_CDEFS]
  463. #defer CDEFINES_OPT4 NDEBUG $[EXTRA_CDEFS]
  464. // What additional flags should be passed for each value of OPTIMIZE
  465. // (above)? We separate out the compiler-optimization flags, above,
  466. // so we can compile certain files that give optimizers trouble (like
  467. // the output of lex and yacc) without them, but with all the other
  468. // relevant flags.
  469. #defer CFLAGS_OPT1 $[CDEFINES_OPT1:%=-D%] -Wall -g
  470. #defer CFLAGS_OPT2 $[CDEFINES_OPT2:%=-D%] -Wall -g $[OPTFLAGS]
  471. #defer CFLAGS_OPT3 $[CDEFINES_OPT3:%=-D%] $[OPTFLAGS]
  472. #defer CFLAGS_OPT4 $[CDEFINES_OPT4:%=-D%] $[OPTFLAGS]
  473. // What additional flags should be passed to both compilers when
  474. // building shared (relocatable) sources? Some architectures require
  475. // special support for this.
  476. #defer CFLAGS_SHARED -fPIC
  477. // How to generate a C or C++ executable from a collection of .o
  478. // files. $[target] is the name of the binary to generate, and
  479. // $[sources] is the list of .o files. $[libs] is a space-separated
  480. // list of dependent libraries, and $[lpath] is a space-separated list
  481. // of directories in which those libraries can be found.
  482. #defer LINK_BIN_C $[CC] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  483. #defer LINK_BIN_C++ $[CXX] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  484. // How to generate a static C or C++ library. $[target] is the
  485. // name of the library to generate, and $[sources] is the list of .o
  486. // files that will go into the library.
  487. #defer STATIC_LIB_C ar cru $[target] $[sources]
  488. #defer STATIC_LIB_C++ ar cru $[target] $[sources]
  489. // How to run ranlib, if necessary, after generating a static library.
  490. // $[target] is the name of the library. Set this to the empty string
  491. // if ranlib is not necessary on your platform.
  492. #defer RANLIB ranlib $[target]
  493. // How to generate a shared C or C++ library. $[source] and $[target]
  494. // as above, and $[libs] is a space-separated list of dependent
  495. // libraries, and $[lpath] is a space-separated list of directories in
  496. // which those libraries can be found.
  497. #defer SHARED_LIB_C $[CC] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  498. #defer SHARED_LIB_C++ $[CXX] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  499. // How to install a data file or executable file. $[local] is the
  500. // local name of the file to install, and $[dest] is the name of the
  501. // directory to put it in.
  502. // On Unix systems, we strongly prefer using the install program to
  503. // install files. This has nice features like automatically setting
  504. // the permissions bits, and also is usually clever enough to install
  505. // a running program without crashing the running instance. However,
  506. // it doesn't understanding installing a program from a subdirectory,
  507. // so we have to cd into the source directory first.
  508. #defer INSTALL $[if $[ne $[dir $[local]], ./],cd ./$[dir $[local]] &&] install -m 666 $[notdir $[local]] $[dest]
  509. #defer INSTALL_PROG $[if $[ne $[dir $[local]], ./],cd ./$[dir $[local]] &&] install -m 777 $[notdir $[local]] $[dest]
  510. // Variable definitions for building with the Irix MIPSPro compiler.
  511. #if $[eq $[USE_COMPILER], MIPS]
  512. #define CC cc -n32 -mips3
  513. #define CXX CC -n32 -mips3
  514. // Turn off a few annoying warning messages.
  515. // 1174 - function 'blah' was declared but never used
  516. // 1201 - trailing comma is nonstandard.
  517. // 1209 - controlling expression is constant, e.g. if (0) { ... }
  518. // 1234 - access control not specified, 'public' by default
  519. // 1355 - extra ";" ignored
  520. // 1375 - destructor for base class is not virtual.
  521. // this one actually is bad. But we got alot of them from the classes
  522. // that we've derived from STL collections. Beware of this.
  523. // 3322 - omission of explicit type is nonstandard ("int" assumed)
  524. #define WOFF_LIST -woff 1174,1201,1209,1234,1355,1375,3322
  525. // Linker warnings
  526. // 85 - definition of SOMESYMBOL in SOMELIB preempts that of definition in
  527. // SOMEOTHERLIB.
  528. #define WOFF_LIST $[WOFF_LIST] -Wl,-LD_MSG:off=85
  529. #defer OPTFLAGS -O2 -OPT:Olimit=2500
  530. #defer CFLAGS_OPT1 $[CDEFINES_OPT1:%=-D%] $[WOFF_LIST] -g
  531. #defer CFLAGS_OPT2 $[CDEFINES_OPT2:%=-D%] $[WOFF_LIST]
  532. #defer CFLAGS_OPT3 $[CDEFINES_OPT3:%=-D%] $[WOFF_LIST]
  533. #defer CFLAGS_OPT4 $[CDEFINES_OPT4:%=-D%] $[WOFF_LIST]
  534. #defer CFLAGS_SHARED
  535. #defer STATIC_LIB_C $[CC] -ar -o $[target] $[sources]
  536. #defer STATIC_LIB_C++ $[CXX] -ar -o $[target] $[sources]
  537. #defer RANLIB
  538. #define SHARED_FLAGS -Wl,-none -Wl,-update_registry,$[TOPDIR]/so_locations
  539. #defer SHARED_LIB_C $[CC] -shared $[SHARED_FLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  540. #defer SHARED_LIB_C++ $[CXX] -shared $[SHARED_FLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  541. #endif
  542. //////////////////////////////////////////////////////////////////////
  543. // There are also some additional variables that control specific
  544. // compiler/platform features or characteristics, defined in the
  545. // platform specific file Config.platform.pp. Be sure to inspect
  546. // these variables for correctness too.
  547. //////////////////////////////////////////////////////////////////////