Package.pp 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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. #set DTOOL $[unixfilename $[DTOOL_INSTALL]]
  32. #define DTOOL_INSTALL $[DTOOL]
  33. #define DTOOL_INSTALL_OTHER $(DTOOL)
  34. #elif $[or $[CTPROJS],$[DTOOL]]
  35. // If we are presently attached, use the environment variable.
  36. // We define two variables: one for ourselves, which burns in the
  37. // current value of the DTOOL environment variable (so that any
  38. // attempt to install in this tree will install correctly, no
  39. // matter whether we are attached to a different DTOOL later by
  40. // mistake), and one for other trees to use, which expands to a
  41. // ordinary reference to the DTOOL environment variable, so
  42. // they will read from the right tree no matter which DTOOL they're
  43. // attached to.
  44. #set DTOOL $[unixfilename $[DTOOL]]
  45. #define DTOOL_INSTALL $[DTOOL]
  46. #define DTOOL_INSTALL_OTHER $(DTOOL)
  47. #if $[eq $[DTOOL],]
  48. #error You seem to be attached to some trees, but not DTOOL!
  49. #endif
  50. #else
  51. // Otherwise, if we are not attached, install in the standard place
  52. // (unless the user specifies otherwise).
  53. #defer DTOOL_INSTALL $[unixfilename $[INSTALL_DIR]]
  54. #defer DTOOL_INSTALL_OTHER $[unixfilename $[INSTALL_DIR]]
  55. #endif
  56. // These variables tell ppremake how to interpret the contents of the
  57. // PLATFORM variable, and help it to control the effects of functions
  58. // like $[os] and $[isfullpath].
  59. // True if we are building on some flavor of Windows.
  60. #define WINDOWS_PLATFORM $[or $[eq $[PLATFORM],Win32],$[eq $[PLATFORM],Cygwin]]
  61. // True if we are building on some flavor of OS X.
  62. #define OSX_PLATFORM $[or $[eq $[PLATFORM],Darwin],$[eq $[PLATFORM],osx]]
  63. // True if we are building on some flavor of Unix.
  64. #define UNIX_PLATFORM $[and $[not $[WINDOWS_PLATFORM]],$[not $[OSX_PLATFORM]]]
  65. // Pull in the package-level Config file. This contains a lot of
  66. // configuration variables that the user might want to fine-tune.
  67. #include $[THISDIRPREFIX]Config.pp
  68. // Also get the platform-specific config file. This defines a few
  69. // more variables that are more likely to be platform-dependent and
  70. // are less likely to be directly modified by the user.
  71. #include $[THISDIRPREFIX]Config.$[PLATFORM].pp
  72. // If the environment variable PPREMAKE_CONFIG is set, it points to a
  73. // user-customized Config.pp file, for instance in the user's home
  74. // directory. This file might redefine any of the variables defined
  75. // above.
  76. #if $[ne $[PPREMAKE_CONFIG],]
  77. #define PPREMAKE_CONFIG $[unixfilename $[PPREMAKE_CONFIG]]
  78. #print Reading $[PPREMAKE_CONFIG] (referred to by PPREMAKE_CONFIG)
  79. #include $[PPREMAKE_CONFIG]
  80. #elif $[wildcard $[unixfilename $[INSTALL_DIR]]/Config.pp]
  81. // If the PPREMAKE_CONFIG variable is not, but there exists a
  82. // Config.pp in the compiled-in INSTALL_DIR, use that one by default.
  83. #define PPREMAKE_CONFIG $[unixfilename $[INSTALL_DIR]]/Config.pp
  84. #print Reading $[PPREMAKE_CONFIG] (referred to by INSTALL_DIR, because PPREMAKE_CONFIG is empty)
  85. #include $[PPREMAKE_CONFIG]
  86. #else
  87. // Otherwise, just carry on without it.
  88. #print Environment variable PPREMAKE_CONFIG not set; using defaults.
  89. #endif
  90. // Now evaluate all of our deferred variable definitions from
  91. // Config.pp.
  92. #set PYTHON_IPATH $[unixfilename $[PYTHON_IPATH]]
  93. #set PYTHON_LPATH $[unixfilename $[PYTHON_LPATH]]
  94. #set PYTHON_FPATH $[unixfilename $[PYTHON_FPATH]]
  95. #set PYTHON_FRAMEWORK $[unixfilename $[PYTHON_FRAMEWORK]]
  96. #set HAVE_PYTHON $[HAVE_PYTHON]
  97. #set NSPR_IPATH $[unixfilename $[NSPR_IPATH]]
  98. #set NSPR_LPATH $[unixfilename $[NSPR_LPATH]]
  99. #set NSPR_LIBS $[NSPR_LIBS]
  100. #set HAVE_NSPR $[HAVE_NSPR]
  101. #set SSL_IPATH $[unixfilename $[SSL_IPATH]]
  102. #set SSL_LPATH $[unixfilename $[SSL_LPATH]]
  103. #set SSL_LIBS $[SSL_LIBS]
  104. #set HAVE_SSL $[HAVE_SSL]
  105. #set JPEG_IPATH $[unixfilename $[JPEG_IPATH]]
  106. #set JPEG_LPATH $[unixfilename $[JPEG_LPATH]]
  107. #set JPEG_LIBS $[JPEG_LIBS]
  108. #set HAVE_JPEG $[HAVE_JPEG]
  109. #set PNG_IPATH $[unixfilename $[PNG_IPATH]]
  110. #set PNG_LPATH $[unixfilename $[PNG_LPATH]]
  111. #set PNG_LIBS $[PNG_LIBS]
  112. #set HAVE_PNG $[HAVE_PNG]
  113. #set TIFF_IPATH $[unixfilename $[TIFF_IPATH]]
  114. #set TIFF_LPATH $[unixfilename $[TIFF_LPATH]]
  115. #set TIFF_LIBS $[TIFF_LIBS]
  116. #set HAVE_TIFF $[HAVE_TIFF]
  117. #set FFTW_IPATH $[unixfilename $[FFTW_IPATH]]
  118. #set FFTW_LPATH $[unixfilename $[FFTW_LPATH]]
  119. #set FFTW_LIBS $[FFTW_LIBS]
  120. #set HAVE_FFTW $[HAVE_FFTW]
  121. #set CG_IPATH $[unixfilename $[CG_IPATH]]
  122. #set CG_LPATH $[unixfilename $[CG_LPATH]]
  123. #set CG_LIBS $[CG_LIBS]
  124. #set HAVE_CG $[HAVE_CG]
  125. #set CGGL_IPATH $[unixfilename $[CGGL_IPATH]]
  126. #set CGGL_LPATH $[unixfilename $[CGGL_LPATH]]
  127. #set CGGL_LIBS $[CGGL_LIBS]
  128. #set HAVE_CGGL $[HAVE_CGGL]
  129. #set VRPN_IPATH $[unixfilename $[VRPN_IPATH]]
  130. #set VRPN_LPATH $[unixfilename $[VRPN_LPATH]]
  131. #set VRPN_LIBS $[VRPN_LIBS]
  132. #set HAVE_VRPN $[HAVE_VRPN]
  133. #set HELIX_IPATH $[unixfilename $[HELIX_IPATH]]
  134. #set HELIX_LPATH $[unixfilename $[HELIX_LPATH]]
  135. #set HELIX_LIBS $[HELIX_LIBS]
  136. #set HAVE_HELIX $[HAVE_HELIX]
  137. #set ZLIB_IPATH $[unixfilename $[ZLIB_IPATH]]
  138. #set ZLIB_LPATH $[unixfilename $[ZLIB_LPATH]]
  139. #set ZLIB_LIBS $[ZLIB_LIBS]
  140. #set HAVE_ZLIB $[HAVE_ZLIB]
  141. #set GL_IPATH $[unixfilename $[GL_IPATH]]
  142. #set GL_LPATH $[unixfilename $[GL_LPATH]]
  143. #set GL_LIBS $[GL_LIBS]
  144. #set HAVE_GL $[HAVE_GL]
  145. #set MESA_IPATH $[unixfilename $[MESA_IPATH]]
  146. #set MESA_LPATH $[unixfilename $[MESA_LPATH]]
  147. #set MESA_LIBS $[MESA_LIBS]
  148. #set MESA_MGL $[MESA_MGL]
  149. #set HAVE_MESA $[HAVE_MESA]
  150. #set CHROMIUM_IPATH $[unixfilename $[CHROMIUM_IPATH]]
  151. #set CHROMIUM_LPATH $[unixfilename $[CHROMIUM_LPATH]]
  152. #set CHROMIUM_LIBS $[CHROMIUM_LIBS]
  153. #set HAVE_CHROMIUM $[HAVE_CHROMIUM]
  154. #set GLX_IPATH $[unixfilename $[GLX_IPATH]]
  155. #set GLX_LPATH $[unixfilename $[GLX_LPATH]]
  156. #set HAVE_GLX $[HAVE_GLX]
  157. #set HAVE_WGL $[HAVE_WGL]
  158. #set HAVE_SGIGL $[HAVE_SGIGL]
  159. #set DX_IPATH $[unixfilename $[DX_IPATH]]
  160. #set DX_LPATH $[unixfilename $[DX_LPATH]]
  161. #set DX_LIBS $[DX_LIBS]
  162. #set HAVE_DX $[HAVE_DX]
  163. #set HAVE_THREADS $[HAVE_THREADS]
  164. #set NET_IPATH $[unixfilename $[NET_IPATH]]
  165. #set NET_LPATH $[unixfilename $[NET_LPATH]]
  166. #set NET_LIBS $[NET_LIBS]
  167. #set HAVE_NET $[HAVE_NET]
  168. #set DO_PSTATS $[DO_PSTATS]
  169. #set RAD_MSS_IPATH $[unixfilename $[RAD_MSS_IPATH]]
  170. #set RAD_MSS_LPATH $[unixfilename $[RAD_MSS_LPATH]]
  171. #set RAD_MSS_LIBS $[RAD_MSS_LIBS]
  172. #set HAVE_RAD_MSS $[HAVE_RAD_MSS]
  173. #set FMOD_IPATH $[unixfilename $[FMOD_IPATH]]
  174. #set FMOD_LPATH $[unixfilename $[FMOD_LPATH]]
  175. #set FMOD_LIBS $[FMOD_LIBS]
  176. #set HAVE_FMOD $[HAVE_FMOD]
  177. #set CHROMIUM_IPATH $[unixfilename $[CHROMIUM_IPATH]]
  178. #set CHROMIUM_LPATH $[unixfilename $[CHROMIUM_LPATH]]
  179. #set CHROMIUM_LIBS $[CHROMIUM_LIBS]
  180. #set HAVE_CHROMIUM $[HAVE_CHROMIUM]
  181. #set GTKMM_CONFIG $[GTKMM_CONFIG]
  182. #set HAVE_GTKMM $[HAVE_GTKMM]
  183. #set FREETYPE_CONFIG $[FREETYPE_CONFIG]
  184. #set HAVE_FREETYPE $[HAVE_FREETYPE]
  185. #set FREETYPE_CFLAGS $[FREETYPE_CFLAGS]
  186. #set FREETYPE_IPATH $[unixfilename $[FREETYPE_IPATH]]
  187. #set FREETYPE_LPATH $[unixfilename $[FREETYPE_LPATH]]
  188. #set FREETYPE_LIBS $[FREETYPE_LIBS]
  189. #set MAYA_LOCATION $[unixfilename $[MAYA_LOCATION]]
  190. #set HAVE_MAYA $[HAVE_MAYA]
  191. #set SOFTIMAGE_LOCATION $[unixfilename $[SOFTIMAGE_LOCATION]]
  192. #set HAVE_SOFTIMAGE $[HAVE_SOFTIMAGE]
  193. // Now infer a few more variables based on what was defined.
  194. #if $[and $[HAVE_GTKMM],$[GTKMM_CONFIG]]
  195. #define cflags $[shell $[GTKMM_CONFIG] --cflags]
  196. #define libs $[shell $[GTKMM_CONFIG] --libs]
  197. #define GTKMM_CFLAGS $[filter-out -I%,$[cflags]]
  198. #define GTKMM_IPATH $[unique $[patsubst -I%,%,$[filter -I%,$[cflags]]]]
  199. #define GTKMM_LPATH $[unique $[patsubst -L%,%,$[filter -L%,$[libs]]]]
  200. #define GTKMM_LIBS $[patsubst -l%,%,$[filter -l%,$[libs]]]
  201. #endif
  202. #if $[and $[HAVE_FREETYPE],$[FREETYPE_CONFIG]]
  203. #define cflags $[shell $[FREETYPE_CONFIG] --cflags]
  204. #define libs $[shell $[FREETYPE_CONFIG] --libs]
  205. #define FREETYPE_CFLAGS $[filter-out -I%,$[cflags]]
  206. #define FREETYPE_IPATH $[unique $[patsubst -I%,%,$[filter -I%,$[cflags]]]]
  207. #define FREETYPE_LPATH $[unique $[patsubst -L%,%,$[filter -L%,$[libs]]]]
  208. #define FREETYPE_LIBS $[patsubst -l%,%,$[filter -l%,$[libs]]]
  209. #endif
  210. // Finally, include the system configure file.
  211. #include $[THISDIRPREFIX]pptempl/System.pp