ppremake.h 3.7 KB

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