Package.pp 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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 $[or $[CTPROJS],$[DTOOL]]
  31. // If we are presently attached, use the environment variable.
  32. // We define two variables: one for ourselves, which burns in the
  33. // current value of the DTOOL environment variable (so that any
  34. // attempt to install in this tree will install correctly, no
  35. // matter whether we are attached to a different DTOOL later by
  36. // mistake), and one for other trees to use, which expands to a
  37. // ordinary reference to the DTOOL environment variable, so
  38. // they will read from the right tree no matter which DTOOL they're
  39. // attached to.
  40. #set DTOOL $[unixfilename $[DTOOL]]
  41. #define DTOOL_INSTALL $[DTOOL]
  42. #define DTOOL_INSTALL_OTHER $(DTOOL)
  43. #if $[eq $[DTOOL],]
  44. #error You seem to be attached to some trees, but not DTOOL!
  45. #endif
  46. #else
  47. // Otherwise, if we are not attached, install in the standard place
  48. // (unless the user specifies otherwise).
  49. #defer DTOOL_INSTALL $[unixfilename $[INSTALL_DIR]]
  50. #defer DTOOL_INSTALL_OTHER $[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 $[or $[eq $[PLATFORM],Darwin],$[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]
  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]
  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 NSPR_IPATH $[unixfilename $[NSPR_IPATH]]
  94. #set NSPR_LPATH $[unixfilename $[NSPR_LPATH]]
  95. #set NSPR_LIBS $[NSPR_LIBS]
  96. #set HAVE_NSPR $[HAVE_NSPR]
  97. #set SSL_IPATH $[unixfilename $[SSL_IPATH]]
  98. #set SSL_LPATH $[unixfilename $[SSL_LPATH]]
  99. #set SSL_LIBS $[SSL_LIBS]
  100. #set HAVE_SSL $[HAVE_SSL]
  101. #set JPEG_IPATH $[unixfilename $[JPEG_IPATH]]
  102. #set JPEG_LPATH $[unixfilename $[JPEG_LPATH]]
  103. #set JPEG_LIBS $[JPEG_LIBS]
  104. #set HAVE_JPEG $[HAVE_JPEG]
  105. #set PNG_IPATH $[unixfilename $[PNG_IPATH]]
  106. #set PNG_LPATH $[unixfilename $[PNG_LPATH]]
  107. #set PNG_LIBS $[PNG_LIBS]
  108. #set HAVE_PNG $[HAVE_PNG]
  109. #set TIFF_IPATH $[unixfilename $[TIFF_IPATH]]
  110. #set TIFF_LPATH $[unixfilename $[TIFF_LPATH]]
  111. #set TIFF_LIBS $[TIFF_LIBS]
  112. #set HAVE_TIFF $[HAVE_TIFF]
  113. #set FFTW_IPATH $[unixfilename $[FFTW_IPATH]]
  114. #set FFTW_LPATH $[unixfilename $[FFTW_LPATH]]
  115. #set FFTW_LIBS $[FFTW_LIBS]
  116. #set HAVE_FFTW $[HAVE_FFTW]
  117. #set CG_IPATH $[unixfilename $[CG_IPATH]]
  118. #set CG_LPATH $[unixfilename $[CG_LPATH]]
  119. #set CG_LIBS $[CG_LIBS]
  120. #set HAVE_CG $[HAVE_CG]
  121. #set CGGL_IPATH $[unixfilename $[CGGL_IPATH]]
  122. #set CGGL_LPATH $[unixfilename $[CGGL_LPATH]]
  123. #set CGGL_LIBS $[CGGL_LIBS]
  124. #set HAVE_CGGL $[HAVE_CGGL]
  125. #set VRPN_IPATH $[unixfilename $[VRPN_IPATH]]
  126. #set VRPN_LPATH $[unixfilename $[VRPN_LPATH]]
  127. #set VRPN_LIBS $[VRPN_LIBS]
  128. #set HAVE_VRPN $[HAVE_VRPN]
  129. #set HELIX_IPATH $[unixfilename $[HELIX_IPATH]]
  130. #set HELIX_LPATH $[unixfilename $[HELIX_LPATH]]
  131. #set HELIX_LIBS $[HELIX_LIBS]
  132. #set HAVE_HELIX $[HAVE_HELIX]
  133. #set ZLIB_IPATH $[unixfilename $[ZLIB_IPATH]]
  134. #set ZLIB_LPATH $[unixfilename $[ZLIB_LPATH]]
  135. #set ZLIB_LIBS $[ZLIB_LIBS]
  136. #set HAVE_ZLIB $[HAVE_ZLIB]
  137. #set GL_IPATH $[unixfilename $[GL_IPATH]]
  138. #set GL_LPATH $[unixfilename $[GL_LPATH]]
  139. #set GL_LIBS $[GL_LIBS]
  140. #set HAVE_GL $[HAVE_GL]
  141. #set MESA_IPATH $[unixfilename $[MESA_IPATH]]
  142. #set MESA_LPATH $[unixfilename $[MESA_LPATH]]
  143. #set MESA_LIBS $[MESA_LIBS]
  144. #set MESA_MGL $[MESA_MGL]
  145. #set HAVE_MESA $[HAVE_MESA]
  146. #set CHROMIUM_IPATH $[unixfilename $[CHROMIUM_IPATH]]
  147. #set CHROMIUM_LPATH $[unixfilename $[CHROMIUM_LPATH]]
  148. #set CHROMIUM_LIBS $[CHROMIUM_LIBS]
  149. #set HAVE_CHROMIUM $[HAVE_CHROMIUM]
  150. #set GLX_IPATH $[unixfilename $[GLX_IPATH]]
  151. #set GLX_LPATH $[unixfilename $[GLX_LPATH]]
  152. #set HAVE_GLX $[HAVE_GLX]
  153. #set HAVE_WGL $[HAVE_WGL]
  154. #set HAVE_SGIGL $[HAVE_SGIGL]
  155. #set DX_IPATH $[unixfilename $[DX_IPATH]]
  156. #set DX_LPATH $[unixfilename $[DX_LPATH]]
  157. #set DX_LIBS $[DX_LIBS]
  158. #set HAVE_DX $[HAVE_DX]
  159. #set HAVE_THREADS $[HAVE_THREADS]
  160. #set NET_IPATH $[unixfilename $[NET_IPATH]]
  161. #set NET_LPATH $[unixfilename $[NET_LPATH]]
  162. #set NET_LIBS $[NET_LIBS]
  163. #set HAVE_NET $[HAVE_NET]
  164. #set DO_PSTATS $[DO_PSTATS]
  165. #set RAD_MSS_IPATH $[unixfilename $[RAD_MSS_IPATH]]
  166. #set RAD_MSS_LPATH $[unixfilename $[RAD_MSS_LPATH]]
  167. #set RAD_MSS_LIBS $[RAD_MSS_LIBS]
  168. #set HAVE_RAD_MSS $[HAVE_RAD_MSS]
  169. #set FMOD_IPATH $[unixfilename $[FMOD_IPATH]]
  170. #set FMOD_LPATH $[unixfilename $[FMOD_LPATH]]
  171. #set FMOD_LIBS $[FMOD_LIBS]
  172. #set HAVE_FMOD $[HAVE_FMOD]
  173. #set CHROMIUM_IPATH $[unixfilename $[CHROMIUM_IPATH]]
  174. #set CHROMIUM_LPATH $[unixfilename $[CHROMIUM_LPATH]]
  175. #set CHROMIUM_LIBS $[CHROMIUM_LIBS]
  176. #set HAVE_CHROMIUM $[HAVE_CHROMIUM]
  177. #set GTKMM_CONFIG $[GTKMM_CONFIG]
  178. #set HAVE_GTKMM $[HAVE_GTKMM]
  179. #set FREETYPE_CONFIG $[FREETYPE_CONFIG]
  180. #set HAVE_FREETYPE $[HAVE_FREETYPE]
  181. #set FREETYPE_CFLAGS $[FREETYPE_CFLAGS]
  182. #set FREETYPE_IPATH $[unixfilename $[FREETYPE_IPATH]]
  183. #set FREETYPE_LPATH $[unixfilename $[FREETYPE_LPATH]]
  184. #set FREETYPE_LIBS $[FREETYPE_LIBS]
  185. #set MAYA_LOCATION $[unixfilename $[MAYA_LOCATION]]
  186. #set HAVE_MAYA $[HAVE_MAYA]
  187. #set SOFTIMAGE_LOCATION $[unixfilename $[SOFTIMAGE_LOCATION]]
  188. #set HAVE_SOFTIMAGE $[HAVE_SOFTIMAGE]
  189. // Now infer a few more variables based on what was defined.
  190. #if $[and $[HAVE_GTKMM],$[GTKMM_CONFIG]]
  191. #define cflags $[shell $[GTKMM_CONFIG] --cflags]
  192. #define libs $[shell $[GTKMM_CONFIG] --libs]
  193. #define GTKMM_CFLAGS $[filter-out -I%,$[cflags]]
  194. #define GTKMM_IPATH $[unique $[patsubst -I%,%,$[filter -I%,$[cflags]]]]
  195. #define GTKMM_LPATH $[unique $[patsubst -L%,%,$[filter -L%,$[libs]]]]
  196. #define GTKMM_LIBS $[patsubst -l%,%,$[filter -l%,$[libs]]]
  197. #endif
  198. #if $[and $[HAVE_FREETYPE],$[FREETYPE_CONFIG]]
  199. #define cflags $[shell $[FREETYPE_CONFIG] --cflags]
  200. #define libs $[shell $[FREETYPE_CONFIG] --libs]
  201. #define FREETYPE_CFLAGS $[filter-out -I%,$[cflags]]
  202. #define FREETYPE_IPATH $[unique $[patsubst -I%,%,$[filter -I%,$[cflags]]]]
  203. #define FREETYPE_LPATH $[unique $[patsubst -L%,%,$[filter -L%,$[libs]]]]
  204. #define FREETYPE_LIBS $[patsubst -l%,%,$[filter -l%,$[libs]]]
  205. #endif
  206. // Finally, include the system configure file.
  207. #include $[THISDIRPREFIX]pptempl/System.pp