Package.pp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. //
  2. // Package.pp
  3. //
  4. // This file defines certain configuration variables that are to be
  5. // written into the various make scripts. It is processed by ppremake
  6. // (along with the Sources.pp files in each of the various
  7. // directories) to generate build scripts appropriate to each
  8. // environment.
  9. //
  10. // This is the package-specific file, which should be at the top of
  11. // every source hierarchy. It generally gets the ball rolling, and is
  12. // responsible for explicitly including all of the relevent Config.pp
  13. // files.
  14. // Check the version of ppremake in use.
  15. #if $[< $[PPREMAKE_VERSION],1.11]
  16. #error You need at least ppremake version 1.11 to process this tree.
  17. #endif
  18. // Get the current version info for Panda.
  19. #include $[THISDIRPREFIX]PandaVersion.pp
  20. #defer PANDA_MAJOR_VERSION $[word 1,$[PANDA_VERSION]]
  21. #defer PANDA_MINOR_VERSION $[word 2,$[PANDA_VERSION]]
  22. #defer PANDA_SEQUENCE_VERSION $[word 3,$[PANDA_VERSION]]
  23. #defer PANDA_VERSION_STR $[PANDA_MAJOR_VERSION].$[PANDA_MINOR_VERSION].$[PANDA_SEQUENCE_VERSION]$[if $[not $[OFFICIAL_VERSION]],c]
  24. #defer PANDA_VERSION_SYMBOL panda_version_$[PANDA_MAJOR_VERSION]_$[PANDA_MINOR_VERSION]_$[PANDA_SEQUENCE_VERSION]$[if $[not $[OFFICIAL_VERSION]],c]
  25. // What is the name of this source tree?
  26. #if $[eq $[PACKAGE],]
  27. #define PACKAGE dtool
  28. #endif
  29. // Where should we install DTOOL, specifically?
  30. #if $[DTOOL_INSTALL]
  31. #define DTOOL_INSTALL $[unixfilename $[DTOOL_INSTALL]]
  32. #elif $[CTPROJS]
  33. // If we are presently attached, use the environment variable.
  34. // We define two variables: one for ourselves, which burns in the
  35. // current value of the DTOOL environment variable (so that any
  36. // attempt to install in this tree will install correctly, no
  37. // matter whether we are attached to a different DTOOL later by
  38. // mistake), and one for other trees to use, which expands to a
  39. // ordinary reference to the DTOOL environment variable, so
  40. // they will read from the right tree no matter which DTOOL they're
  41. // attached to.
  42. #set DTOOL $[unixfilename $[DTOOL]]
  43. #define DTOOL_INSTALL $[DTOOL]/built
  44. #if $[eq $[DTOOL],]
  45. #error You seem to be attached to some trees, but not DTOOL!
  46. #endif
  47. #else
  48. // Otherwise, if we are not attached, install in the standard place
  49. // (unless the user specifies otherwise).
  50. #defer DTOOL_INSTALL $[unixfilename $[INSTALL_DIR]]
  51. #endif
  52. // These variables tell ppremake how to interpret the contents of the
  53. // PLATFORM variable, and help it to control the effects of functions
  54. // like $[os] and $[isfullpath].
  55. // True if we are building on some flavor of Windows.
  56. #define WINDOWS_PLATFORM $[or $[eq $[PLATFORM],Win32],$[eq $[PLATFORM],Cygwin]]
  57. // True if we are building on some flavor of OS X.
  58. #define OSX_PLATFORM $[eq $[PLATFORM],OSX]
  59. // True if we are building on some flavor of Unix.
  60. #define UNIX_PLATFORM $[and $[not $[WINDOWS_PLATFORM]],$[not $[OSX_PLATFORM]]]
  61. // Pull in the package-level Config file. This contains a lot of
  62. // configuration variables that the user might want to fine-tune.
  63. #include $[THISDIRPREFIX]Config.pp
  64. // Also get the platform-specific config file. This defines a few
  65. // more variables that are more likely to be platform-dependent and
  66. // are less likely to be directly modified by the user.
  67. #include $[THISDIRPREFIX]Config.$[PLATFORM].pp
  68. // If the environment variable PPREMAKE_CONFIG is set, it points to a
  69. // user-customized Config.pp file, for instance in the user's home
  70. // directory. This file might redefine any of the variables defined
  71. // above.
  72. #if $[ne $[PPREMAKE_CONFIG],]
  73. #define PPREMAKE_CONFIG $[unixfilename $[PPREMAKE_CONFIG]]
  74. #print Reading $[PPREMAKE_CONFIG] (referred to by PPREMAKE_CONFIG)
  75. #include $[PPREMAKE_CONFIG]
  76. #elif $[wildcard $[unixfilename $[INSTALL_DIR]]/Config.pp]
  77. // If the PPREMAKE_CONFIG variable is not, but there exists a
  78. // Config.pp in the compiled-in INSTALL_DIR, use that one by default.
  79. #define PPREMAKE_CONFIG $[unixfilename $[INSTALL_DIR]]/Config.pp
  80. #print Reading $[PPREMAKE_CONFIG] (referred to by INSTALL_DIR, because PPREMAKE_CONFIG is empty)
  81. #include $[PPREMAKE_CONFIG]
  82. #else
  83. // Otherwise, just carry on without it.
  84. #print Environment variable PPREMAKE_CONFIG not set; using defaults.
  85. #endif
  86. // Now evaluate all of our deferred variable definitions from
  87. // Config.pp.
  88. #set PYTHON_IPATH $[unixfilename $[PYTHON_IPATH]]
  89. #set PYTHON_LPATH $[unixfilename $[PYTHON_LPATH]]
  90. #set PYTHON_FPATH $[unixfilename $[PYTHON_FPATH]]
  91. #set PYTHON_FRAMEWORK $[unixfilename $[PYTHON_FRAMEWORK]]
  92. #set HAVE_PYTHON $[HAVE_PYTHON]
  93. #set NATIVE_NET_IPATH $[unixfilename $[NATIVE_NET_IPATH]]
  94. #set NATIVE_NET_LPATH $[unixfilename $[NATIVE_NET_LPATH]]
  95. #set NATIVE_NET_LIBS $[NATIVE_NET_LIBS]
  96. #set WANT_NATIVE_NET $[WANT_NATIVE_NET]
  97. #set HAVE_NET $[HAVE_NET]
  98. #set OPENSSL_IPATH $[unixfilename $[OPENSSL_IPATH]]
  99. #set OPENSSL_LPATH $[unixfilename $[OPENSSL_LPATH]]
  100. #set OPENSSL_LIBS $[OPENSSL_LIBS]
  101. #set HAVE_OPENSSL $[HAVE_OPENSSL]
  102. #set JPEG_IPATH $[unixfilename $[JPEG_IPATH]]
  103. #set JPEG_LPATH $[unixfilename $[JPEG_LPATH]]
  104. #set JPEG_LIBS $[JPEG_LIBS]
  105. #set HAVE_JPEG $[HAVE_JPEG]
  106. #set PNG_IPATH $[unixfilename $[PNG_IPATH]]
  107. #set PNG_LPATH $[unixfilename $[PNG_LPATH]]
  108. #set PNG_LIBS $[PNG_LIBS]
  109. #set HAVE_PNG $[HAVE_PNG]
  110. #set TIFF_IPATH $[unixfilename $[TIFF_IPATH]]
  111. #set TIFF_LPATH $[unixfilename $[TIFF_LPATH]]
  112. #set TIFF_LIBS $[TIFF_LIBS]
  113. #set HAVE_TIFF $[HAVE_TIFF]
  114. #set TAR_IPATH $[unixfilename $[TAR_IPATH]]
  115. #set TAR_LPATH $[unixfilename $[TAR_LPATH]]
  116. #set TAR_LIBS $[TAR_LIBS]
  117. #set HAVE_TAR $[HAVE_TAR]
  118. #set FFTW_IPATH $[unixfilename $[FFTW_IPATH]]
  119. #set FFTW_LPATH $[unixfilename $[FFTW_LPATH]]
  120. #set FFTW_LIBS $[FFTW_LIBS]
  121. #set HAVE_FFTW $[HAVE_FFTW]
  122. #set BDB_IPATH $[unixfilename $[BDB_IPATH]]
  123. #set BDB_LPATH $[unixfilename $[BDB_LPATH]]
  124. #set BDB_LIBS $[BDB_LIBS]
  125. #set HAVE_BDB $[HAVE_BDB]
  126. #set CG_IPATH $[unixfilename $[CG_IPATH]]
  127. #set CG_LPATH $[unixfilename $[CG_LPATH]]
  128. #set CG_LIBS $[CG_LIBS]
  129. #set HAVE_CG $[HAVE_CG]
  130. #set CGGL_IPATH $[unixfilename $[CGGL_IPATH]]
  131. #set CGGL_LPATH $[unixfilename $[CGGL_LPATH]]
  132. #set CGGL_LIBS $[CGGL_LIBS]
  133. #set HAVE_CGGL $[HAVE_CGGL]
  134. #set CGDX8_IPATH $[unixfilename $[CGDX8_IPATH]]
  135. #set CGDX8_LPATH $[unixfilename $[CGDX8_LPATH]]
  136. #set CGDX8_LIBS $[CGDX8_LIBS]
  137. #set HAVE_CGDX8 $[HAVE_CGDX8]
  138. #set CGDX9_IPATH $[unixfilename $[CGDX9_IPATH]]
  139. #set CGDX9_LPATH $[unixfilename $[CGDX9_LPATH]]
  140. #set CGDX9_LIBS $[CGDX9_LIBS]
  141. #set HAVE_CGDX9 $[HAVE_CGDX9]
  142. #set CGDX10_IPATH $[unixfilename $[CGDX10_IPATH]]
  143. #set CGDX10_LPATH $[unixfilename $[CGDX10_LPATH]]
  144. #set CGDX10_LIBS $[CGDX10_LIBS]
  145. #set HAVE_CGDX10 $[HAVE_CGDX10]
  146. #set VRPN_IPATH $[unixfilename $[VRPN_IPATH]]
  147. #set VRPN_LPATH $[unixfilename $[VRPN_LPATH]]
  148. #set VRPN_LIBS $[VRPN_LIBS]
  149. #set HAVE_VRPN $[HAVE_VRPN]
  150. #set HELIX_IPATH $[unixfilename $[HELIX_IPATH]]
  151. #set HELIX_LPATH $[unixfilename $[HELIX_LPATH]]
  152. #set HELIX_LIBS $[HELIX_LIBS]
  153. #set HAVE_HELIX $[HAVE_HELIX]
  154. #set ZLIB_IPATH $[unixfilename $[ZLIB_IPATH]]
  155. #set ZLIB_LPATH $[unixfilename $[ZLIB_LPATH]]
  156. #set ZLIB_LIBS $[ZLIB_LIBS]
  157. #set HAVE_ZLIB $[HAVE_ZLIB]
  158. #set GL_IPATH $[unixfilename $[GL_IPATH]]
  159. #set GL_LPATH $[unixfilename $[GL_LPATH]]
  160. #set GL_LIBS $[GL_LIBS]
  161. #set GLU_LIBS $[GLU_LIBS]
  162. #set HAVE_GL $[HAVE_GL]
  163. #set HAVE_GLU $[HAVE_GLU]
  164. #set MESA_IPATH $[unixfilename $[MESA_IPATH]]
  165. #set MESA_LPATH $[unixfilename $[MESA_LPATH]]
  166. #set MESA_LIBS $[MESA_LIBS]
  167. #set MESA_MGL $[MESA_MGL]
  168. #set HAVE_MESA $[HAVE_MESA]
  169. #set CHROMIUM_IPATH $[unixfilename $[CHROMIUM_IPATH]]
  170. #set CHROMIUM_LPATH $[unixfilename $[CHROMIUM_LPATH]]
  171. #set CHROMIUM_LIBS $[CHROMIUM_LIBS]
  172. #set HAVE_CHROMIUM $[HAVE_CHROMIUM]
  173. #set GLX_IPATH $[unixfilename $[GLX_IPATH]]
  174. #set GLX_LPATH $[unixfilename $[GLX_LPATH]]
  175. #set HAVE_GLX $[HAVE_GLX]
  176. #set HAVE_WGL $[HAVE_WGL]
  177. #set HAVE_SGIGL $[HAVE_SGIGL]
  178. #set DX8_IPATH $[unixfilename $[DX8_IPATH]]
  179. #set DX8_LPATH $[unixfilename $[DX8_LPATH]]
  180. #set DX8_LIBS $[DX8_LIBS]
  181. #set HAVE_DX8 $[HAVE_DX8]
  182. #set DX9_IPATH $[unixfilename $[DX9_IPATH]]
  183. #set DX9_LPATH $[unixfilename $[DX9_LPATH]]
  184. #set DX9_LIBS $[DX9_LIBS]
  185. #set HAVE_DX9 $[HAVE_DX9]
  186. #set OPENCV_IPATH $[unixfilename $[OPENCV_IPATH]]
  187. #set OPENCV_LPATH $[unixfilename $[OPENCV_LPATH]]
  188. #set OPENCV_LIBS $[OPENCV_LIBS]
  189. #set HAVE_OPENCV $[HAVE_OPENCV]
  190. #set FFMPEG_IPATH $[unixfilename $[FFMPEG_IPATH]]
  191. #set FFMPEG_LPATH $[unixfilename $[FFMPEG_LPATH]]
  192. #set FFMPEG_LIBS $[FFMPEG_LIBS]
  193. #set HAVE_FFMPEG $[HAVE_FFMPEG]
  194. #set ODE_IPATH $[unixfilename $[ODE_IPATH]]
  195. #set ODE_LPATH $[unixfilename $[ODE_LPATH]]
  196. #set ODE_LIBS $[ODE_LIBS]
  197. #set HAVE_ODE $[HAVE_ODE]
  198. #set HAVE_THREADS $[HAVE_THREADS]
  199. #set DEBUG_THREADS $[DEBUG_THREADS]
  200. #set MUTEX_SPINLOCK $[MUTEX_SPINLOCK]
  201. #set DO_PSTATS $[DO_PSTATS]
  202. #set RAD_MSS_IPATH $[unixfilename $[RAD_MSS_IPATH]]
  203. #set RAD_MSS_LPATH $[unixfilename $[RAD_MSS_LPATH]]
  204. #set RAD_MSS_LIBS $[RAD_MSS_LIBS]
  205. #set HAVE_RAD_MSS $[HAVE_RAD_MSS]
  206. #set FMODEX_IPATH $[unixfilename $[FMODEX_IPATH]]
  207. #set FMODEX_LPATH $[unixfilename $[FMODEX_LPATH]]
  208. #set FMODEX_LIBS $[FMODEX_LIBS]
  209. #set HAVE_FMODEX $[HAVE_FMODEX]
  210. #set CHROMIUM_IPATH $[unixfilename $[CHROMIUM_IPATH]]
  211. #set CHROMIUM_LPATH $[unixfilename $[CHROMIUM_LPATH]]
  212. #set CHROMIUM_LIBS $[CHROMIUM_LIBS]
  213. #set HAVE_CHROMIUM $[HAVE_CHROMIUM]
  214. #set PKG_CONFIG $[PKG_CONFIG]
  215. #set HAVE_GTK $[HAVE_GTK]
  216. #set FREETYPE_CONFIG $[FREETYPE_CONFIG]
  217. #set HAVE_FREETYPE $[HAVE_FREETYPE]
  218. #set FREETYPE_CFLAGS $[FREETYPE_CFLAGS]
  219. #set FREETYPE_IPATH $[unixfilename $[FREETYPE_IPATH]]
  220. #set FREETYPE_LPATH $[unixfilename $[FREETYPE_LPATH]]
  221. #set FREETYPE_LIBS $[FREETYPE_LIBS]
  222. #set MAYA_LOCATION $[unixfilename $[MAYA_LOCATION]]
  223. #set HAVE_MAYA $[HAVE_MAYA]
  224. #set SOFTIMAGE_LOCATION $[unixfilename $[SOFTIMAGE_LOCATION]]
  225. #set HAVE_SOFTIMAGE $[HAVE_SOFTIMAGE]
  226. // Now infer a few more variables based on what was defined.
  227. #if $[and $[HAVE_GTK],$[PKG_CONFIG]]
  228. #define cflags $[shell $[PKG_CONFIG] gtk+-2.0 --cflags]
  229. #define libs $[shell $[PKG_CONFIG] gtk+-2.0 --libs]
  230. #define GTK_CFLAGS $[filter-out -I%,$[cflags]]
  231. #define GTK_IPATH $[unique $[patsubst -I%,%,$[filter -I%,$[cflags]]]]
  232. #define GTK_LPATH $[unique $[patsubst -L%,%,$[filter -L%,$[libs]]]]
  233. #define GTK_LIBS $[patsubst -l%,%,$[filter -l%,$[libs]]]
  234. #endif
  235. #if $[and $[HAVE_FREETYPE],$[FREETYPE_CONFIG]]
  236. #define cflags $[shell $[FREETYPE_CONFIG] --cflags]
  237. #define libs $[shell $[FREETYPE_CONFIG] --libs]
  238. #define FREETYPE_CFLAGS $[filter-out -I%,$[cflags]]
  239. #define FREETYPE_IPATH $[unique $[patsubst -I%,%,$[filter -I%,$[cflags]]]]
  240. #define FREETYPE_LPATH $[unique $[patsubst -L%,%,$[filter -L%,$[libs]]]]
  241. #define FREETYPE_LIBS $[patsubst -l%,%,$[filter -l%,$[libs]]]
  242. #endif
  243. // Finally, include the system configure file.
  244. #include $[THISDIRPREFIX]pptempl/System.pp