Config.pp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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 generic Unix autoconf/automake
  10. // style build scripts, as well as makefiles customized for SGI's
  11. // MipsPRO compiler or for Microsoft's Visual C++. It can also
  12. // generate Microsoft Developer's Studio project files directly. In
  13. // principle, it can be extended to generate suitable build script
  14. // files for any number of different build environments.
  15. //
  16. // All of these build scripts can be tuned for a particular
  17. // environment via this file. This is the place for the user to
  18. // specify which external packages are installed and where, or to
  19. // enable or disable certain optional features. However, it is
  20. // suggested that rather than modify this file directly, you create a
  21. // custom file in your home directory and there redefine whatever
  22. // variables are appropriate, and set the environment variable
  23. // PPREMAKE_CONFIG to refer to it. In this way, you can easily get an
  24. // updated source tree (including a new Config.pp) without risking
  25. // accidentally losing your customizations. This also avoids having
  26. // to redefine the same variables in different packages (for instance,
  27. // in dtool and in panda).
  28. //
  29. // The syntax in this file resembles some hybrid between C++
  30. // preprocessor declarations and GNU make variables. This is the same
  31. // syntax used in the various ppremake system configure files; it's
  32. // designed to be easy to use as a macro language to generate
  33. // makefiles and their ilk.
  34. //
  35. // Some of the variables below are defined using the #define command,
  36. // and others are defined using #defer. The two are very similar in
  37. // their purpose; the difference is that, if the variable definition
  38. // includes references to other variables (e.g. $[varname]), then
  39. // #define will evaluate all of the other variable references
  40. // immediately and store the resulting expansion, while #defer will
  41. // store only the variable references themselves, and expand them when
  42. // the variable is later referenced. It is very similar to the
  43. // relationship between := and = in GNU Make.
  44. //
  45. // In general, #defer is used in this file, to allow the user to
  46. // redefine critical variables in his or her own Config.pp file.
  47. // What kind of build scripts are we generating? This selects a
  48. // suitable template file from the ppremake system files. The
  49. // allowable choices, at present, are:
  50. //
  51. // autoconf - Generate configure.in and a series of Makefile.am files,
  52. // suitable for using with autoconf/automake. Do not use
  53. // this mode yet; it's not finished.
  54. // stopgap - Generate original Frang-style Makefile/Makefile.install/etc.
  55. // files, to ease transition to the new system.
  56. // unix - Generate makefiles suitable for most Unix platforms,
  57. // without using autoconf.
  58. // msvc - Generate makefiles suitable for building on Windows platforms
  59. // (e.g. Windows NT, Windows 2000) using the Microsoft Visual C++
  60. // command-line compiler and Microsoft nmake.
  61. // gmsvc - Generate makefiles similar to the above, using Microsoft
  62. // Visual C++, but uses the Cygwin-supplied GNU make
  63. // instead of Microsoft nmake. This is potentially
  64. // faster if you have multiple CPU's, since it supports
  65. // distributed make. It's a tiny bit slower if you're
  66. // not taking advantage of distributed make, because of
  67. // the overhead associated with Cygwin fork() calls.
  68. //
  69. #define BUILD_TYPE unix
  70. // What is the default install directory for all trees in the Panda
  71. // suite? You may also override this for a particular tree by
  72. // defining a variable name like DTOOL_INSTALL or PANDA_INSTALL. This
  73. // variable will have no effect when you are using the cttools to
  74. // control your attachment to the trees; in this case, the install
  75. // directory for each tree will by default be the root of the tree
  76. // itself (although this may be overridden).
  77. #define INSTALL_DIR /usr/local/panda
  78. // What level of compiler optimization/debug symbols should we build?
  79. // The various optimize levels are defined as follows:
  80. //
  81. // 1 - No compiler optimizations, full debug symbols
  82. // 2 - Full compiler optimizations, full debug symbols
  83. // (if the compiler supports this)
  84. // 3 - Full compiler optimizations, no debug symbols
  85. // 4 - Full optimizations, no debug symbols, and asserts removed
  86. //
  87. // Setting this has no effect when BUILD_TYPE is "stopgap". In this
  88. // case, the compiler optimizations are selected by setting the
  89. // environment variable OPTIMIZE accordingly at compile time.
  90. #define OPTIMIZE 2
  91. ////////////////////////////////////////////////////////////////////
  92. // The remaining variables are considered only if BUILD_TYPE is not
  93. // "autoconf". (Autoconf can determine these directly.)
  94. ////////////////////////////////////////////////////////////////////
  95. // NOTE: In the following, to indicate "yes" to a yes/no question,
  96. // define the variable to be a nonempty string. To indicate "no",
  97. // define the variable to be an empty string.
  98. // Many of the HAVE_* variables are defined in terms of expressions
  99. // based on the paths and library names, etc., defined above. These
  100. // are defined using the "defer" command, so that they are not
  101. // evaluated right away, giving the user an opportunity to redefine
  102. // the variables they depend on, or to redefine the HAVE_* variables
  103. // themselves (you can explicitly define a HAVE_* variable to some
  104. // nonempty string to force the package to be marked as installed).
  105. // Do you want to generate a Python-callable interrogate interface?
  106. // This is only necessary if you plan to make calls into Panda from a
  107. // program written in Python. This is done only if HAVE_PYTHON,
  108. // below, is also true.
  109. #define INTERROGATE_PYTHON_INTERFACE 1
  110. // Do you want to generate a C-callable interrogate interface? This
  111. // generates an interface similar to the Python interface above, with
  112. // a C calling convention. It should be useful for most other kinds
  113. // of scripting language; the VR Studio used to use this to make calls
  114. // into Panda from Squeak. This is not presently used by any VR
  115. // Studio code.
  116. #define INTERROGATE_C_INTERFACE
  117. // What additional options should be passed to interrogate when
  118. // generating either of the above two interfaces? Generally, you
  119. // probably don't want to mess with this.
  120. #define INTERROGATE_OPTIONS -fnames -string -refcount -assert -promiscuous
  121. // Is Python installed, and should Python interfaces be generated? If
  122. // Python is installed, which directory is it in? (If the directory
  123. // is someplace standard like /usr/include, you may leave it blank.)
  124. #define PYTHON_IPATH /usr/local/include/python1.6
  125. #define PYTHON_LPATH
  126. #defer HAVE_PYTHON $[isdir $[PYTHON_IPATH]]
  127. // Is NSPR installed, and where? This is the Netscape Portable
  128. // Runtime library, downloadable as part of the Mozilla package from
  129. // mozilla.org. It provides portable threading and networking
  130. // services to Panda. Panda should compile without it, although
  131. // without any threading or networking capabilities; eventually,
  132. // native support for these capabilities may be added for certain
  133. // platforms. See also HAVE_IPC and HAVE_NET.
  134. #define NSPR_IPATH /usr/include/nspr
  135. #define NSPR_LPATH
  136. #define NSPR_LIBS nspr4
  137. #defer HAVE_NSPR $[libtest $[NSPR_LPATH],$[NSPR_LIBS]]
  138. // Is VRPN installed, and where?
  139. #define VRPN_IPATH
  140. #define VRPN_LPATH
  141. #defer HAVE_VRPN $[isdir $[VRPN_IPATH]]
  142. // Is ZLIB installed, and where?
  143. #define ZLIB_IPATH
  144. #define ZLIB_LPATH
  145. #define ZLIB_LIBS z
  146. #defer HAVE_ZLIB $[libtest $[ZLIB_LPATH],$[ZLIB_LIBS]]
  147. // Is the sox libst library installed, and where?
  148. #define SOXST_IPATH
  149. #define SOXST_LPATH
  150. #define SOXST_LIBS st
  151. #defer HAVE_SOXST $[libtest $[SOXST_LPATH],$[SOXST_LIBS]]
  152. // Is OpenGL installed, and where? This should include libGL as well
  153. // as libGLU, if they are in different places.
  154. #define GL_IPATH
  155. #define GL_LPATH /usr/X11R6/lib
  156. #if $[eq $[PLATFORM],Win32]
  157. #define GL_LIBS \
  158. opengl32.lib glu32.lib winmm.lib kernel32.lib \
  159. oldnames.lib mswsock.lib ws2_32.lib \
  160. advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib
  161. #else
  162. #define GL_LIBS GL GLU
  163. #endif
  164. #defer HAVE_GL $[libtest $[GL_LPATH],$[GL_LIBS]]
  165. // How about GLX?
  166. #define GLX_IPATH
  167. #define GLX_LPATH
  168. #if $[eq $[PLATFORM],Win32]
  169. #defer HAVE_GLX
  170. #else
  171. #defer HAVE_GLX $[HAVE_GL]
  172. #endif
  173. // Glut?
  174. #define GLUT_IPATH
  175. #define GLUT_LPATH
  176. #define GLUT_LIBS glut
  177. #defer HAVE_GLUT $[libtest $[GLUT_LPATH],$[GLUT_LIBS]]
  178. // Should we try to build the WGL interface?
  179. #define HAVE_WGL $[eq $[PLATFORM],Win32]
  180. // Should we try to build the SGI-specific glxdisplay?
  181. #define HAVE_SGIGL $[eq $[PLATFORM],Irix]
  182. // Should we try to build the DirectX interface? What additional
  183. // libraries do we need?
  184. #define DX_IPATH /mspsdk/Include
  185. #define DX_LPATH /mspsdk/Lib
  186. #define DX_LIBS \
  187. dxguid.lib winmm.lib kernel32.lib gdi32.lib comdlg32.lib winspool.lib \
  188. user32.lib advapi32.lib ddraw.lib d3dim.lib
  189. #defer HAVE_DX $[libtest $[DX_LPATH],$[DX_LIBS]]
  190. // Do you want to build the Renderman interface?
  191. #define HAVE_RIB
  192. // Is Mikmod installed? How should we run the libmikmod-config program?
  193. #define MIKMOD_CONFIG libmikmod-config
  194. #defer HAVE_MIKMOD $[bintest $[MIKMOD_CONFIG]]
  195. // Do you want to build in support for threading (inter-process
  196. // control)? What additional libraries are required? Currently, this
  197. // requires NSPR to compile correctly.
  198. #define IPC_IPATH
  199. #define IPC_LPATH
  200. #define IPC_LIBS
  201. #defer HAVE_IPC $[HAVE_NSPR]
  202. // Do you want to build the network interface? What additional libraries
  203. // are required? Currently, this requires NSPR.
  204. #define NET_IPATH
  205. #define NET_LPATH
  206. #if $[eq $[PLATFORM],Win32]
  207. #define NET_LIBS ws2_32.lib
  208. #else
  209. #define NET_LIBS
  210. #endif
  211. #defer HAVE_NET $[HAVE_NSPR]
  212. // Do you want to build the audio interface? What additional
  213. // libraries are required?
  214. #define AUDIO_IPATH /mspsdk/Include
  215. #define AUDIO_LPATH /mspsdk/Lib
  216. #if $[eq $[PLATFORM],Win32]
  217. #define AUDIO_LIBS winmm.lib dsound.lib user32.lib ole32.lib dxguid.lib
  218. #else
  219. #define AUDIO_LIBS
  220. #endif
  221. #define HAVE_AUDIO 1
  222. // Is Gtk-- installed? How should we run the gtkmm-config program?
  223. // This matters only to programs in PANDATOOL.
  224. #define GTKMM_CONFIG gtkmm-config
  225. #defer HAVE_GTKMM $[bintest $[GTKMM_CONFIG]]
  226. // Is Maya installed? This matters only to programs in PANDATOOL.
  227. #define MAYA_LOCATION /usr/aw/maya2.5
  228. #defer HAVE_MAYA $[isdir $[MAYA_LOCATION]]
  229. ///////////////////////////////////////////////////////////////////////
  230. // The following variables are meaningful when BUILD_TYPE is "unix" or
  231. // "msvc". They define a few environmental things.
  232. //////////////////////////////////////////////////////////////////////
  233. // How to invoke bison and flex. Panda takes advantage of some
  234. // bison/flex features, and therefore specifically requires bison and
  235. // flex, not some other versions of yacc and lex. You can build Panda
  236. // without having bison or flex, but only if you obtained Panda from a
  237. // tarball or zip archive that included the source files generated by
  238. // bison and flex, and only if you do not modify any bison or flex
  239. // sources.
  240. #defer BISON bison
  241. #defer FLEX flex
  242. // How to invoke sed. A handful of make rules use this. Since some
  243. // platforms (specifically, non-Unix platforms like Windows) don't
  244. // have any kind of sed, ppremake performs some limited sed-like
  245. // functions. The default is to use ppremake in this capacity. In
  246. // this variable, $[source] is the name of the file to read, $[target]
  247. // is the name of the file to generate, and $[script] is the one-line
  248. // sed script to run.
  249. #defer SED ppremake -s '$[script]' <$[source] >$[target]
  250. // What directory name (within each source directory) should the .o
  251. // (or .obj) files be written to, for both shared and static sources?
  252. // In general, it is safe to define these to be the same. However,
  253. // don't define these to be '.', or you will be very sad the next time
  254. // you run 'make clean'.
  255. #defer ODIR Opt$[OPTIMIZE]-$[PLATFORM]
  256. #defer ODIR_SHARED $[ODIR]
  257. #defer ODIR_STATIC $[ODIR]
  258. ///////////////////////////////////////////////////////////////////////
  259. // The following variables are only meaningful when BUILD_TYPE is
  260. // "unix". These define the commands to invoke the compiler, linker,
  261. // etc.
  262. //////////////////////////////////////////////////////////////////////
  263. // How to invoke the C and C++ compilers.
  264. #defer CC gcc
  265. #defer CXX g++
  266. // How to compile a C or C++ file into a .o file. $[target] is the
  267. // name of the .o file, $[source] is the name of the source file,
  268. // $[ipath] is a space-separated list of directories to search for
  269. // include files, and $[flags] is a list of additional flags to pass
  270. // to the compiler.
  271. #defer COMPILE_C $[CC] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
  272. #defer COMPILE_C++ $[CXX] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
  273. // What flags should be passed to both C and C++ compilers to enable
  274. // compiler optimizations? This will be supplied when OPTIMIZE
  275. // (above) is set to 2, 3, or 4.
  276. #defer OPTFLAGS -O2
  277. // What define variables should be passed to the compilers for each
  278. // value of OPTIMIZE? We separate this so we can pass these same
  279. // options to interrogate, guaranteeing that the correct interfaces
  280. // are generated. Do not include -D here; that will be supplied
  281. // automatically.
  282. #defer CDEFINES_OPT1
  283. #defer CDEFINES_OPT2
  284. #defer CDEFINES_OPT3
  285. #defer CDEFINES_OPT4 NDEBUG
  286. // What additional flags should be passed for each value of OPTIMIZE
  287. // (above)? We separate out the compiler-optimization flags, above,
  288. // so we can compile certain files that give optimizers trouble (like
  289. // the output of lex and yacc) without them, but with all the other
  290. // relevant flags.
  291. #defer CFLAGS_OPT1 $[CDEFINES_OPT1:%=-D%] -Wall -g
  292. #defer CFLAGS_OPT2 $[CDEFINES_OPT2:%=-D%] -Wall -g
  293. #defer CFLAGS_OPT3 $[CDEFINES_OPT3:%=-D%]
  294. #defer CFLAGS_OPT4 $[CDEFINES_OPT4:%=-D%]
  295. // What additional flags should be passed to both compilers when
  296. // building shared (relocatable) sources? Some architectures require
  297. // special support for this.
  298. #defer CFLAGS_SHARED -fPIC
  299. // How to generate a C or C++ executable from a collection of .o
  300. // files. $[target] is the name of the binary to generate, and
  301. // $[sources] is the list of .o files. $[libs] is a space-separated
  302. // list of dependent libraries, and $[lpath] is a space-separated list
  303. // of directories in which those libraries can be found.
  304. #defer LINK_BIN_C $[CC] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  305. #defer LINK_BIN_C++ $[CXX] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  306. // How to generate a static C or C++ library. $[target] is the
  307. // name of the library to generate, and $[sources] is the list of .o
  308. // files that will go into the library.
  309. #defer STATIC_LIB_C ar cru $[target] $[sources]
  310. #defer STATIC_LIB_C++ ar cru $[target] $[sources]
  311. // How to run ranlib, if necessary, after generating a static library.
  312. // $[target] is the name of the library. Set this to the empty string
  313. // if ranlib is not necessary on your platform.
  314. #defer RANLIB ranlib $[target]
  315. // How to generate a shared C or C++ library. $[source] and $[target]
  316. // as above, and $[libs] is a space-separated list of dependent
  317. // libraries, and $[lpath] is a space-separated list of directories in
  318. // which those libraries can be found.
  319. #defer SHARED_LIB_C $[CC] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  320. #defer SHARED_LIB_C++ $[CXX] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  321. // How to install a data file or executable file. $[local] is the
  322. // local name of the file to install, and $[dest] is the name of the
  323. // directory to put it in.
  324. #defer INSTALL install -m 644 $[local] $[dest]
  325. #defer INSTALL_PROG install -m 755 $[local] $[dest]
  326. // When building under Irix, we assume you want to use the MIPSPro
  327. // compiler. Comment this bit out (or redefine the variables
  328. // yourself) if you'd rather use gcc or some other compiler.
  329. #if $[eq $[PLATFORM],Irix]
  330. #defer CC cc -n32 -mips3
  331. #defer CXX CC -n32 -mips3
  332. // Turn off a few annoying warning messages.
  333. // 1174 - function 'blah' was declared but never used
  334. // 1201 - trailing comma is nonstandard.
  335. // 1209 - controlling expression is constant, e.g. if (0) { ... }
  336. // 1234 - access control not specified, 'public' by default
  337. // 1355 - extra ";" ignored
  338. // 1375 - destructor for base class is not virtual.
  339. // this one actually is bad. But we got alot of them from the classes
  340. // that we've derived from STL collections. Beware of this.
  341. // 3322 - omission of explicit type is nonstandard ("int" assumed)
  342. #define WOFF_LIST -woff 1174,1201,1209,1234,1355,1375,3322
  343. // Linker warnings
  344. // 85 - definition of SOMESYMBOL in SOMELIB preempts that of definition in
  345. // SOMEOTHERLIB.
  346. #define WOFF_LIST $[WOFF_LIST] -Wl,-LD_MSG:off=85
  347. #defer OPTFLAGS -O2 -OPT:Olimit=2500
  348. #defer CFLAGS_OPT1 $[CDEFINES_OPT1:%=-D%] $[WOFF_LIST] -g
  349. #defer CFLAGS_OPT2 $[CDEFINES_OPT2:%=-D%] $[WOFF_LIST]
  350. #defer CFLAGS_OPT3 $[CDEFINES_OPT3:%=-D%] $[WOFF_LIST]
  351. #defer CFLAGS_OPT4 $[CDEFINES_OPT4:%=-D%] $[WOFF_LIST]
  352. #defer CFLAGS_SHARED
  353. #defer STATIC_LIB_C $[CC] -ar -o $[target] $[sources]
  354. #defer STATIC_LIB_C++ $[CXX] -ar -o $[target] $[sources]
  355. #defer RANLIB
  356. #define SHARED_FLAGS -Wl,-none -Wl,-update_registry,$[TOPDIR]/so_locations
  357. #defer SHARED_LIB_C $[CC] -shared $[SHARED_FLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  358. #defer SHARED_LIB_C++ $[CXX] -shared $[SHARED_FLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  359. #endif
  360. //////////////////////////////////////////////////////////////////////
  361. // There are also some additional variables that control specific
  362. // compiler/platform features or characteristics, defined in the
  363. // platform specific file Config.platform.pp. Be sure to inspect
  364. // these variables for correctness too. As above, these are
  365. // unnecessary when BUILD_TYPE is "autoconf".
  366. //////////////////////////////////////////////////////////////////////