Config.pp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  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. //
  62. #define BUILD_TYPE stopgap
  63. // What is the default install directory for all trees in the Panda
  64. // suite? You may also override this for a particular tree by
  65. // defining a variable name like DTOOL_INSTALL or PANDA_INSTALL. This
  66. // variable will have no effect when you are using the cttools to
  67. // control your attachment to the trees; in this case, the install
  68. // directory for each tree will by default be the root of the tree
  69. // itself (although this may be overridden).
  70. #define INSTALL_DIR /usr/local/panda
  71. // What level of compiler optimization/debug symbols should we build?
  72. // The various optimize levels are defined as follows:
  73. //
  74. // 1 - No compiler optimizations, full debug symbols
  75. // 2 - Full compiler optimizations, full debug symbols
  76. // (if the compiler supports this)
  77. // 3 - Full compiler optimizations, no debug symbols
  78. // 4 - Full optimizations, no debug symbols, and asserts removed
  79. //
  80. // Setting this has no effect when BUILD_TYPE is "stopgap". In this
  81. // case, the compiler optimizations are selected by setting the
  82. // environment variable OPTIMIZE accordingly at compile time.
  83. #define OPTIMIZE 2
  84. ////////////////////////////////////////////////////////////////////
  85. // The remaining variables are considered only if BUILD_TYPE is not
  86. // "autoconf". (Autoconf can determine these directly.)
  87. ////////////////////////////////////////////////////////////////////
  88. // NOTE: In the following, to indicate "yes" to a yes/no question,
  89. // define the variable to be a nonempty string. To indicate "no",
  90. // define the variable to be an empty string.
  91. // Many of the HAVE_* variables are defined in terms of expressions
  92. // based on the paths and library names, etc., defined above. These
  93. // are defined using the "defer" command, so that they are not
  94. // evaluated right away, giving the user an opportunity to redefine
  95. // the variables they depend on, or to redefine the HAVE_* variables
  96. // themselves (you can explicitly define a HAVE_* variable to some
  97. // nonempty string to force the package to be marked as installed).
  98. // Do you want to generate a Python-callable interrogate interface?
  99. // This is only necessary if you plan to make calls into Panda from a
  100. // program written in Python. This is done only if HAVE_PYTHON,
  101. // below, is also true.
  102. #define INTERROGATE_PYTHON_INTERFACE 1
  103. // Do you want to generate a C-callable interrogate interface? This
  104. // generates an interface similar to the Python interface above, with
  105. // a C calling convention. It should be useful for most other kinds
  106. // of scripting language; the VR Studio used to use this to make calls
  107. // into Panda from Squeak. This is not presently used by any VR
  108. // Studio code.
  109. #define INTERROGATE_C_INTERFACE
  110. // What additional options should be passed to interrogate when
  111. // generating either of the above two interfaces? Generally, you
  112. // probably don't want to mess with this.
  113. #define INTERROGATE_OPTIONS -fnames -string -refcount -assert -promiscuous
  114. // Is Python installed, and should Python interfaces be generated? If
  115. // Python is installed, which directory is it in? (If the directory
  116. // is someplace standard like /usr/include, you may leave it blank.)
  117. #define PYTHON_IPATH /usr/local/include/python1.6
  118. #define PYTHON_LPATH
  119. #defer HAVE_PYTHON $[isdir $[PYTHON_IPATH]]
  120. // Is NSPR installed, and where?
  121. #define NSPR_IPATH /usr/local/mozilla/dist/*/include
  122. #define NSPR_LPATH
  123. #define NSPR_LIBS nspr3
  124. #defer HAVE_NSPR $[libtest $[NSPR_LPATH],$[NSPR_LIBS]]
  125. // Is VRPN installed, and where?
  126. #define VRPN_IPATH
  127. #define VRPN_LPATH
  128. #defer HAVE_VRPN $[isdir $[VRPN_IPATH]]
  129. // Is ZLIB installed, and where?
  130. #define ZLIB_IPATH
  131. #define ZLIB_LPATH
  132. #define ZLIB_LIBS z
  133. #defer HAVE_ZLIB $[libtest $[ZLIB_LPATH],$[ZLIB_LIBS]]
  134. // Is the sox libst library installed, and where?
  135. #define SOXST_IPATH
  136. #define SOXST_LPATH
  137. #define SOXST_LIBS st
  138. #defer HAVE_SOXST $[libtest $[SOXST_LPATH],$[SOXST_LIBS]]
  139. // Is OpenGL installed, and where? This should include libGL as well
  140. // as libGLU, if they are in different places.
  141. #define GL_IPATH
  142. #define GL_LPATH /usr/X11R6/lib
  143. #if $[eq $[PLATFORM],Win32]
  144. #define GL_LIBS \
  145. opengl32.lib glu32.lib winmm.lib kernel32.lib \
  146. oldnames.lib mswsock.lib ws2_32.lib \
  147. advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib
  148. #else
  149. #define GL_LIBS GL GLU
  150. #endif
  151. #defer HAVE_GL $[libtest $[GL_LPATH],$[GL_LIBS]]
  152. // How about GLX?
  153. #define GLX_IPATH
  154. #define GLX_LPATH
  155. #if $[eq $[PLATFORM],Win32]
  156. #defer HAVE_GLX
  157. #else
  158. #defer HAVE_GLX $[HAVE_GL]
  159. #endif
  160. // Glut?
  161. #define GLUT_IPATH
  162. #define GLUT_LPATH
  163. #define GLUT_LIBS glut
  164. #defer HAVE_GLUT $[libtest $[GLUT_LPATH],$[GLUT_LIBS]]
  165. // Should we try to build the WGL interface?
  166. #define HAVE_WGL
  167. // Should we try to build the SGI-specific glxdisplay?
  168. #define HAVE_SGIGL
  169. // Should we try to build the DirectX interface? What additional
  170. // libraries do we need?
  171. #define DX_IPATH
  172. #define DX_LPATH
  173. #define DX_LIBS \
  174. dxguid.lib winmm.lib kernel32.lib gdi32.lib comdlg32.lib winspool.lib \
  175. user32.lib advapi32.lib ddraw.lib d3dim.lib
  176. #defer HAVE_DX $[libtest $[DX_LPATH],$[DX_LIBS]]
  177. // Do you want to build the Renderman interface?
  178. #define HAVE_RIB
  179. // Is Mikmod installed? How should we run the libmikmod-config program?
  180. #define MIKMOD_CONFIG libmikmod-config
  181. #defer HAVE_MIKMOD $[bintest $[MIKMOD_CONFIG]]
  182. // Do you want to build the network interface? What additional libraries
  183. // are required?
  184. #define NET_IPATH
  185. #define NET_LPATH
  186. #if $[eq $[PLATFORM],Win32]
  187. #define NET_LIBS ws2_32.lib
  188. #else
  189. #define NET_LIBS
  190. #endif
  191. #define HAVE_NET 1
  192. // Do you want to build the audio interface? What additional
  193. // libraries are required?
  194. #define AUDIO_IPATH
  195. #define AUDIO_LPATH
  196. #if $[eq $[PLATFORM],Win32]
  197. #define AUDIO_LIBS winmm.lib dsound.lib user32.lib ole32.lib dxguid.lib
  198. #else
  199. #define AUDIO_LIBS
  200. #endif
  201. #define HAVE_AUDIO 1
  202. // Is Gtk-- installed? How should we run the gtkmm-config program?
  203. // This matters only to programs in PANDATOOL.
  204. #define GTKMM_CONFIG gtkmm-config
  205. #defer HAVE_GTKMM $[bintest $[GTKMM_CONFIG]]
  206. // Is Maya installed? This matters only to programs in PANDATOOL.
  207. #define MAYA_LOCATION /usr/aw/maya2.5
  208. #defer HAVE_MAYA $[isdir $[MAYA_LOCATION]]
  209. ///////////////////////////////////////////////////////////////////////
  210. // The following variables are meaningful when BUILD_TYPE is "unix" or
  211. // "msvc". They define a few environmental things.
  212. //////////////////////////////////////////////////////////////////////
  213. // How to invoke bison and flex. Panda takes advantage of some
  214. // bison/flex features, and therefore specifically requires bison and
  215. // flex, not some other versions of yacc and lex. You can build Panda
  216. // without having bison or flex, but only if you obtained Panda from a
  217. // tarball or zip archive that included the source files generated by
  218. // bison and flex, and only if you do not modify any bison or flex
  219. // sources.
  220. #defer BISON bison
  221. #defer FLEX flex
  222. // How to invoke sed. Only a few make rules use this. You can
  223. // probably do without it without too much trouble.
  224. #defer SED sed
  225. // What directory name (within each source directory) should the .o
  226. // (or .obj) files be written to, for both shared and static sources?
  227. // In general, it is safe to define these to be the same. However,
  228. // don't define these to be '.', or you will be very sad the next time
  229. // you run 'make clean'.
  230. #defer ODIR Opt$[OPTIMIZE]-$[PLATFORM]
  231. #defer ODIR_SHARED $[ODIR]
  232. #defer ODIR_STATIC $[ODIR]
  233. ///////////////////////////////////////////////////////////////////////
  234. // The following variables are only meaningful when BUILD_TYPE is
  235. // "unix". These define the commands to invoke the compiler, linker,
  236. // etc.
  237. //////////////////////////////////////////////////////////////////////
  238. // How to invoke the C and C++ compilers.
  239. #defer CC gcc
  240. #defer CXX g++
  241. // How to compile a C or C++ file into a .o file. $[target] is the
  242. // name of the .o file, $[source] is the name of the source file,
  243. // $[ipath] is a space-separated list of directories to search for
  244. // include files, and $[flags] is a list of additional flags to pass
  245. // to the compiler.
  246. #defer COMPILE_C $[CC] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
  247. #defer COMPILE_C++ $[CXX] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
  248. // What flags should be passed to both C and C++ compilers to enable
  249. // compiler optimizations? This will be supplied when OPTIMIZE
  250. // (above) is set to 2, 3, or 4.
  251. #defer OPTFLAGS -O2
  252. // What define variables should be passed to the compilers for each
  253. // value of OPTIMIZE? We separate this so we can pass these same
  254. // options to interrogate, guaranteeing that the correct interfaces
  255. // are generated. Do not include -D here; that will be supplied
  256. // automatically.
  257. #defer CDEFINES_OPT1
  258. #defer CDEFINES_OPT2
  259. #defer CDEFINES_OPT3
  260. #defer CDEFINES_OPT4 NDEBUG
  261. // What additional flags should be passed for each value of OPTIMIZE
  262. // (above)? We separate out the compiler-optimization flags, above,
  263. // so we can compile certain files that give optimizers trouble (like
  264. // the output of lex and yacc) without them, but with all the other
  265. // relevant flags.
  266. #defer CFLAGS_OPT1 $[CDEFINES_OPT1:%=-D%] -Wall -g
  267. #defer CFLAGS_OPT2 $[CDEFINES_OPT2:%=-D%] -Wall -g
  268. #defer CFLAGS_OPT3 $[CDEFINES_OPT3:%=-D%]
  269. #defer CFLAGS_OPT4 $[CDEFINES_OPT4:%=-D%]
  270. // What additional flags should be passed to both compilers when
  271. // building shared (relocatable) sources? Some architectures require
  272. // special support for this.
  273. #defer CFLAGS_SHARED -fPIC
  274. // How to generate a C or C++ executable from a collection of .o
  275. // files. $[target] is the name of the binary to generate, and
  276. // $[sources] is the list of .o files. $[libs] is a space-separated
  277. // list of dependent libraries, and $[lpath] is a space-separated list
  278. // of directories in which those libraries can be found.
  279. #defer LINK_BIN_C $[CC] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  280. #defer LINK_BIN_C++ $[CXX] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  281. // How to generate a static C or C++ library. $[target] is the
  282. // name of the library to generate, and $[sources] is the list of .o
  283. // files that will go into the library.
  284. #defer STATIC_LIB_C ar cru $[target] $[sources]
  285. #defer STATIC_LIB_C++ ar cru $[target] $[sources]
  286. // How to run ranlib, if necessary, after generating a static library.
  287. // $[target] is the name of the library. Set this to the empty string
  288. // if ranlib is not necessary on your platform.
  289. #defer RANLIB ranlib $[target]
  290. // How to generate a shared C or C++ library. $[source] and $[target]
  291. // as above, and $[libs] is a space-separated list of dependent
  292. // libraries, and $[lpath] is a space-separated list of directories in
  293. // which those libraries can be found.
  294. #defer SHARED_LIB_C $[CC] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  295. #defer SHARED_LIB_C++ $[CXX] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  296. // How to install a data file or executable file. $[local] is the
  297. // local name of the file to install, and $[dest] is the name of the
  298. // directory to put it in.
  299. #defer INSTALL install -m 644 $[local] $[dest]
  300. #defer INSTALL_PROG install -m 755 $[local] $[dest]
  301. // When building under Irix, we assume you want to use the MIPSPro
  302. // compiler. Comment this bit out (or redefine the variables
  303. // yourself) if you'd rather use gcc or some other compiler.
  304. #if $[eq $[PLATFORM],Irix]
  305. #defer CC cc -n32 -mips3
  306. #defer CXX CC -n32 -mips3
  307. // Turn off a few annoying warning messages.
  308. // 1174 - function 'blah' was declared but never used
  309. // 1201 - trailing comma is nonstandard.
  310. // 1209 - controlling expression is constant, e.g. if (0) { ... }
  311. // 1234 - access control not specified, 'public' by default
  312. // 1355 - extra ";" ignored
  313. // 1375 - destructor for base class is not virtual.
  314. // this one actually is bad. But we got alot of them from the classes
  315. // that we've derived from STL collections. Beware of this.
  316. // 3322 - omission of explicit type is nonstandard ("int" assumed)
  317. #define WOFF_LIST -woff 1174,1201,1209,1234,1355,1375,3322
  318. // Linker warnings
  319. // 85 - definition of SOMESYMBOL in SOMELIB preempts that of definition in
  320. // SOMEOTHERLIB.
  321. #define WOFF_LIST $[WOFF_LIST] -Wl,-LD_MSG:off=85
  322. #defer OPTFLAGS -O2 -OPT:Olimit=2500
  323. #defer CFLAGS_OPT1 $[CDEFINES_OPT1:%=-D%] $[WOFF_LIST] -g
  324. #defer CFLAGS_OPT2 $[CDEFINES_OPT2:%=-D%] $[WOFF_LIST]
  325. #defer CFLAGS_OPT3 $[CDEFINES_OPT3:%=-D%] $[WOFF_LIST]
  326. #defer CFLAGS_OPT4 $[CDEFINES_OPT4:%=-D%] $[WOFF_LIST]
  327. #defer CFLAGS_SHARED
  328. #defer STATIC_LIB_C $[CC] -ar -o $[target] $[sources]
  329. #defer STATIC_LIB_C++ $[CXX] -ar -o $[target] $[sources]
  330. #defer RANLIB
  331. #define SHARED_FLAGS -Wl,-none -Wl,-update_registry,$[TOPDIR]/so_locations
  332. #defer SHARED_LIB_C $[CC] -shared $[SHARED_FLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  333. #defer SHARED_LIB_C++ $[CXX] -shared $[SHARED_FLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  334. #endif
  335. //////////////////////////////////////////////////////////////////////
  336. // There are also some additional variables that control specific
  337. // compiler/platform features or characteristics, defined in the
  338. // platform specific file Config.platform.pp. Be sure to inspect
  339. // these variables for correctness too. As above, these are
  340. // unnecessary when BUILD_TYPE is "autoconf".
  341. //////////////////////////////////////////////////////////////////////