ppremake.h 3.3 KB

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