Package.pp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 $[not $[>= $[PPREMAKE_VERSION],0.50]]
  16. #error You need at least ppremake version 0.50 to process this tree.
  17. #endif
  18. // What is the name and version of this source tree?
  19. #if $[eq $[PACKAGE],]
  20. #define PACKAGE dtool
  21. #define VERSION 0.80
  22. #endif
  23. // Where should install DTOOL, specifically?
  24. #if $[or $[CTPROJS],$[DTOOL]]
  25. // If we are presently attached, use the environment variable.
  26. // We define two variables: one for ourselves, which burns in the
  27. // current value of the DTOOL environment variable (so that any
  28. // attempt to install in this tree will install correctly, no
  29. // matter whether we are attached to a different DTOOL later by
  30. // mistake), and one for other trees to use, which expands to a
  31. // ordinary reference to the DTOOL environment variable, so
  32. // they will read from the right tree no matter which DTOOL they're
  33. // attached to.
  34. #define DTOOL_INSTALL $[DTOOL]
  35. #define DTOOL_INSTALL_OTHER $(DTOOL)
  36. #if $[eq $[DTOOL],]
  37. #error You seem to be attached to some trees, but not DTOOL!
  38. #endif
  39. #else
  40. // Otherwise, if we are not attached, install in the standard place
  41. // (unless the user specifies otherwise).
  42. #defer DTOOL_INSTALL $[INSTALL_DIR]
  43. #defer DTOOL_INSTALL_OTHER $[INSTALL_DIR]
  44. #endif
  45. // Pull in the package-level Config file. This contains a lot of
  46. // configuration variables that the user might want to fine-tune.
  47. #include $[THISDIRPREFIX]Config.pp
  48. // Also get the platform-specific config file. This defines a few
  49. // more variables that are more likely to be platform-dependent and
  50. // are less likely to be directly modified by the user.
  51. #include $[THISDIRPREFIX]Config.$[PLATFORM].pp
  52. // If the environment variable PPREMAKE_CONFIG is set, it points to a
  53. // user-customized Config.pp file, for instance in the user's home
  54. // directory. This file might redefine any of the variables defined
  55. // above.
  56. #if $[ne $[PPREMAKE_CONFIG],]
  57. #print Reading $[PPREMAKE_CONFIG]
  58. #include $[PPREMAKE_CONFIG]
  59. #else
  60. #print Environment variable PPREMAKE_CONFIG not set; using defaults.
  61. #endif
  62. // Now evaluate all of our deferred variable definitions from
  63. // Config.pp.
  64. #set HAVE_PYTHON $[HAVE_PYTHON]
  65. #set HAVE_NSPR $[HAVE_NSPR]
  66. #set HAVE_VRPN $[HAVE_VRPN]
  67. #set HAVE_ZLIB $[HAVE_ZLIB]
  68. #set HAVE_SOXST $[HAVE_SOXST]
  69. #set HAVE_GL $[HAVE_GL]
  70. #set HAVE_GLX $[HAVE_GLX]
  71. #set HAVE_GLUT $[HAVE_GLUT]
  72. #set HAVE_WGL $[HAVE_WGL]
  73. #set HAVE_SGIGL $[HAVE_SGIGL]
  74. #set HAVE_DX $[HAVE_DX]
  75. #set HAVE_RIB $[HAVE_RIB]
  76. #set HAVE_MIKMOD $[HAVE_MIKMOD]
  77. #set HAVE_NET $[HAVE_NET]
  78. #set HAVE_AUDIO $[HAVE_AUDIO]
  79. #set HAVE_GTKMM $[HAVE_GTKMM]
  80. #set HAVE_MAYA $[HAVE_MAYA]
  81. // Now infer a few more variables based on what was defined.
  82. #if $[and $[HAVE_MIKMOD],$[MIKMOD_CONFIG]]
  83. #define cflags $[shell $[MIKMOD_CONFIG] --cflags]
  84. #define libs $[shell $[MIKMOD_CONFIG] --libs]
  85. #define MIKMOD_CFLAGS $[filter-out -I%,$[cflags]]
  86. #define MIKMOD_IPATH $[unique $[patsubst -I%,%,$[filter -I%,$[cflags]]]]
  87. #define MIKMOD_LPATH $[unique $[patsubst -L%,%,$[filter -L%,$[libs]]]]
  88. #define MIKMOD_LIBS $[patsubst -l%,%,$[filter -l%,$[libs]]]
  89. #endif
  90. #if $[and $[HAVE_GTKMM],$[GTKMM_CONFIG]]
  91. #define cflags $[shell $[GTKMM_CONFIG] --cflags]
  92. #define libs $[shell $[GTKMM_CONFIG] --libs]
  93. #define GTKMM_CFLAGS $[filter-out -I%,$[cflags]]
  94. #define GTKMM_IPATH $[unique $[patsubst -I%,%,$[filter -I%,$[cflags]]]]
  95. #define GTKMM_LPATH $[unique $[patsubst -L%,%,$[filter -L%,$[libs]]]]
  96. #define GTKMM_LIBS $[patsubst -l%,%,$[filter -l%,$[libs]]]
  97. #endif
  98. // Finally, include the system configure file.
  99. #include $[THISDIRPREFIX]pptempl/System.pp