ppremake.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. // Filename: ppremake.h
  3. // Created by: drose (25Sep00)
  4. //
  5. ////////////////////////////////////////////////////////////////////
  6. */
  7. #ifndef PPREMAKE_H
  8. #define PPREMAKE_H
  9. #ifdef _MSC_VER
  10. /* For Visual C, include the special config.h file. */
  11. #include "config_msvc.h"
  12. #else
  13. /* Otherwise, include the normal automatically-generated file. */
  14. #include "config.h"
  15. #endif
  16. #ifdef __cplusplus
  17. #ifdef HAVE_IOSTREAM
  18. #include <iostream>
  19. #include <fstream>
  20. #ifdef HAVE_SSTREAM
  21. #include <sstream>
  22. #else /* HAVE_SSTREAM */
  23. #include <strstream>
  24. #endif /* HAVE_SSTREAM */
  25. typedef std::ios::openmode ios_openmode;
  26. typedef std::ios::fmtflags ios_fmtflags;
  27. typedef std::ios::iostate ios_iostate;
  28. typedef std::ios::seekdir ios_seekdir;
  29. #else /* HAVE_IOSTREAM */
  30. #include <iostream.h>
  31. #include <fstream.h>
  32. #include <strstream.h>
  33. typedef int ios_openmode;
  34. typedef int ios_fmtflags;
  35. typedef int ios_iostate;
  36. /* Old iostream libraries used ios::seek_dir instead of ios::seekdir. */
  37. typedef ios::seek_dir ios_seekdir;
  38. #endif /* HAVE_IOSTREAM */
  39. #if defined(HAVE_CYGWIN) || defined(WIN32_VC)
  40. /* Either Cygwin or Visual C++ is a Win32 environment. */
  41. #define WIN32
  42. #endif
  43. #include <string>
  44. #include <map>
  45. #ifdef HAVE_NAMESPACE
  46. using namespace std;
  47. #endif
  48. #endif /* __cplusplus */
  49. #ifndef HAVE_ALLOCA_H
  50. /* If we don't have alloca.h, use malloc() to implement gnu_regex. */
  51. #define REGEX_MALLOC 1
  52. #endif
  53. #define PACKAGE_FILENAME "Package.pp"
  54. #define SOURCE_FILENAME "Sources.pp"
  55. #define COMMAND_PREFIX '#'
  56. #define VARIABLE_PREFIX '$'
  57. #define VARIABLE_OPEN_BRACE '['
  58. #define VARIABLE_CLOSE_BRACE ']'
  59. #define PATTERN_WILDCARD '%'
  60. #define BEGIN_COMMENT "//"
  61. #define FUNCTION_PARAMETER_SEPARATOR ','
  62. #define VARIABLE_OPEN_NESTED '('
  63. #define VARIABLE_CLOSE_NESTED ')'
  64. #define VARIABLE_PATSUBST ":"
  65. #define VARIABLE_PATSUBST_DELIM "="
  66. #define SCOPE_DIRNAME_SEPARATOR '/'
  67. #define SCOPE_DIRNAME_WILDCARD "*"
  68. #define SCOPE_DIRNAME_CURRENT "."
  69. #ifdef __cplusplus
  70. /* These are set from the similarly-named variables defined in
  71. System.pp. */
  72. extern bool unix_platform;
  73. extern bool windows_platform;
  74. /* This is a command-line global parameter. */
  75. extern bool dry_run;
  76. extern bool verbose_dry_run;
  77. extern int verbose; // 0..9 to set verbose level. 0 == off.
  78. extern int debug_expansions;
  79. /* This is set true internally if an error occurred while processing
  80. any of the scripts. */
  81. extern bool errors_occurred;
  82. /* This structure tracks the number of expansions that are performed
  83. on a particular string, and the different values it produces, only
  84. if debug_expansions (above) is set true by command-line parameter
  85. -x. */
  86. typedef map<string, int> ExpandResultCount;
  87. typedef map<string, ExpandResultCount> DebugExpand;
  88. extern DebugExpand debug_expand;
  89. #endif
  90. /* These are defined so that we may build Filename, DSearchPath, and
  91. GlobPattern, which are copied from dtool and panda. We have to
  92. copy these files in since ppremake must be built first, and stands
  93. outside of Panda; but we want to minimize the changes we must make
  94. to these files so that we can easily recopy them at need.
  95. These symbols just make the build environment a bit more
  96. Panda-like. */
  97. #define PUBLISHED public
  98. #define INLINE inline
  99. #define EXPCL_DTOOL
  100. #define EXPCL_PANDA
  101. #endif