Browse Source

*** empty log message ***

David Rose 25 years ago
parent
commit
d9730bb878
100 changed files with 3545 additions and 519 deletions
  1. 0 18
      direct/Config.pp
  2. 39 6
      direct/Package.pp
  3. 1 1
      direct/src/configfiles/Sources.pp
  4. 1 1
      direct/src/showbase/Sources.pp
  5. 28 0
      dtool/Config.Irix.pp
  6. 28 0
      dtool/Config.Linux.pp
  7. 30 2
      dtool/Config.Win32.pp
  8. 159 9
      dtool/Config.pp
  9. 55 166
      dtool/LocalSetup.pp
  10. 28 2
      dtool/Package.pp
  11. 43 0
      dtool/pptempl/Depends.pp
  12. 405 0
      dtool/pptempl/Global.pp
  13. 167 0
      dtool/pptempl/Global.stopgap.pp
  14. 38 0
      dtool/pptempl/Global.unix.pp
  15. 37 0
      dtool/pptempl/System.pp
  16. 922 0
      dtool/pptempl/Template.autoconf.pp
  17. 699 0
      dtool/pptempl/Template.stopgap.pp
  18. 572 0
      dtool/pptempl/Template.unix.pp
  19. 1 1
      dtool/src/attach/Sources.pp
  20. 5 5
      dtool/src/attach/ctallihave
  21. 3 3
      dtool/src/attach/ctattach.drv
  22. 4 4
      dtool/src/attach/ctattch.pl
  23. 3 3
      dtool/src/attach/ctattch.pl.rnd
  24. 2 2
      dtool/src/attach/ctccase.pl
  25. 5 5
      dtool/src/attach/ctci
  26. 34 34
      dtool/src/attach/ctcm.pl
  27. 5 5
      dtool/src/attach/ctco
  28. 1 1
      dtool/src/attach/ctcvs.pl
  29. 5 5
      dtool/src/attach/ctdelta
  30. 5 5
      dtool/src/attach/ctihave
  31. 5 5
      dtool/src/attach/ctmake
  32. 5 5
      dtool/src/attach/ctmkdir
  33. 5 5
      dtool/src/attach/ctmkelem
  34. 5 5
      dtool/src/attach/ctmv
  35. 5 5
      dtool/src/attach/ctrm
  36. 1 1
      dtool/src/attach/ctsanity
  37. 3 3
      dtool/src/attach/ctunattach.drv
  38. 2 2
      dtool/src/attach/ctunattach.pl
  39. 5 5
      dtool/src/attach/ctunco
  40. 1 1
      dtool/src/attach/ctvspec.pl
  41. 1 0
      dtool/src/attach/neartool
  42. 2 2
      dtool/src/attach/unco.pl
  43. 2 2
      dtool/src/build/Makefile.a.template
  44. 2 2
      dtool/src/build/Makefile.bin.template
  45. 1 1
      dtool/src/build/Makefile.bin.vars
  46. 2 2
      dtool/src/build/Makefile.foreign.template
  47. 1 1
      dtool/src/build/Makefile.foreign.vars
  48. 5 5
      dtool/src/build/Makefile.install.rules
  49. 1 1
      dtool/src/build/Makefile.install.template
  50. 2 2
      dtool/src/build/Makefile.install.vars
  51. 1 1
      dtool/src/build/Makefile.meta.template
  52. 2 2
      dtool/src/build/Makefile.o.include
  53. 2 2
      dtool/src/build/Makefile.o.vars
  54. 1 1
      dtool/src/build/Makefile.project.template
  55. 1 1
      dtool/src/build/Makefile.project.vars
  56. 2 2
      dtool/src/build/Makefile.so.template
  57. 2 2
      dtool/src/build/Makefile.ss.template
  58. 1 1
      dtool/src/build/Makefile.ss.vars
  59. 1 1
      dtool/src/build/Makefile.uxb.template
  60. 5 5
      dtool/src/build/ctaddpkg
  61. 5 5
      dtool/src/build/ctaddtgt
  62. 7 7
      dtool/src/build/ctinitproj
  63. 1 1
      dtool/src/build/ctinstmake.pl
  64. 1 1
      dtool/src/build/ctproj
  65. 1 1
      dtool/src/build/ctproj.pl
  66. 2 2
      dtool/src/build/initialize
  67. 3 3
      dtool/src/dtoolbase/dtoolsymbols.h
  68. 22 29
      dtool/src/dtoolutil/executionEnvironment.cxx
  69. 4 11
      dtool/src/dtoolutil/pfstream.h
  70. 2 0
      dtool/src/interrogate/interrogate.cxx
  71. 1 0
      dtool/src/interrogate/interrogate.h
  72. 1 1
      dtool/src/interrogate/interrogateBuilder.cxx
  73. 0 18
      panda/Config.pp
  74. 38 6
      panda/Package.pp
  75. 1 1
      panda/Sources.pp
  76. 1 0
      panda/src/audio/Sources.pp
  77. 2 2
      panda/src/audio/audio_trait.h
  78. 6 19
      panda/src/builder/builderFuncs.I
  79. 0 4
      panda/src/builder/mesherTempl.I
  80. 1 1
      panda/src/chancfg/Sources.pp
  81. 4 0
      panda/src/char/characterJointBundle.I
  82. 1 1
      panda/src/configfiles/Sources.pp
  83. 1 1
      panda/src/dgraph/describe_data_verbose.cxx
  84. 1 0
      panda/src/downloadertools/Sources.pp
  85. 0 2
      panda/src/dxgsg/dxGraphicsStateGuardian.h
  86. 3 4
      panda/src/dxgsg/dxTextureContext.h
  87. 0 2
      panda/src/express/Sources.pp
  88. 4 3
      panda/src/express/multifile.h
  89. 1 1
      panda/src/express/referenceCount.I
  90. 1 1
      panda/src/express/trueClock.cxx
  91. 6 6
      panda/src/express/typeHandle.cxx
  92. 3 15
      panda/src/express/typedef.h
  93. 0 8
      panda/src/framework/framework.cxx
  94. 5 3
      panda/src/glgsg/glGraphicsStateGuardian.cxx
  95. 2 1
      panda/src/glgsg/glGraphicsStateGuardian.h
  96. 4 3
      panda/src/glgsg/glTextureContext.h
  97. 2 1
      panda/src/glutdisplay/glutGraphicsWindow.cxx
  98. 5 0
      panda/src/graph/nodeRelation.h
  99. 1 1
      panda/src/ipc/ipc_traits.h
  100. 3 3
      panda/src/ipc/test_diners.cxx

+ 0 - 18
direct/Config.pp

@@ -1,18 +0,0 @@
-//
-// Config.pp
-//
-// This file defines certain configuration variables that are written
-// into the various make scripts.  It is processed by ppremake (along
-// with the Sources.pp files in each of the various directories) to
-// generate build scripts appropriate to each environment.
-//
-// There are not too many variables to declare at this level; most of
-// them are defined in the DTOOL-specific Config.pp.
-
-
-// Where should we find PANDA?  This will come from the environment
-// variable if it is set.
-#if $[eq $[PANDA],]
-  #define PANDA /usr/local/panda
-#endif
-

+ 39 - 6
direct/Package.pp

@@ -14,6 +14,14 @@
 
 
 
+// Check the version of ppremake in use.  This is temporary until
+// everyone gets up to at least 0.50.  After that, the test in dtool
+// will suffice.
+#if $[not $[>= $[PPREMAKE_VERSION],0.50]]
+  #error You need at least ppremake version 0.50 to process this tree.
+#endif
+
+
 // What is the name and version of this source tree?
 #if $[eq $[PACKAGE],]
   #define PACKAGE direct
@@ -21,14 +29,39 @@
 #endif
 
 
-// Pull in the package-level Config file.  This contains a few
-// configuration variables that the user might want to fine-tune.
-#include $[THISDIRPREFIX]Config.pp
+// Where should we find the PANDA source directory?
+#if $[or $[CTPROJS],$[PANDA]]
+  // If we are presently attached, use the environment variable.
+  #define PANDA_SOURCE $[PANDA]
+  #if $[eq $[PANDA],]
+    #error You seem to be attached to some trees, but not PANDA!
+  #endif
+#else
+  // Otherwise, if we are not attached, we guess that the source is a
+  // sibling directory to this source root.
+  #define PANDA_SOURCE $[standardize $[TOPDIR]/../panda]
+#endif
+
+// Where should we install DIRECT?
+#if $[or $[CTPROJS],$[DIRECT]]
+  #define DIRECT_INSTALL $[DIRECT]
+  #define DIRECT_INSTALL_OTHER $(DIRECT)
+  #if $[eq $[DIRECT],]
+    #error You seem to be attached to some trees, but not DIRECT!
+  #endif
+#else
+  #defer DIRECT_INSTALL $[INSTALL_DIR]
+  #defer DIRECT_INSTALL_OTHER $[INSTALL_DIR]
+#endif
+
+
+// Define the inter-tree dependencies.
+#define NEEDS_TREES $[NEEDS_TREES] panda
 
 
 // Also get the PANDA Package file and everything that includes.
-#if $[not $[isdir $[PANDA]]]
-  #error Directory defined by $PANDA not found!  Are you attached properly?
+#if $[not $[isfile $[PANDA_SOURCE]/Package.pp]]
+  #error PANDA source directory not found!  Are you attached properly?
 #endif
 
-#include $[PANDA]/Package.pp
+#include $[PANDA_SOURCE]/Package.pp

+ 1 - 1
direct/src/configfiles/Sources.pp

@@ -1,2 +1,2 @@
-#define INSTALL_DATA \
+#define INSTALL_CONFIG \
   direct.init Configrc

+ 1 - 1
direct/src/showbase/Sources.pp

@@ -1,7 +1,7 @@
 #begin lib_target
   #define TARGET showbase
   #define LOCAL_LIBS \
-    pandatoolbase
+    directbase
   #define OTHER_LIBS \
     linmath:c putil:c express:c panda:m pandaexpress:m dtool
 

+ 28 - 0
dtool/Config.Irix.pp

@@ -6,6 +6,9 @@
 // etc.
 //
 
+// What additional flags should we pass to interrogate?
+#define -D__mips__ -D__MIPSEB__
+
 // Is the platform big-endian (like an SGI workstation) or
 // little-endian (like a PC)?  Define this to the empty string to
 // indicate little-endian, or nonempty to indicate big-endian.
@@ -31,6 +34,27 @@
 // Can we determine the terminal width by making an ioctl(TIOCGWINSZ) call?
 #define IOCTL_TERMINAL_WIDTH 1
 
+// Do the compiler or the system headers define a "streamsize" typedef?
+#define HAVE_STREAMSIZE
+
+// Can we safely call getenv() at static init time?
+#define STATIC_INIT_GETENV 1
+
+// Can we read the file /proc/self/environ to determine our
+// environment variables at static init time?
+#define HAVE_PROC_SELF_ENVIRON
+
+// Do we have a global pair of argc/argv variables that we can read at
+// static init time?  Should we prototype them?  What are they called?
+#define HAVE_GLOBAL_ARGV 1
+#define PROTOTYPE_GLOBAL_ARGV 1
+#define GLOBAL_ARGV __Argv
+#define GLOBAL_ARGC __Argc
+
+// Can we read the file /proc/self/cmdline to determine our
+// command-line arguments at static init time?
+#define HAVE_PROC_SELF_CMDLINE
+
 // Should we include <iostream> or <iostream.h>?  Define HAVE_IOSTREAM
 // to nonempty if we should use <iostream>, or empty if we should use
 // <iostream.h>.
@@ -56,3 +80,7 @@
 
 // Do we have <unistd.h>?
 #define HAVE_UNISTD_H 1
+
+// Do we have <sys/soundcard.h> (and presumably a Linux-style audio
+// interface)?
+#define HAVE_SYS_SOUNDCARD_H

+ 28 - 0
dtool/Config.Linux.pp

@@ -6,6 +6,9 @@
 // etc.
 //
 
+// What additional flags should we pass to interrogate?
+#define SYSTEM_IGATE_FLAGS -D__i386__
+
 // Is the platform big-endian (like an SGI workstation) or
 // little-endian (like a PC)?  Define this to the empty string to
 // indicate little-endian, or nonempty to indicate big-endian.
@@ -31,6 +34,27 @@
 // Can we determine the terminal width by making an ioctl(TIOCGWINSZ) call?
 #define IOCTL_TERMINAL_WIDTH 1
 
+// Do the compiler or the system headers define a "streamsize" typedef?
+#define HAVE_STREAMSIZE 1
+
+// Can we safely call getenv() at static init time?
+#define STATIC_INIT_GETENV
+
+// Can we read the file /proc/self/environ to determine our
+// environment variables at static init time?
+#define HAVE_PROC_SELF_ENVIRON 1
+
+// Do we have a global pair of argc/argv variables that we can read at
+// static init time?  Should we prototype them?  What are they called?
+#define HAVE_GLOBAL_ARGV
+#define PROTOTYPE_GLOBAL_ARGV
+#define GLOBAL_ARGV
+#define GLOBAL_ARGC
+
+// Can we read the file /proc/self/cmdline to determine our
+// command-line arguments at static init time?
+#define HAVE_PROC_SELF_CMDLINE 1
+
 // Should we include <iostream> or <iostream.h>?  Define HAVE_IOSTREAM
 // to nonempty if we should use <iostream>, or empty if we should use
 // <iostream.h>.
@@ -56,3 +80,7 @@
 
 // Do we have <unistd.h>?
 #define HAVE_UNISTD_H 1
+
+// Do we have <sys/soundcard.h> (and presumably a Linux-style audio
+// interface)?
+#define HAVE_SYS_SOUNDCARD_H 1

+ 30 - 2
dtool/Config.Win32.pp

@@ -2,10 +2,13 @@
 // Config.Win32.pp
 //
 // This file defines some custom config variables for the Windows
-// platform.  It makes some initial guesses about compiler features,
-// etc.
+// platform, using MS VC++.  It makes some initial guesses about
+// compiler features, etc.
 //
 
+// What additional flags should we pass to interrogate?
+#define SYSTEM_IGATE_FLAGS -longlong __int64 -D_X86_ -DWIN32_VC -D"_declspec(param)="
+
 // Is the platform big-endian (like an SGI workstation) or
 // little-endian (like a PC)?  Define this to the empty string to
 // indicate little-endian, or nonempty to indicate big-endian.
@@ -31,6 +34,27 @@
 // Can we determine the terminal width by making an ioctl(TIOCGWINSZ) call?
 #define IOCTL_TERMINAL_WIDTH
 
+// Do the compiler or the system headers define a "streamsize" typedef?
+#define HAVE_STREAMSIZE 1
+
+// Can we safely call getenv() at static init time?
+#define STATIC_INIT_GETENV 1
+
+// Can we read the file /proc/self/environ to determine our
+// environment variables at static init time?
+#define HAVE_PROC_SELF_ENVIRON
+
+// Do we have a global pair of argc/argv variables that we can read at
+// static init time?  Should we prototype them?  What are they called?
+#define HAVE_GLOBAL_ARGV 1
+#define PROTOTYPE_GLOBAL_ARGV
+#define GLOBAL_ARGV __argv
+#define GLOBAL_ARGC __argc
+
+// Can we read the file /proc/self/cmdline to determine our
+// command-line arguments at static init time?
+#define HAVE_PROC_SELF_CMDLINE
+
 // Should we include <iostream> or <iostream.h>?  Define HAVE_IOSTREAM
 // to nonempty if we should use <iostream>, or empty if we should use
 // <iostream.h>.
@@ -56,3 +80,7 @@
 
 // Do we have <unistd.h>?
 #define HAVE_UNISTD_H
+
+// Do we have <sys/soundcard.h> (and presumably a Linux-style audio
+// interface)?
+#define HAVE_SYS_SOUNDCARD_H

+ 159 - 9
dtool/Config.pp

@@ -33,6 +33,22 @@
 // makefiles and their ilk.
 // 
 
+// Some of the variables below are defined using the #define command,
+// and others are defined using #defer.  The two are very similar in
+// their purpose; the difference is that, if the variable definition
+// includes references to other variables (e.g. $[varname]), then
+// #define will evaluate all of the other variable references
+// immediately and store the resulting expansion, while #defer will
+// store only the variable references themselves, and expand them when
+// the variable is later referenced.  It is very similar to the
+// relationship between := and = in GNU Make.
+//
+// In general, #defer is used in this file, to allow the user to
+// redefine critical variables in his or her own Config.pp file.
+
+
+
+
 // What kind of build scripts are we generating?  This selects a
 // suitable template file from the ppremake system files.  The
 // allowable choices, at present, are:
@@ -40,18 +56,21 @@
 //  autoconf  - Generate configure.in and a series of Makefile.am files,
 //              suitable for using with autoconf/automake.  Not quite
 //              there yet.
-//  stopgap   - Generate original Cary-style Makefile/Makefile.install/etc.
+//  stopgap   - Generate original Frang-style Makefile/Makefile.install/etc.
 //              files, to ease transition to the new system.
+//  unix      - Generate makefiles suitable for most Unix platforms,
+//              without using autoconf.
 //
 #define BUILD_TYPE stopgap
 
-// Define the directory in which the system ppremake files are
-// installed.
-#define PPREMAKE_DIR /usr/local/panda/share
-
 
-// In which directory should this package be installed when you type
-// "make install"?  This has no meaning when BUILD_TYPE is "stopgap".
+// What is the default install directory for all trees in the Panda
+// suite?  You may also override this for a particular tree by
+// defining a variable name like DTOOL_INSTALL or PANDA_INSTALL.  This
+// variable will have no effect when you are using the cttools to
+// control your attachment to the trees; in this case, the install
+// directory for each tree will by default be the root of the tree
+// itself (although this may be overridden).
 #define INSTALL_DIR /usr/local/panda
 
 
@@ -67,7 +86,7 @@
 // Setting this has no effect when BUILD_TYPE is "stopgap".  In this
 // case, the compiler optimizations are selected by setting the
 // environment variable OPTIMIZE accordingly at compile time.
-#define OPTIMIZE 1
+#define OPTIMIZE 2
 
 
 
@@ -88,6 +107,16 @@
 // themselves (you can explicitly define a HAVE_* variable to some
 // nonempty string to force the package to be marked as installed).
 
+
+// Do you want to generate a C-callable interrogate interface?  This
+// is not presently used by any VR Studio code.
+#define INTERROGATE_C_INTERFACE
+
+// Do you want to generate a Python-callable interrogate interface?
+// This is done only if HAVE_PYTHON, below, is also true.
+#define INTERROGATE_PYTHON_INTERFACE 1
+
+
 // Is Python installed, and should Python interfaces be generated?  If
 // Python is installed, which directory is it in?  (If the directory
 // is someplace standard like /usr/include, you may leave it blank.)
@@ -121,7 +150,7 @@
 // Is OpenGL installed, and where?  This should include libGL as well
 // as libGLU, if they are in different places.
 #define GL_IPATH
-#define GL_LPATH
+#define GL_LPATH /usr/X11R6/lib
 #if $[eq $[PLATFORM],Win32]
   #define GL_LIBS \
      opengl32.lib glu32.lib winmm.lib kernel32.lib \
@@ -206,6 +235,127 @@
 #defer HAVE_MAYA $[isdir $[MAYA_LOCATION]]
 
 
+///////////////////////////////////////////////////////////////////////
+// The following variables are only meaningful when BUILD_TYPE is
+// "unix".  These define the commands to invoke the compiler, linker,
+// etc.
+//////////////////////////////////////////////////////////////////////
+
+// How to invoke the C and C++ compilers.
+#defer CC gcc
+#defer CXX g++
+
+// How to invoke bison and flex.  Panda takes advantage of some
+// bison/flex features, and therefore specifically requires bison and
+// flex, not some other versions of yacc and lex.
+#defer BISON bison
+#defer FLEX flex 
+
+// How to invoke sed.  A few make rules use this.
+#defer SED sed
+
+// How to compile a C or C++ file into a .o file.  $[target] is the
+// name of the .o file, $[source] is the name of the source file,
+// $[ipath] is a space-separated list of directories to search for
+// include files, and $[flags] is a list of additional flags to pass
+// to the compiler.
+#defer COMPILE_C $[CC] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
+#defer COMPILE_C++ $[CXX] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
+
+// What additional flags should be passed to both C and C++ compilers
+// when OPTIMIZE (above) is defined for each of its four values?
+#defer CFLAGS_OPT1 -Wall -g
+#defer CFLAGS_OPT2 -Wall -g -O2
+#defer CFLAGS_OPT3 -O2
+#defer CFLAGS_OPT4 -O2 -DNDEBUG
+
+// What additional flags should be passed to both compilers when
+// building shared (relocatable) sources?  Some architectures require
+// special support for this.
+#defer CFLAGS_SHARED -fPIC
+
+// What directory name (within each source directory) should the .o
+// files be written to, for both shared and static sources?  In
+// general, it is safe to define these to be the same.  However, don't
+// define these to be '.', or you will be very sad the next time you
+// run 'make clean'.
+#defer ODIR Opt$[OPTIMIZE]-$[PLATFORM]
+#defer ODIR_SHARED $[ODIR]
+#defer ODIR_STATIC $[ODIR]
+
+// How to generate a C or C++ executable from a collection of .o
+// files.  $[target] is the name of the binary to generate, and
+// $[sources] is the list of .o files.  $[libs] is a space-separated
+// list of dependent libraries, and $[lpath] is a space-separated list
+// of directories in which those libraries can be found.
+#defer LINK_BIN_C $[CC] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
+#defer LINK_BIN_C++ $[CXX] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
+
+// How to generate a static C or C++ library.  $[target] is the
+// name of the library to generate, and $[sources] is the list of .o
+// files that will go into the library.
+#defer STATIC_LIB_C ar cru $[target] $[sources]
+#defer STATIC_LIB_C++ ar cru $[target] $[sources]
+
+// How to run ranlib, if necessary, after generating a static library.
+// $[target] is the name of the library.  Set this to the empty string
+// if ranlib is not necessary on your platform.
+#defer RANLIB ranlib $[target]
+
+// How to generate a shared C or C++ library.  $[source] and $[target]
+// as above, and $[libs] is a space-separated list of dependent
+// libraries, and $[lpath] is a space-separated list of directories in
+// which those libraries can be found.
+#defer SHARED_LIB_C $[CC] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
+#defer SHARED_LIB_C++ $[CXX] -shared -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
+
+// How to install a data file or executable file.  $[local] is the
+// local name of the file to install, and $[dest] is the name of the
+// directory to put it in.
+#defer INSTALL install -m 644 $[local] $[dest]
+#defer INSTALL_PROG install -m 755 $[local] $[dest]
+
+// When building under Irix, we assume you want to use the MIPSPro
+// compiler.  Comment this bit out (or redefine the variables
+// yourself) if you'd rather use gcc or some other compiler.
+#if $[eq $[PLATFORM],Irix]
+  #defer CC cc -n32
+  #defer CXX CC -n32
+    
+  // Turn off a few annoying warning messages.
+  // 1174 - function 'blah' was declared but never used
+  // 1201 - trailing comma is nonstandard.
+  // 1209 - controlling expression is constant, e.g. if (0) { ... }
+  // 1234 - access control not specified, 'public' by default
+  // 1355 - extra ";" ignored
+  // 1375 - destructor for base class is not virtual.
+  //    this one actually is bad.  But we got alot of them from the classes
+  //    that we've derived from STL collections.  Beware of this.
+  // 3322 - omission of explicit type is nonstandard ("int" assumed)
+  #define WOFF_LIST -woff 1174,1201,1209,1234,1355,1375,3322
+
+  // Linker warnings
+  // 85 - definition of SOMESYMBOL in SOMELIB preempts that of definition in
+  //      SOMEOTHERLIB.
+  #define WOFF_LIST $[WOFF_LIST] -Wl,-LD_MSG:off=85
+  
+  #defer CFLAGS_OPT1 $[WOFF_LIST] -g
+  #defer CFLAGS_OPT2 $[WOFF_LIST] -O2 -OPT:Olimit=2500
+  #defer CFLAGS_OPT3 $[WOFF_LIST] -O2 -OPT:Olimit=2500
+  #defer CFLAGS_OPT4 $[WOFF_LIST] -O2 -OPT:Olimit=2500 -DNDEBUG
+  
+  #defer CFLAGS_SHARED
+  
+  #defer STATIC_LIB_C $[CC] -ar -o $[target] $[sources]
+  #defer STATIC_LIB_C++ $[CXX] -ar -o $[target] $[sources]
+  #defer RANLIB
+  
+  #define SHARED_FLAGS -Wl,-none -Wl,-update_registry,$[TOPDIR]/so_locations
+  #defer SHARED_LIB_C $[CC] -shared $[SHARED_FLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
+  #defer SHARED_LIB_C++ $[CXX] -shared $[SHARED_FLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
+#endif
+
+
 //////////////////////////////////////////////////////////////////////
 // There are also some additional variables that control specific
 // compiler/platform features or characteristics, defined in the

+ 55 - 166
dtool/LocalSetup.pp

@@ -11,233 +11,122 @@
 
 #if $[ne $[BUILD_TYPE],autoconf]
 
-// A couple of variables to output the C #define and #undef
-// directives, since we can't type them literally.
-#define define #define
-#define undef #undef
-
-#output dtool_config.h
+#output dtool_config.h notouch
 #format straight
-/* dtool_config.h.  Generated automatically by $[PROGRAM] $[PROGVER] from $[SOURCEFILE]. */
-
-/* Define if you have the ANSI C header files.  */
-$[define] STDC_HEADERS 1
+/* dtool_config.h.  Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE]. */
 
 /* Define if your processor stores words with the most significant
    byte first (like Motorola and SPARC, unlike Intel and VAX).  */
-#if $[WORDS_BIGENDIAN]
-$[define] WORDS_BIGENDIAN 1
-#else
-$[undef] WORDS_BIGENDIAN
-#endif
-
-/* Define if the X Window System is missing or not being used.  */
-$[undef] X_DISPLAY_MISSING
-
-/* Define if lex declares yytext as a char * by default, not a char[].  */
-$[undef] YYTEXT_POINTER
+$[cdefine WORDS_BIGENDIAN]
 
 /* Define if the C++ compiler uses namespaces.  */
-#if $[HAVE_NAMESPACE]
-$[define] HAVE_NAMESPACE 1
-#else
-$[undef] HAVE_NAMESPACE
-#endif
+$[cdefine HAVE_NAMESPACE]
 
 /* Define if the C++ iostream library supports ios::binary.  */
-#if $[HAVE_IOS_BINARY]
-$[define] HAVE_IOS_BINARY 1
-#else
-$[undef] HAVE_IOS_BINARY
-#endif
+$[cdefine HAVE_IOS_BINARY]
 
 /* Define if we have Python installed.  */
-#if $[HAVE_PYTHON]
-$[define] HAVE_PYTHON 1
-#else
-$[undef] HAVE_PYTHON
-#endif
+$[cdefine HAVE_PYTHON]
 
 /* Define if we have NSPR installed.  */
-#if $[HAVE_NSPR]
-$[define] HAVE_NSPR 1
-#else
-$[undef] HAVE_NSPR
-#endif
+$[cdefine HAVE_NSPR]
 
 /* Define if we have VRPN installed.  */
-#if $[HAVE_VRPN]
-$[define] HAVE_VRPN 1
-#else
-$[undef] HAVE_VRPN
-#endif
+$[cdefine HAVE_VRPN]
 
 /* Define if we have zlib installed.  */
-#if $[HAVE_ZLIB]
-$[define] HAVE_ZLIB 1
-#else
-$[undef] HAVE_ZLIB
-#endif
+$[cdefine HAVE_ZLIB]
 
 /* Define if we have sox libst installed.  */
-#if $[HAVE_SOXST]
-$[define] HAVE_SOXST 1
-#else
-$[undef] HAVE_SOXST
-#endif
+$[cdefine HAVE_SOXST]
 
 /* Define if we have OpenGL installed and want to build for GL.  */
-#if $[HAVE_GL]
-$[define] HAVE_GL 1
-#else
-$[undef] HAVE_GL
-#endif
+$[cdefine HAVE_GL]
 
 /* Define if we have GLX installed and want to build for GLX.  */
-#if $[HAVE_GLX]
-$[define] HAVE_GLX 1
-#else
-$[undef] HAVE_GLX
-#endif
+$[cdefine HAVE_GLX]
 
 /* Define if we have Glut installed and want to build for Glut.  */
-#if $[HAVE_GLUT]
-$[define] HAVE_GLUT 1
-#else
-$[undef] HAVE_GLUT
-#endif
+$[cdefine HAVE_GLUT]
 
 /* Define if we have DirectX installed and want to build for DX.  */
-#if $[HAVE_DX]
-$[define] HAVE_DX 1
-#else
-$[undef] HAVE_DX
-#endif
+$[cdefine HAVE_DX]
 
 /* Define if we want to build the Renderman interface.  */
-#if $[HAVE_RIB]
-$[define] HAVE_RIB 1
-#else
-$[undef] HAVE_RIB
-#endif
+$[cdefine HAVE_RIB]
 
 /* Define if we want to use mikmod for audio.  */
-#if $[HAVE_MIKMOD]
-$[define] HAVE_MIKMOD 1
-#else
-$[undef] HAVE_MIKMOD
-#endif
+$[cdefine HAVE_MIKMOD]
 
 /* Define if we want to compile the net code.  */
-#if $[HAVE_NET]
-$[define] HAVE_NET 1
-#else
-$[undef] HAVE_NET
-#endif
+$[cdefine HAVE_NET]
 
 /* Define if we want to compile the audio code.  */
-#if $[HAVE_AUDIO]
-$[define] HAVE_AUDIO 1
-#else
-$[undef] HAVE_AUDIO
-#endif
+$[cdefine HAVE_AUDIO]
 
 /* Define if we have a gettimeofday() function. */
-#if $[HAVE_GETTIMEOFDAY]
-$[define] HAVE_GETTIMEOFDAY 1
-#else
-$[undef] HAVE_GETTIMEOFDAY
-#endif
+$[cdefine HAVE_GETTIMEOFDAY]
 
 /* Define if gettimeofday() takes only one parameter. */
-#if $[GETTIMEOFDAY_ONE_PARAM]
-$[define] GETTIMEOFDAY_ONE_PARAM 1
-#else
-$[undef] GETTIMEOFDAY_ONE_PARAM
-#endif
+$[cdefine GETTIMEOFDAY_ONE_PARAM]
 
 /* Define if you have the getopt function.  */
-#if $[HAVE_GETOPT]
-$[define] HAVE_GETOPT 1
-#else
-$[undef] HAVE_GETOPT
-#endif
+$[cdefine HAVE_GETOPT]
 
 /* Define if you have the getopt_long_only function.  */
-#if $[HAVE_GETOPT_LONG_ONLY]
-$[define] HAVE_GETOPT_LONG_ONLY 1
-#else
-$[undef] HAVE_GETOPT_LONG_ONLY
-#endif
+$[cdefine HAVE_GETOPT_LONG_ONLY]
 
 /* Define if you have ioctl(TIOCGWINSZ) to determine terminal width. */
-#if $[IOCTL_TERMINAL_WIDTH]
-$[define] IOCTL_TERMINAL_WIDTH 1
-#else
-$[undef] IOCTL_TERMINAL_WIDTH
-#endif
+$[cdefine IOCTL_TERMINAL_WIDTH]
+
+/* Do the compiler or the system headers define a "streamsize" typedef? */
+$[cdefine HAVE_STREAMSIZE]
+
+/* Can we safely call getenv() at static init time? */
+$[cdefine STATIC_INIT_GETENV]
+
+/* Can we read the file /proc/self/environ to determine our
+   environment variables at static init time? */
+$[cdefine HAVE_PROC_SELF_ENVIRON]
+
+/* Do we have a global pair of argc/argv variables that we can read at
+   static init time?  Should we prototype them?  What are they called? */
+$[cdefine HAVE_GLOBAL_ARGV]
+$[cdefine PROTOTYPE_GLOBAL_ARGV]
+$[cdefine GLOBAL_ARGV]
+$[cdefine GLOBAL_ARGC]
+
+/* Can we read the file /proc/self/cmdline to determine our
+   command-line arguments at static init time? */
+$[cdefine HAVE_PROC_SELF_CMDLINE]
 
 /* Define if you have the <io.h> header file.  */
-#if $[HAVE_IO_H]
-$[define] HAVE_IO_H 1
-#else
-$[undef] HAVE_IO_H
-#endif
+$[cdefine HAVE_IO_H]
 
 /* Define if you have the <iostream> header file.  */
-#if $[HAVE_IOSTREAM]
-$[define] HAVE_IOSTREAM 1
-#else
-$[undef] HAVE_IOSTREAM
-#endif
+$[cdefine HAVE_IOSTREAM]
 
 /* Define if you have the <malloc.h> header file.  */
-#if $[HAVE_MALLOC_H]
-$[define] HAVE_MALLOC_H 1
-#else
-$[undef] HAVE_MALLOC_H
-#endif
+$[cdefine HAVE_MALLOC_H]
 
 /* Define if you have the <alloca.h> header file.  */
-#if $[HAVE_ALLOCA_H]
-$[define] HAVE_ALLOCA_H 1
-#else
-$[undef] HAVE_ALLOCA_H
-#endif
+$[cdefine HAVE_ALLOCA_H]
 
 /* Define if you have the <minmax.h> header file.  */
-#if $[HAVE_MINMAX_H]
-$[define] HAVE_MINMAX_H 1
-#else
-$[undef] HAVE_MINMAX_H
-#endif
+$[cdefine HAVE_MINMAX_H]
 
 /* Define if you have the <sstream> header file.  */
-#if $[HAVE_SSTREAM]
-$[define] HAVE_SSTREAM 1
-#else
-$[undef] HAVE_SSTREAM
-#endif
+$[cdefine HAVE_SSTREAM]
 
 /* Define if you have the <sys/types.h> header file.  */
-#if $[HAVE_SYS_TYPES]
-$[define] HAVE_SYS_TYPES 1
-#else
-$[undef] HAVE_SYS_TYPES
-#endif
+$[cdefine HAVE_SYS_TYPES]
 
 /* Define if you have the <unistd.h> header file.  */
-#if $[HAVE_UNISTD_H]
-$[define] HAVE_UNISTD_H 1
-#else
-$[undef] HAVE_UNISTD_H
-#endif
-
-/* Name of package */
-$[define] PACKAGE $[PACKAGE]
+$[cdefine HAVE_UNISTD_H]
 
-/* Version number of package */
-$[define] VERSION $[VERSION]
+/* Do we have <sys/soundcard.h> (and presumably a Linux-style audio
+   interface)? */
+$[cdefine HAVE_SYS_SOUNDCARD_H]
 
 #end dtool_config.h
 

+ 28 - 2
dtool/Package.pp

@@ -12,6 +12,10 @@
 // responsible for explicitly including all of the relevent Config.pp
 // files.
 
+// Check the version of ppremake in use.
+#if $[not $[>= $[PPREMAKE_VERSION],0.50]]
+  #error You need at least ppremake version 0.50 to process this tree.
+#endif
 
 // What is the name and version of this source tree?
 #if $[eq $[PACKAGE],]
@@ -19,6 +23,29 @@
   #define VERSION 0.80
 #endif
 
+// Where should install DTOOL, specifically?
+#if $[or $[CTPROJS],$[DTOOL]]
+  // If we are presently attached, use the environment variable.
+  // We define two variables: one for ourselves, which burns in the
+  // current value of the DTOOL environment variable (so that any
+  // attempt to install in this tree will install correctly, no
+  // matter whether we are attached to a different DTOOL later by
+  // mistake), and one for other trees to use, which expands to a
+  // ordinary reference to the DTOOL environment variable, so
+  // they will read from the right tree no matter which DTOOL they're
+  // attached to.
+  #define DTOOL_INSTALL $[DTOOL]
+  #define DTOOL_INSTALL_OTHER $(DTOOL)
+  #if $[eq $[DTOOL],]
+    #error You seem to be attached to some trees, but not DTOOL!
+  #endif
+#else
+  // Otherwise, if we are not attached, install in the standard place
+  // (unless the user specifies otherwise).
+  #defer DTOOL_INSTALL $[INSTALL_DIR]
+  #defer DTOOL_INSTALL_OTHER $[INSTALL_DIR]
+#endif
+
 
 // Pull in the package-level Config file.  This contains a lot of
 // configuration variables that the user might want to fine-tune.
@@ -69,7 +96,6 @@
   #define MIKMOD_LIBS $[patsubst -l%,%,$[filter -l%,$[libs]]]
 #endif
 
-// Now infer a few more variables based on what was defined.
 #if $[and $[HAVE_GTKMM],$[GTKMM_CONFIG]]
   #define cflags $[shell $[GTKMM_CONFIG] --cflags]
   #define libs $[shell $[GTKMM_CONFIG] --libs]
@@ -82,4 +108,4 @@
 
 
 // Finally, include the system configure file.
-#include $[PPREMAKE_DIR]/System.pp
+#include $[THISDIRPREFIX]pptempl/System.pp

+ 43 - 0
dtool/pptempl/Depends.pp

@@ -0,0 +1,43 @@
+//
+// Depends.pp
+//
+// This file is loaded and run after each Sources.pp is read.  It
+// defines the inter-directory dependencies, which is useful for
+// determining build order.
+//
+
+#if $[or $[eq $[DIR_TYPE], src], $[eq $[DIR_TYPE], metalib]]
+#if $[eq $[DEPEND_DIRS],]
+  // Allow the user to define additional EXTRA_DEPENDS targets in each
+  // Sources.pp.
+  #define DEPEND_DIRS $[EXTRA_DEPENDS]
+  #define DEPENDABLE_HEADERS
+
+  #forscopes metalib_target static_lib_target lib_target noinst_lib_target bin_target noinst_bin_target
+    // We can optimize quite a bit by evaluating now several of the key
+    // deferred variables defined in Globals.pp.  This way they won't need
+    // to get repeatedly reevaluated as each directory examines each
+    // other.
+    #define build_directory $[build_directory]
+    #define build_target $[build_target]
+    #define active_local_libs $[active_local_libs]
+    #define active_component_libs $[active_component_libs]
+    #define active_libs $[active_libs]
+    #define get_sources $[get_sources]
+
+    // Report a warning for nonexisting dependencies.
+    #define nonexisting $[unmapped all_libs,$[LOCAL_LIBS]]
+    #if $[ne $[nonexisting],]
+Warning: Lib(s) $[nonexisting], referenced in $[DIRNAME]/$[TARGET], not found.
+    #endif
+
+    #set DEPEND_DIRS $[DEPEND_DIRS] $[all_libs $[DIRNAME],$[LOCAL_LIBS] $[COMPONENT_LIBS]] $[LOCAL_INCS]
+    #set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[SOURCES]]
+
+  #end metalib_target static_lib_target lib_target noinst_lib_target bin_target noinst_bin_target
+
+  #set DEPEND_DIRS $[sort $[DEPEND_DIRS]]
+  #set DEPENDABLE_HEADERS $[sort $[DEPENDABLE_HEADERS]]
+#endif
+
+#endif // DIR_TYPE

+ 405 - 0
dtool/pptempl/Global.pp

@@ -0,0 +1,405 @@
+//
+// global.pp
+//
+// This file is read in before any of the individual Sources.pp files
+// are read.  It defines a few global variables that are useful to all
+// different kinds of build_types.
+//
+
+
+// We start off by defining a number of map variables.  These are
+// special variables that can be used to look up a particular named
+// scope according to a key (that is, according to the value of some
+// variable defined within the scope).
+
+// A named scope is defined using the #begin name .. #end name
+// sequence.  In general, we use these sequences in the various
+// Sources.pp files to define the various targets to build.  Each
+// named scope carries around its set of variable declarations.  The
+// named scopes are associated with the dirname of the directory in
+// which the Sources.pp file was found.
+
+
+// The first map variable lets us look up a particular library target
+// by its target name.  The syntax here indicates that we are
+// declaring a map variable called "all_libs" whose key is the
+// variable $[TARGET] as defined in each instance of a named scope
+// called "static_lib_target," "lib_target," and so on in every
+// Sources.pp file.  (The */ refers to all the Sources.pp files.  We
+// could also identify a particular file by its directory name, or
+// omit the slash to refer to our own Sources.pp file.)
+
+// After defining this map variable, we can look up other variables
+// that are defined for the corresponding target.  For instances,
+// $[all_libs $[SOURCES],dconfig] will return the value of the SOURCES
+// variable as set for the dconfig library (that is, the expression
+// $[SOURCES] is evaluated within the named scope whose key is
+// "dconfig"--whose variable $[TARGET] was defined to be "dconfig").
+#map all_libs TARGET(*/static_lib_target */lib_target */noinst_lib_target */metalib_target)
+
+// These allow us to determine whether a particular local library is a
+// static or a dynamic library.  If the library name appears in the
+// static_libs map, it is a static library (i.e. libname.a);
+// otherwise, it is a dynamic library (libname.so).
+#map static_libs TARGET(*/static_lib_target)
+#map dynamic_libs TARGET(*/lib_target */noinst_lib_target */metalib_target)
+
+// This lets us identify which metalib, if any, is including each
+// named library.  That is, $[module $[TARGET],name] will return
+// the name of the metalib that includes library name.
+#map module COMPONENT_LIBS(*/metalib_target)
+
+// This lets up look up components of a particular metalib.
+#map components TARGET(*/lib_target */noinst_lib_target)
+
+// And this lets us look up source directories by dirname.
+#map dirnames DIRNAME(*/)
+
+
+// Define some various compile flags, derived from the variables set
+// in Config.pp.
+#set INTERROGATE_PYTHON_INTERFACE $[and $[HAVE_PYTHON],$[INTERROGATE_PYTHON_INTERFACE]]
+#define run_interrogate $[or $[INTERROGATE_C_INTERFACE],$[INTERROGATE_PYTHON_INTERFACE]]
+
+#if $[HAVE_PYTHON]
+  #define python_ipath $[wildcard $[PYTHON_IPATH]]
+  #define python_lpath $[wildcard $[PYTHON_LPATH]]
+#endif
+
+#if $[HAVE_NSPR]
+  #define nspr_ipath $[wildcard $[NSPR_IPATH]]
+  #define nspr_lpath $[wildcard $[NSPR_LPATH]]
+  #define nspr_libs $[NSPR_LIBS]
+#endif
+
+#if $[HAVE_ZLIB]
+  #define zlib_ipath $[wildcard $[ZLIB_IPATH]]
+  #define zlib_lpath $[wildcard $[ZLIB_LPATH]]
+  #define zlib_libs $[ZLIB_LIBS]
+#endif
+
+#if $[HAVE_SOXST]
+  #define soxst_ipath $[wildcard $[SOXST_IPATH]]
+  #define soxst_lpath $[wildcard $[SOXST_LPATH]]
+  #define soxst_libs $[SOXST_LIBS]
+#endif
+
+#if $[HAVE_GL]
+  #define gl_ipath $[wildcard $[GL_IPATH]]
+  #define gl_lpath $[wildcard $[GL_LPATH]]
+  #define gl_libs $[GL_LIBS]
+#endif
+
+#if $[HAVE_DX]
+  #define dx_ipath $[wildcard $[DX_IPATH]]
+  #define dx_lpath $[wildcard $[DX_LPATH]]
+  #define dx_libs $[DX_LIBS]
+#endif
+
+#if $[HAVE_VRPN]
+  #define vrpn_ipath $[wildcard $[VRPN_IPATH]]
+  #define vrpn_lpath $[wildcard $[VRPN_LPATH]]
+  #define vrpn_cflags $[VRPN_CFLAGS]
+  #define vrpn_libs $[VRPN_LIBS]
+#endif
+
+#if $[HAVE_MIKMOD]
+  #define mikmod_ipath $[wildcard $[MIKMOD_IPATH]]
+  #define mikmod_lpath $[wildcard $[MIKMOD_LPATH]]
+  #define mikmod_cflags $[MIKMOD_CFLAGS]
+  #define mikmod_libs $[MIKMOD_LIBS]
+#endif
+
+#if $[HAVE_GTKMM]
+  #define gtkmm_ipath $[wildcard $[GTKMM_IPATH]]
+  #define gtkmm_lpath $[wildcard $[GTKMM_LPATH]]
+  #define gtkmm_cflags $[GTKMM_CFLAGS]
+  #define gtkmm_libs $[GTKMM_LIBS]
+#endif
+
+#if $[and $[HAVE_MAYA],$[MAYA_LOCATION]]
+  #define maya_ipath -I$[MAYA_LOCATION]/include
+  #define maya_lpath -L$[MAYA_LOCATION]/lib
+  #define maya_ld $[MAYA_LOCATION]/bin/mayald
+#endif
+
+#if $[HAVE_NET]
+  #define net_ipath $[wildcard $[NET_IPATH]]
+  #define net_lpath $[wildcard $[NET_LPATH]]
+  #define net_libs $[NET_LIBS]
+#endif
+
+#if $[HAVE_AUDIO]
+  #define audio_ipath $[wildcard $[AUDIO_IPATH]]
+  #define audio_lpath $[wildcard $[AUDIO_LPATH]]
+  #define audio_libs $[AUDIO_LIBS]
+#endif
+
+
+// This variable, when evaluated in the scope of a particular directory,
+// will indicate true (i.e. nonempty) when the directory is truly built,
+// or false (empty) when the directory is not to be built.
+#defer build_directory \
+ $[and \
+     $[or $[not $[DIRECTORY_IF_PYTHON]],$[HAVE_PYTHON]], \
+     $[or $[not $[DIRECTORY_IF_NSPR]],$[HAVE_NSPR]], \
+     $[or $[not $[DIRECTORY_IF_ZLIB]],$[HAVE_ZLIB]], \
+     $[or $[not $[DIRECTORY_IF_SOXST]],$[HAVE_SOXST]], \
+     $[or $[not $[DIRECTORY_IF_GL]],$[HAVE_GL]], \
+     $[or $[not $[DIRECTORY_IF_DX]],$[HAVE_DX]], \
+     $[or $[not $[DIRECTORY_IF_GLX]],$[HAVE_GLX]], \
+     $[or $[not $[DIRECTORY_IF_GLUT]],$[HAVE_GLUT]], \
+     $[or $[not $[DIRECTORY_IF_WGL]],$[HAVE_WGL]], \
+     $[or $[not $[DIRECTORY_IF_RIB]],$[HAVE_RIB]], \
+     $[or $[not $[DIRECTORY_IF_PS2]],$[HAVE_PS2]], \
+     $[or $[not $[DIRECTORY_IF_SGIGL]],$[HAVE_SGIGL]], \
+     $[or $[not $[DIRECTORY_IF_VRPN]],$[HAVE_VRPN]], \
+     $[or $[not $[DIRECTORY_IF_GTKMM]],$[HAVE_GTKMM]], \
+     $[or $[not $[DIRECTORY_IF_MAYA]],$[HAVE_MAYA]], \
+     $[or $[not $[DIRECTORY_IF_NET]],$[HAVE_NET]], \
+     $[or $[not $[DIRECTORY_IF_AUDIO]],$[HAVE_AUDIO]], \
+      1 ]
+
+// This variable, when evaluated in the scope of a particular target,
+// will indicated true when the target should be built, or false when
+// the target is not to be built.
+#defer build_target \
+ $[and \
+     $[or $[not $[TARGET_IF_PYTHON]],$[HAVE_PYTHON]], \
+     $[or $[not $[TARGET_IF_NSPR]],$[HAVE_NSPR]], \
+     $[or $[not $[TARGET_IF_ZLIB]],$[HAVE_ZLIB]], \
+     $[or $[not $[TARGET_IF_SOXST]],$[HAVE_SOXST]], \
+     $[or $[not $[TARGET_IF_GL]],$[HAVE_GL]], \
+     $[or $[not $[TARGET_IF_DX]],$[HAVE_DX]], \
+     $[or $[not $[TARGET_IF_GLX]],$[HAVE_GLX]], \
+     $[or $[not $[TARGET_IF_GLUT]],$[HAVE_GLUT]], \
+     $[or $[not $[TARGET_IF_WGL]],$[HAVE_WGL]], \
+     $[or $[not $[TARGET_IF_RIB]],$[HAVE_RIB]], \
+     $[or $[not $[TARGET_IF_PS2]],$[HAVE_PS2]], \
+     $[or $[not $[TARGET_IF_SGIGL]],$[HAVE_SGIGL]], \
+     $[or $[not $[TARGET_IF_VRPN]],$[HAVE_VRPN]], \
+     $[or $[not $[TARGET_IF_GTKMM]],$[HAVE_GTKMM]], \
+     $[or $[not $[TARGET_IF_MAYA]],$[HAVE_MAYA]], \
+     $[or $[not $[TARGET_IF_NET]],$[HAVE_NET]], \
+     $[or $[not $[TARGET_IF_AUDIO]],$[HAVE_AUDIO]], \
+      1 ]
+
+// This takes advantage of the above two variables to get the actual
+// list of local libraries we are to link with, eliminating those that
+// won't be built.
+#defer active_local_libs \
+  $[all_libs $[if $[and $[build_directory],$[build_target]],$[TARGET]],$[LOCAL_LIBS]]
+#defer active_component_libs \
+  $[all_libs $[if $[and $[build_directory],$[build_target]],$[TARGET]],$[COMPONENT_LIBS]]
+#defer active_libs $[active_local_libs] $[active_component_libs]
+
+// This variable is true if we are building on some flavor of Unix.
+#define unix_platform $[ne $[PLATFORM],Win32]
+
+// This variable is true if we are building on some flavor of Windows.
+#define windows_platform $[eq $[PLATFORM],Win32]
+
+
+// This subroutine will set up the sources variable to reflect the
+// complete set of sources for this target, and also set the
+// alt_cflags, alt_libs, etc. as appropriate according to how the
+// various USE_* flags are set for the current target.
+
+// This variable returns the complete set of sources for the current
+// target.
+#defer get_sources \
+  $[SOURCES] \
+  $[if $[HAVE_ZLIB],$[IF_ZLIB_SOURCES]] \
+  $[if $[HAVE_PYTHON],$[IF_PYTHON_SOURCES]]
+
+// This variable returns the set of sources that are to be
+// interrogated for the current target.
+#defer get_igatescan \
+  $[if $[and $[run_interrogate],$[IGATESCAN]], \
+     $[if $[eq $[IGATESCAN], all], \
+      $[filter-out %.I %.lxx %.yxx %.N,$[get_sources]], \
+      $[IGATESCAN]]]
+
+// This variable returns the name of the interrogate database file
+// that will be generated for a particular target, or empty string if
+// the target is not to be interrogated.
+#defer get_igatedb \
+  $[if $[and $[run_interrogate],$[IGATESCAN]], \
+    lib$[TARGET].in]
+
+// This variable returns the name of the interrogate module, if the
+// current metalib target should include one, or empty string if it
+// should not.
+#defer get_igatemscan \
+  $[if $[and $[run_interrogate],$[components $[IGATESCAN],$[COMPONENT_LIBS]]], \
+    $[TARGET]]
+    
+
+
+// This function returns the appropriate cflags for the target, based
+// on the various external packages this particular target claims to
+// require.
+#defun get_cflags
+  #define alt_cflags $[nspr_cflags] $[python_cflags]
+  
+  #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[COMPONENT_LIBS]],]
+    #set alt_cflags $[alt_cflags] $[zlib_cflags]
+  #endif
+  #if $[ne $[USE_GL] $[components $[USE_GL],$[COMPONENT_LIBS]],]
+    #set alt_cflags $[alt_cflags] $[gl_cflags]
+  #endif
+  #if $[ne $[USE_DX] $[components $[USE_DX],$[COMPONENT_LIBS]],]
+    #set alt_cflags $[alt_cflags] $[dx_cflags]
+  #endif
+  #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[COMPONENT_LIBS]],]
+    #set alt_cflags $[alt_cflags] $[soxst_cflags]
+  #endif
+  #if $[ne $[USE_NET] $[components $[USE_NET],$[COMPONENT_LIBS]],]
+    #set alt_cflags $[alt_cflags] $[net_cflags]
+  #endif
+  #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[COMPONENT_LIBS]],]
+    #set alt_cflags $[alt_cflags] $[audio_cflags]
+  #endif
+  #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[COMPONENT_LIBS]],]
+    #set alt_cflags $[alt_cflags] $[mikmod_cflags]
+  #endif
+  #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[COMPONENT_LIBS]],]
+    #set alt_cflags $[alt_cflags] $[gtkmm_cflags]
+  #endif 
+  #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LIBS]],]
+    #set alt_cflags $[alt_cflags] $[maya_cflags]
+  #endif
+
+  $[alt_cflags]
+#end get_cflags
+
+// This function returns the appropriate include path for the target,
+// based on the various external packages this particular target
+// claims to require.  This returns a space-separated set of directory
+// names only; the -I switch is not included here.
+#defun get_ipath
+  #define alt_ipath $[nspr_ipath] $[python_ipath]
+  
+  #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[COMPONENT_LIBS]],]
+    #set alt_ipath $[alt_ipath] $[zlib_ipath]
+  #endif
+  #if $[ne $[USE_GL] $[components $[USE_GL],$[COMPONENT_LIBS]],]
+    #set alt_ipath $[alt_ipath] $[gl_ipath]
+  #endif
+  #if $[ne $[USE_DX] $[components $[USE_DX],$[COMPONENT_LIBS]],]
+    #set alt_ipath $[alt_ipath] $[dx_ipath]
+  #endif
+  #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[COMPONENT_LIBS]],]
+    #set alt_ipath $[alt_ipath] $[soxst_ipath]
+  #endif
+  #if $[ne $[USE_NET] $[components $[USE_NET],$[COMPONENT_LIBS]],]
+    #set alt_ipath $[alt_ipath] $[net_ipath]
+  #endif
+  #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[COMPONENT_LIBS]],]
+    #set alt_ipath $[alt_ipath] $[audio_ipath]
+  #endif
+  #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[COMPONENT_LIBS]],]
+    #set alt_ipath $[alt_ipath] $[mikmod_ipath]
+  #endif
+  #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[COMPONENT_LIBS]],]
+    #set alt_ipath $[alt_ipath] $[gtkmm_ipath]
+  #endif 
+  #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LIBS]],]
+    #set alt_ipath $[alt_ipath] $[maya_ipath]
+  #endif
+
+  $[alt_ipath]
+#end get_ipath
+
+// This function returns the appropriate library search path for the
+// target, based on the various external packages this particular
+// target claims to require.  This returns a space-separated set of
+// directory names only; the -L switch is not included here.
+#defun get_lpath
+  #define alt_lpath $[nspr_lpath] $[python_lpath]
+  
+  #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[COMPONENT_LIBS]],]
+    #set alt_lpath $[alt_lpath] $[zlib_lpath]
+  #endif
+  #if $[ne $[USE_GL] $[components $[USE_GL],$[COMPONENT_LIBS]],]
+    #set alt_lpath $[alt_lpath] $[gl_lpath]
+  #endif
+  #if $[ne $[USE_DX] $[components $[USE_DX],$[COMPONENT_LIBS]],]
+    #set alt_lpath $[alt_lpath] $[dx_lpath]
+  #endif
+  #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[COMPONENT_LIBS]],]
+    #set alt_lpath $[alt_lpath] $[soxst_lpath]
+  #endif
+  #if $[ne $[USE_NET] $[components $[USE_NET],$[COMPONENT_LIBS]],]
+    #set alt_lpath $[alt_lpath] $[net_lpath]
+  #endif
+  #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[COMPONENT_LIBS]],]
+    #set alt_lpath $[alt_lpath] $[audio_lpath]
+  #endif
+  #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[COMPONENT_LIBS]],]
+    #set alt_lpath $[alt_lpath] $[mikmod_lpath]
+  #endif
+  #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[COMPONENT_LIBS]],]
+    #set alt_lpath $[alt_lpath] $[gtkmm_lpath]
+  #endif 
+  #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LIBS]],]
+    #set alt_lpath $[alt_lpath] $[maya_lpath]
+  #endif
+
+  $[alt_lpath]
+#end get_lpath
+
+// This function returns the appropriate set of library names to link
+// with for the target, based on the various external packages this
+// particular target claims to require.  This returns a
+// space-separated set of library names only; the -l switch is not
+// included here.
+#defun get_libs
+  #define alt_libs $[nspr_libs] $[python_libs]
+  
+  #if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[COMPONENT_LIBS]],]
+    #set alt_libs $[alt_libs] $[zlib_libs]
+  #endif
+  #if $[ne $[USE_GL] $[components $[USE_GL],$[COMPONENT_LIBS]],]
+    #set alt_libs $[alt_libs] $[gl_libs]
+  #endif
+  #if $[ne $[USE_DX] $[components $[USE_DX],$[COMPONENT_LIBS]],]
+    #set alt_libs $[alt_libs] $[dx_libs]
+  #endif
+  #if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[COMPONENT_LIBS]],]
+    #set alt_libs $[alt_libs] $[soxst_libs]
+  #endif
+  #if $[ne $[USE_NET] $[components $[USE_NET],$[COMPONENT_LIBS]],]
+    #set alt_libs $[alt_libs] $[net_libs]
+  #endif
+  #if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[COMPONENT_LIBS]],]
+    #set alt_libs $[alt_libs] $[audio_libs]
+  #endif
+  #if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[COMPONENT_LIBS]],]
+    #set alt_libs $[alt_libs] $[mikmod_libs]
+  #endif
+  #if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[COMPONENT_LIBS]],]
+    #set alt_libs $[alt_libs] $[gtkmm_libs]
+  #endif 
+  #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LIBS]],]
+    #set alt_libs $[alt_libs] $[maya_libs]
+  #endif
+  #if $[unix_platform]
+    #set alt_libs $[alt_libs] $[UNIX_SYS_LIBS] $[components $[UNIX_SYS_LIBS],$[COMPONENT_LIBS]]
+  #endif
+
+  $[alt_libs]
+#end get_libs
+
+// This function returns the appropriate value for ld for the target.
+#defun get_ld
+  #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LD]],]
+    mayald
+  #endif
+#end get_ld
+
+
+// Include the global definitions for this particular build_type, if
+// the file is there.
+#sinclude $[GLOBAL_TYPE_FILE]
+

+ 167 - 0
dtool/pptempl/Global.stopgap.pp

@@ -0,0 +1,167 @@
+//
+// Global.stopgap.pp
+//
+// This file is read in before any of the individual Sources.pp files
+// are read.  It defines a few global variables to assist
+// Template.stopgap.pp.
+//
+
+// This subroutine fills sources, alt_cflags, alt_ipath, alt_lpath,
+// alt_libs, and alt_ld as appropriate for the current target.
+#define sources
+#define alt_cflags
+#define alt_ipath
+#define alt_lpath
+#define alt_libs
+#define alt_ld
+#defsub get_sources
+  #set sources $[get_sources]
+  #set alt_cflags $[get_cflags]
+  #set alt_ipath $[get_ipath]
+  #set alt_lpath $[get_lpath]
+  #set alt_libs $[get_libs]
+  #set alt_ld $[get_ld]
+#end get_sources
+
+// This subroutine will set when_defer, when_no_defer, and when_either
+// correctly to the set of libs we should link with for the current
+// target.
+#define when_defer
+#define when_no_defer
+#define when_either
+#defsub get_libs
+  // For the WHEN_DEFER case, we need to know the complete set of
+  // metalibs that encapsulates each of our LOCAL_LIBS.  In the case
+  // where a particular library is not part of a metalib, we include the
+  // library itself.
+  
+  #set when_defer
+  #foreach lib $[LOCAL_LIBS]
+    // Only consider libraries that we're actually building.
+    #if $[all_libs $[build_directory],$[lib]]
+      #define modmeta $[module $[TARGET],$[lib]]
+      #if $[ne $[modmeta],]
+        #set when_defer $[when_defer] $[modmeta]
+      #else
+        #set when_defer $[when_defer] $[lib]
+      #endif
+    #endif
+  #end lib
+  #set when_defer $[unique $[when_defer]] $[patsubst %:m,%,$[filter %:m,$[OTHER_LIBS]]]
+  
+  // Also filter out the libraries we don't want from when_no_defer, although
+  // we don't need to translate these to metalibs.
+  #set when_no_defer
+  #foreach lib $[COMPONENT_LIBS] $[LOCAL_LIBS]
+    #if $[all_libs $[build_directory],$[lib]]
+      #set when_no_defer $[when_no_defer] $[lib]
+    #endif
+  #end lib
+  #set when_no_defer $[unique $[when_no_defer]] $[patsubst %:c,%,$[filter %:c,$[OTHER_LIBS]]]
+  
+  // Finally, get the set of libraries that we want in either case.  At
+  // the moment, this is just the set of libraries in OTHER_LIBS that's
+  // not flagged with either a :c or a :m.
+  #set when_either $[filter-out %:m %:c,$[OTHER_LIBS]]
+#end get_libs
+
+
+// This subroutine converts depend_libs from a list of plain library names
+// to a list of the form libname.so or libname.a, according to whether the
+// named libraries are static or dynamic.
+#defsub convert_depend_libs
+  #define new_depend_libs
+  #foreach lib $[depend_libs]
+    // Make sure the library is something we're actually building.
+    #if $[all_libs $[build_directory],$[lib]]
+      #define libname $[static_libs lib$[TARGET].a,$[lib]] $[dynamic_libs lib$[TARGET].so,$[lib]]
+      #if $[eq $[libname],]
+  Warning: No such library $[lib], dependency of $[DIRNAME].
+      #else
+        #set new_depend_libs $[new_depend_libs] $[libname]
+      #endif
+    #endif
+  #end lib
+  #set depend_libs $[sort $[new_depend_libs]]
+#end convert_depend_libs
+
+
+// This subroutine determines the set of libraries our various targets
+// depend on.  This is a complicated definition.  It is the union of
+// all of our targets' dependencies, except:
+
+// If a target is part of a metalib, it depends (a) directly on all of
+// its normal library dependencies that are part of the same metalib,
+// and (b) indirectly on all of the metalibs that every other library
+// dependency is part of.  If a target is not part of a metalib, it is
+// the same as case (b) above.
+#define depend_libs
+#defsub get_depend_libs
+  #set depend_libs
+  #forscopes lib_target noinst_lib_target
+    #define metalib $[module $[TARGET],$[TARGET]]
+    #if $[ne $[metalib],]
+      // This library is included on a metalib.
+      #foreach depend $[LOCAL_LIBS]
+        #define depend_metalib $[module $[TARGET],$[depend]]
+        #if $[eq $[depend_metalib],$[metalib]]
+          // Here's a dependent library in the *same* metalib.
+          #set depend_libs $[depend_libs] $[depend]
+        #elif $[ne $[depend_metalib],]
+          // This dependent library is in a *different* metalib.
+          #set depend_libs $[depend_libs] $[depend_metalib]
+        #else
+          // This dependent library is not in any metalib.
+          #set depend_libs $[depend_libs] $[depend]
+        #endif
+      #end depend
+    #else
+      // This library is *not* included on a metalib.
+      #foreach depend $[LOCAL_LIBS]
+        #define depend_metalib $[module $[TARGET],$[depend]]
+        #if $[ne $[depend_metalib],]
+          // This dependent library is on a metalib.
+          #set depend_libs $[depend_libs] $[depend_metalib]
+        #else
+          // This dependent library is not in any metalib.
+          #set depend_libs $[depend_libs] $[depend]
+        #endif
+      #end depend
+    #endif
+  #end lib_target noinst_lib_target
+  
+  // These will never be part of a metalib.
+  #forscopes static_lib_target bin_target noinst_bin_target metalib_target
+    #foreach depend $[LOCAL_LIBS]
+      #define depend_metalib $[module $[TARGET],$[depend]]
+      #if $[ne $[depend_metalib],]
+        // This dependent library is on a metalib.
+        #set depend_libs $[depend_libs] $[depend_metalib]
+      #else
+        // This dependent library is not in any metalib.
+        #set depend_libs $[depend_libs] $[depend]
+      #endif
+    #end depend
+  #end static_lib_target bin_target noinst_bin_target metalib_target
+
+  // In case we're defining any metalibs, these depend directly on
+  // their components as well.
+  #set depend_libs $[depend_libs] $[COMPONENT_LIBS(metalib_target)]
+
+  // Now correct all the libraries listed in depend_libs to refer to a
+  // real library name.
+  #define new_depend_libs
+  #foreach lib $[sort $[depend_libs]]
+    // Make sure the library is something we're actually building.
+    #if $[all_libs $[build_directory],$[lib]]
+      #define libname $[static_libs lib$[TARGET].a,$[lib]] $[dynamic_libs lib$[TARGET].so,$[lib]]
+      #if $[eq $[libname],]
+  Warning: No such library $[lib], dependency of $[DIRNAME].
+      #else
+        #set new_depend_libs $[new_depend_libs] $[libname]
+      #endif
+    #endif
+  #end lib
+  #set depend_libs $[sort $[new_depend_libs]]
+
+#end get_depend_libs

+ 38 - 0
dtool/pptempl/Global.unix.pp

@@ -0,0 +1,38 @@
+//
+// Global.unix.pp
+//
+// This file is read in before any of the individual Sources.pp files
+// are read.  It defines a few global variables to assist
+// Template.unix.pp.
+//
+
+#define so_dir $[ODIR_SHARED]
+#define st_dir $[ODIR_STATIC]
+
+#define install_dir $[$[upcase $[PACKAGE]]_INSTALL]
+#if $[eq $[install_dir],]
+  #error Variable $[upcase $[PACKAGE]]_INSTALL is not set!  Cannot install!
+#endif
+
+#define other_trees
+#foreach tree $[NEEDS_TREES]
+  #define tree_install $[$[upcase $[tree]]_INSTALL]
+  #if $[eq $[tree_install],]
+Warning: Variable $[upcase $[tree]]_INSTALL is not set!
+  #else
+    #set other_trees $[other_trees] $[tree_install]
+  #endif
+#end tree
+
+#define install_lib_dir $[install_dir]/lib
+#define install_bin_dir $[install_dir]/bin
+#define install_headers_dir $[install_dir]/include
+#define install_data_dir $[install_dir]/shared
+#define install_igatedb_dir $[install_dir]/etc
+#define install_config_dir $[install_dir]/etc
+
+#if $[ne $[DTOOL_INSTALL],]
+  #define install_parser_inc_dir $[DTOOL_INSTALL]/include/parser-inc
+#else
+  #define install_parser_inc_dir $[install_headers_dir]/parser-inc
+#endif

+ 37 - 0
dtool/pptempl/System.pp

@@ -0,0 +1,37 @@
+//
+// System.pp
+//
+// This is a system-wide configure file for ppremake.  It's normally
+// #included from a package-specific Config.pp in the root of the
+// source tree.  It makes variable declarations that are not normally
+// user-editable, but are required to set up the normal processing of
+// ppremake.
+//
+
+
+// Define DIR_TYPE as "src", since that's the most common kind of source
+// file.
+#if $[eq $[DIR_TYPE],]
+  #define DIR_TYPE src
+#endif
+
+// Define where to look for the various kinds of system files.
+#if $[eq $[DEPENDS_FILE],]
+  #define DEPENDS_FILE $[THISDIRPREFIX]Depends.pp
+#endif
+
+#if $[eq $[GLOBAL_FILE],]
+  #define GLOBAL_FILE $[THISDIRPREFIX]Global.pp
+#endif
+
+#if $[eq $[GLOBAL_TYPE_FILE],]
+  #define GLOBAL_TYPE_FILE $[THISDIRPREFIX]Global.$[BUILD_TYPE].pp
+#endif
+
+#if $[eq $[TEMPLATE_FILE],]
+  #define TEMPLATE_FILE $[THISDIRPREFIX]Template.$[BUILD_TYPE].pp
+#endif
+
+#if $[eq $[DEPENDENCY_CACHE_FILENAME],]
+  #define DEPENDENCY_CACHE_FILENAME pp.dep
+#endif

+ 922 - 0
dtool/pptempl/Template.autoconf.pp

@@ -0,0 +1,922 @@
+//
+// Template.autoconf.pp
+//
+// This file defines the set of output files that will be generated to
+// support an autoconf/automake style build.  This works particularly
+// well when gcc/g++ will be used to compile, for instance on Linux.
+//
+
+#defer get_sys_libs $[subst -ldl,@libdl@,$[patsubst %,-l%,$[UNIX_SYS_LIBS]]]
+
+// First, check to see if the entire directory has been switched out.
+#define omit
+#if $[DIRECTORY_IF_GL]
+  #set omit $[not $[HAVE_GL]]
+#endif
+#if $[DIRECTORY_IF_GLX]
+  #set omit $[not $[HAVE_GLX]]
+#endif
+#if $[DIRECTORY_IF_WGL]
+  #set omit $[not $[HAVE_WGL]]
+#endif
+#if $[DIRECTORY_IF_GLUT]
+  #set omit $[not $[HAVE_GLUT]]
+#endif
+#if $[DIRECTORY_IF_SGIGL]
+  #set omit $[not $[HAVE_SGIGL]]
+#endif
+#if $[DIRECTORY_IF_DX]
+  #set omit $[not $[HAVE_DX]]
+#endif
+#if $[DIRECTORY_IF_PS2]
+  #set omit $[not $[HAVE_PS2]]
+#endif
+#if $[DIRECTORY_IF_RIB]
+  #set omit $[not $[HAVE_RIB]]
+#endif
+#if $[DIRECTORY_IF_VRPN]
+  #set omit $[not $[HAVE_VRPN]]
+#endif
+
+//////////////////////////////////////////////////////////////////////
+#if $[eq $[DIR_TYPE], src]
+//////////////////////////////////////////////////////////////////////
+
+// For a source directory, build a Makefile.am with a number of targets.
+
+#output Makefile.am
+#format makefile
+# Makefile.am generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+
+#if $[omit]
+  // If we're omitting the directory, everything becomes an extra_dist.  
+EXTRA_DIST = Sources.pp $[EXTRA_DIST] $[SOURCES(static_lib_target noinst_lib_target lib_target noinst_bin_target bin_target test_bin_target)]
+
+#else   // $[omit]
+
+// We define a map variable that allows us to look up all the libs in
+// the various directories by target name.  With this map variable, we
+// can translate the list of local_libs (which is simply a list of
+// library names, with no directory information), into a list of
+// relative filenames to each library.
+#map local_libs TARGET(*/static_lib_target */lib_target */noinst_lib_target)
+
+#define all_include_dirs
+
+lib_LTLIBRARIES = $[TARGET(static_lib_target lib_target):%=lib%.la]
+noinst_LTLIBRARIES = $[TARGET(noinst_lib_target):%=lib%.la]
+bin_PROGRAMS = $[TARGET(bin_target)]
+noinst_PROGRAMS = $[TARGET(noinst_bin_target)]
+EXTRA_PROGRAMS = $[TARGET(test_bin_target)]
+
+#if $[ne $[YACC_PREFIX],]
+YFLAGS = -d --name-prefix=$[YACC_PREFIX] $[YFLAGS]
+LFLAGS = -P$[YACC_PREFIX] -olex.yy.c $[LFLAGS]
+#else
+YFLAGS = -d $[YFLAGS]
+LFLAGS = $[LFLAGS]
+#endif
+
+#define alt_cflags @nspr_cflags@ @python_cflags@
+#define alt_lflags @nspr_lflags@
+#define alt_libs @nspr_libs@
+#if $[ne $[USE_ZLIB],]
+  #define alt_cflags $[alt_cflags] @zlib_cflags@
+  #define alt_lflags $[alt_lflags] @zlib_lflags@
+  #define alt_libs $[alt_libs] @zlib_libs@
+#endif
+#if $[ne $[USE_GL],]
+  #define alt_cflags $[alt_cflags] @gl_cflags@ @glut_cflags@
+  #define alt_lflags $[alt_lflags] @gl_lflags@ @glut_lflags@
+  #define alt_libs $[alt_libs] @gl_libs@ @glut_libs@
+#endif
+
+#define built_sources
+#define install_data
+
+#forscopes static_lib_target lib_target noinst_lib_target
+
+// This map variable lets us identify which metalib, if any, is
+// including this particular library.
+#map module LOCAL_LIBS(*/metalib_target)
+
+// And this defines the complete set of libs we depend on: the
+// LOCAL_LIBS we listed as directly depending on, plus all of the
+// LOCAL_LIBS *those* libraries listed, and so on.
+#define complete_local_libs $[closure local_libs,$[LOCAL_LIBS]]
+
+
+#if $[ne $[IF_ZLIB_SOURCES],]
+if HAVE_ZLIB
+EXTRA_ZLIB = $[IF_ZLIB_SOURCES]
+else
+EXTRA_ZLIB =
+endif
+#define SOURCES $[SOURCES] $(EXTRA_ZLIB)
+#endif
+
+#define local_incs $[local_libs $[RELDIR],$[complete_local_libs]] $[RELDIR($[LOCAL_INCS:%=%/])]
+
+// Check for interrogate.
+#if $[eq $[IGATESCAN], all]
+  #define IGATESCAN $[filter-out %.I %.lxx %.yxx %.N,$[SOURCES]]
+#endif
+#if $[ne $[IGATESCAN],]
+  #define IGATEFILE $[TARGET].in.cxx
+  #define IGATEDBFILE lib$[TARGET].in
+
+  #define IGATELIBRARY lib$[TARGET]
+  #define IGATEMODULE lib$[module $[TARGET],$[TARGET]]
+  #if $[eq $[IGATEMODULE], lib]
+    #define IGATEMODULE $[IGATELIBRARY]
+  #endif
+
+IGATESCAN = $[IGATESCAN]
+$[IGATEFILE] : $(IGATESCAN)
+	@dtool@/bin/interrogate $[IGATEFLAGS] @system_igate@ -DCPPPARSER -D__cplusplus -I@dtool@/include/parser-inc @trees_inc@ $[local_incs:%=-I%] $[alt_cflags] $[CDEFINES] -module "$[IGATEMODULE]" -library "$[IGATELIBRARY]" -oc $[IGATEFILE] -od $[IGATEDBFILE] -fnames -string -refcount -assert -promiscuous -python $(IGATESCAN)
+#set built_sources $[built_sources] $[IGATEFILE]
+#set install_data $[install_data] $[IGATEDBFILE]
+#endif
+
+  #define SOURCES $[SOURCES] $[IGATEFILE]
+
+lib$[TARGET]_la_SOURCES = $[SOURCES]
+lib$[TARGET]_la_LIBADD = $[OTHER_LIBS:%=-l%] $[alt_libs] $[get_sys_libs]
+
+#set all_include_dirs $[all_include_dirs] $[local_incs]
+  
+
+
+#end static_lib_target lib_target noinst_lib_target
+
+#forscopes bin_target noinst_bin_target test_bin_target
+#if $[ne $[IF_ZLIB_SOURCES],]
+if HAVE_ZLIB
+EXTRA_ZLIB = $[IF_ZLIB_SOURCES]
+else
+EXTRA_ZLIB =
+endif
+#define $[SOURCES] $(EXTRA_ZLIB)
+#endif
+
+// This defines the complete set of libs we depend on: the LOCAL_LIBS
+// we listed as directly depending on, plus all of the LOCAL_LIBS
+// *those* libraries listed, and so on.
+#define complete_local_libs $[closure local_libs,$[LOCAL_LIBS]]
+
+$[TARGET]_SOURCES = $[SOURCES]
+$[TARGET]_LDADD = $[local_libs $[RELDIR]/lib$[TARGET].la,$[complete_local_libs]] $[OTHER_LIBS:%=-l%] $[alt_libs] $[get_sys_libs]
+#set all_include_dirs $[all_include_dirs] $[local_libs $[RELDIR],$[complete_local_libs]]
+#set all_include_dirs $[all_include_dirs] $[RELDIR($[LOCAL_INCS:%=%/])]
+
+#end bin_target noinst_bin_target test_bin_target
+
+include_HEADERS = $[sort $[INSTALL_HEADERS(static_lib_target lib_target bin_target)] $[INSTALL_HEADERS]]
+#set install_data $[install_data] $[INSTALL_DATA]
+
+#if $[ne $[INSTALL_PARSER_INC],]
+parserincdir = @includedir@/parser-inc
+parserinc_HEADERS = $[INSTALL_PARSER_INC]
+#endif
+
+INCLUDES = $[patsubst %,-I%,$[sort $[all_include_dirs]]] @trees_inc@ $[alt_cflags]
+LDFLAGS = @ldflags@ @trees_lflags@ $[alt_lflags]
+EXTRA_DIST = Sources.pp $[EXTRA_DIST] $[INSTALL_LIBS] $[INSTALL_SCRIPTS]$[install_data]
+BUILT_SOURCES =$[built_sources]
+data_DATA =$[install_data]
+
+#endif   // $[omit]
+
+#end Makefile.am
+
+
+//////////////////////////////////////////////////////////////////////
+#elif $[eq $[DIR_TYPE], metalib]
+//////////////////////////////////////////////////////////////////////
+
+// A metalib directory is similar to a regular source directory, 
+// but a little simpler.
+
+#output Makefile.am
+#format makefile
+# Makefile.am generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+
+#if $[omit]
+  // If we're omitting the directory, everything becomes an extra_dist.  
+EXTRA_DIST = Sources.pp $[EXTRA_DIST] $[SOURCES(static_lib_target noinst_lib_target lib_target noinst_bin_target bin_target test_bin_target)]
+
+#else   // $[omit]
+
+// We define a map variable that allows us to look up all the libs in
+// the various directories by target name.  With this map variable, we
+// can translate the list of local_libs (which is simply a list of
+// library names, with no directory information), into a list of
+// relative filenames to each library.
+#map local_libs TARGET(*/static_lib_target */lib_target */noinst_lib_target)
+
+#define all_include_dirs $(includedir)
+
+lib_LTLIBRARIES = $[TARGET(metalib_target):%=lib%.la]
+
+#define alt_cflags @nspr_cflags@ @python_cflags@
+#define alt_lflags @nspr_lflags@
+#define alt_libs @nspr_libs@
+#if $[ne $[USE_ZLIB],]
+  #define alt_cflags $[alt_cflags] @zlib_cflags@
+  #define alt_lflags $[alt_lflags] @zlib_lflags@
+  #define alt_libs $[alt_libs] @zlib_libs@
+#endif
+#if $[ne $[USE_GL],]
+  #define alt_cflags $[alt_cflags] @gl_cflags@
+  #define alt_lflags $[alt_lflags] @gl_lflags@
+  #define alt_libs $[alt_libs] @gl_libs@
+#endif
+
+#forscopes metalib_target
+#if $[ne $[IF_PYTHON_SOURCES],]
+if HAVE_PYTHON
+EXTRA_PYTHON = $[IF_PYTHON_SOURCES]
+else
+EXTRA_PYTHON =
+endif
+#define SOURCES $[SOURCES] $(EXTRA_PYTHON)
+#endif
+
+// This defines the complete set of libs we depend on: the LOCAL_LIBS
+// we listed as directly depending on, plus all of the LOCAL_LIBS
+// *those* libraries listed, and so on.
+#define complete_local_libs $[closure local_libs,$[LOCAL_LIBS]]
+
+lib$[TARGET]_la_SOURCES = $[SOURCES]
+lib$[TARGET]_la_LIBADD = $[complete_local_libs:%=-l%] $[get_sys_libs]
+
+#end metalib_target
+
+INCLUDES = $[patsubst %,-I%,$[sort $[all_include_dirs]]] @trees_inc@ $[alt_cflags]
+LDFLAGS = @ldflags@ -L$(libdir) -rpath $(libdir) @trees_lflags@ $[alt_lflags]
+EXTRA_DIST = Sources.pp $[EXTRA_DIST]
+
+#endif   // $[omit]
+
+#end Makefile.am
+
+
+//////////////////////////////////////////////////////////////////////
+#elif $[eq $[DIR_TYPE], group]
+//////////////////////////////////////////////////////////////////////
+
+#output Makefile.am
+#format makefile
+# Makefile.am generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+
+SUBDIRS = $[SUBDIRS]
+
+EXTRA_DIST = Sources.pp $[EXTRA_DIST]
+
+#end Makefile.am
+
+
+
+//////////////////////////////////////////////////////////////////////
+#elif $[eq $[DIR_TYPE], toplevel]
+//////////////////////////////////////////////////////////////////////
+
+#output Makefile.am
+#format makefile
+# Makefile.am generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+
+FIRSTBUILD_SUBDIRS = $[filter_out metalibs,$[SUBDIRS]]
+SUBDIRS = $[SUBDIRS]
+
+#define INSTALL_HEADERS $[INSTALL_HEADERS] $[CONFIG_HEADER]
+
+include_HEADERS = $[INSTALL_HEADERS]
+
+EXTRA_DIST = Sources.pp Config.pp $[EXTRA_DIST]
+
+
+# We define this custom rule for all-recursive as an ordering hack.
+# It's just like the default rule, except that it traverses through
+# only FIRSTBUILD_SUBDIRS, instead of all of SUBDIRS.  The idea is
+# that first we build everything in FIRSTBUILD_SUBDIRS, and then when
+# we're installing, we build everything in SUBDIRS as well.  This hack
+# is necessary to build targets in metalibs that link directly with
+# installed shared libraries.
+
+all-recursive:
+	@set fnord $(MAKEFLAGS); amf=$$2; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(FIRSTBUILD_SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+#end Makefile.am
+
+#output configure.in
+#format straight
+dnl configure.in generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT($[SAMPLE_SOURCE_FILE])
+AM_INIT_AUTOMAKE($[PACKAGE], $[VERSION])
+
+#if $[eq $[CONFIG_HEADER],]
+dnl This package doesn't care about a generated config.h file.  This causes
+dnl a few problems with automake, so we fake it out with this hack.
+AM_CONFIG_HEADER(ignore_config.h)
+#else
+AM_CONFIG_HEADER($[CONFIG_HEADER])
+#endif
+
+if test "${CTPROJS+set}" = set; then
+  if test "${$[upcase $[PACKAGE]]+set}" != set; then
+    echo ""
+    echo "The environment variable CTPROJS is currently set, indicating"
+    echo "you are attached to one or more trees, but you are not attached"
+    echo "to $[upcase $[PACKAGE]].  Either unattach from everything, or attach to $[upcase $[PACKAGE]]."
+    echo ""
+    exit 1
+  fi
+
+  # If we're currently attached, the install directory is the same as
+  # the source directory.
+  if test "$prefix" != "NONE"; then
+    echo ""
+    echo The environment variable CTPROJS is currently set, indicating
+    echo you are attached to one or more trees.  When you configure the
+    echo package while attached, you cannot specify a --prefix to install
+    echo the built sources--it always installs in the source directory.
+    echo ""
+    exit 1
+  fi
+
+  prefix=$$[upcase $[PACKAGE]]
+fi
+
+AC_PREFIX_DEFAULT($[INSTALL_DIR])
+AC_PROG_MAKE_SET
+AC_CANONICAL_HOST
+
+# If we have a CFLAGS variable but not a CXXFLAGS variable, let them
+# be the same.
+if test "${CXXFLAGS+set}" != set -a "${CFLAGS+set}" = set; then
+  CXXFLAGS=$CFLAGS
+fi
+
+# Save these variables for later, so we can easily append to them or
+# change them.
+user_ldflags=${LDFLAGS-}
+user_cflags=${CFLAGS-}
+user_cxxflags=${CXXFLAGS-}
+
+dnl Choose a suitable set of system-dependent interrogate flags.
+case "$host_os" in
+  irix*) system_igate="-D__mips__ -D__MIPSEB__";;
+  linux-gnu*) system_igate="-D__i386__";;
+esac
+AC_SUBST(system_igate)
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_CXX
+AM_PROG_LEX
+AM_DISABLE_STATIC
+AM_PROG_LIBTOOL
+AC_PATH_XTRA
+
+dnl We require specifically Bison, not any other flavor of Yacc.
+AC_CHECK_PROGS(YACC, 'bison -y')
+
+
+AC_ARG_WITH(optimize,
+[  --with-optimize=LEVEL   Specify the optimization/debug symbol level (1-4, default 1)])
+
+if test "${with_optimize-no}" = "no"; then
+  with_optimize=$[OPTIMIZE]
+fi
+
+if test "$with_optimize" = "1"; then
+  # Optimize level 1: No optimizations, and full debug symbols.  
+  if test "${ac_cv_prog_gcc}" = "yes"; then
+    CFLAGS="$user_cflags -g -Wall"
+    CXXFLAGS="$user_cxxflags -g -Wall"
+  else
+    CFLAGS="$user_cflags -g"
+    CXXFLAGS="$user_cxxflags -g"
+  fi
+
+elif test "$with_optimize" = "2"; then
+  # Optimize level 2: Compiler optimizations, and full debug if supported.
+  if test "${ac_cv_prog_gcc}" = "yes"; then
+    CFLAGS="$user_cflags -O2 -g -Wall"
+    CXXFLAGS="$user_cxxflags -O2 -g -Wall"
+  else
+    CFLAGS="$user_cflags -O"
+    CXXFLAGS="$user_cxxflags -O"
+  fi
+
+elif test "$with_optimize" = "3"; then
+  # Optimize level 3: Compiler optimizations, without debug symbols.
+  if test "${ac_cv_prog_gcc}" = "yes"; then
+    CFLAGS="$user_cflags -O2 -Wall"
+    CXXFLAGS="$user_cxxflags -O2 -Wall"
+  else
+    CFLAGS="$user_cflags -O"
+    CXXFLAGS="$user_cxxflags -O"
+  fi
+
+elif test "$with_optimize" = "4"; then
+  # Optimize level 4: As above, with asserts removed.
+  if test "${ac_cv_prog_gcc}" = "yes"; then
+    CFLAGS="$user_cflags -O2 -Wall -DNDEBUG"
+    CXXFLAGS="$user_cxxflags -O2 -Wall -DNDEBUG"
+  else
+    CFLAGS="$user_cflags -O -DNDEBUG"
+    CXXFLAGS="$user_cxxflags -O -DNDEBUG"
+  fi
+
+else
+  echo "Invalid optimize level: $with_optimize"
+  exit 0
+fi
+
+trees_inc=
+trees_lflags=
+
+#foreach require $[REQUIRED_TREES]
+
+AC_ARG_WITH($[require],
+[  --with-$[require]=DIR        Prefix where $[upcase $[require]] is installed (same as --prefix)])
+
+
+if test "${CTPROJS+set}" = set; then
+  if test "$with_$[require]" != ""; then
+    echo ""
+    echo "The environment variable CTPROJS is currently set, indicating"
+    echo "you are attached to one or more trees.  When you configure the"
+    echo "package while attached, you cannot specify a directory to search"
+    echo "for --$[require]; it will always search in the currently attached $[upcase $[require]]."
+    echo ""
+    exit 1
+  fi
+  if test "${$[upcase $[require]]+set}" != set; then
+    echo ""
+    echo "The environment variable CTPROJS is currently set, indicating"
+    echo "you are attached to one or more trees, but you are not attached"
+    echo "to $[upcase $[require]].  Either unattach from everything, or attach to $[upcase $[require]]."
+    echo ""
+    exit 1
+  fi
+
+  $[require]='${$[upcase $[require]]}'
+else
+  # No attachments--respect the --with-$[require] parameter.
+
+  if test "$with_$[require]" != "" -a "$with_$[require]" != "no" -a "$with_$[require]" != "yes"; then
+    $[require]=$with_$[require]
+  else
+    $[require]='${prefix}'
+  fi
+  trees_inc="$trees_inc -I"'$($[require])/include'
+  trees_lflags="$trees_lflags -L"'$($[require])/lib'
+fi
+
+AC_SUBST($[require])
+
+#end require
+AC_SUBST(trees_inc)
+AC_SUBST(trees_lflags)
+
+dnl First, we'll test for C-specific features.
+AC_LANG_C
+
+dnl Checks for libraries.
+libdl=
+libm=
+AC_CHECK_LIB(dl, dlopen, libdl=-ldl)
+AC_CHECK_LIB(m, sin, libm=-lm)
+AC_SUBST(libdl)
+AC_SUBST(libm)
+
+// Only bother to make the following tests if we're actually building
+// a config.h.
+#if $[ne $[CONFIG_HEADER],]
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(malloc.h alloca.h unistd.h io.h minmax.h sys/types.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_BIGENDIAN
+AC_GETTIMEOFDAY
+
+dnl Checks for library functions.
+AC_CHECK_FUNCS(getopt getopt_long_only)
+
+
+dnl Now we can test some C++-specific features.
+AC_LANG_CPLUSPLUS
+AC_HEADER_IOSTREAM
+AC_CHECK_HEADERS(sstream)
+AC_NAMESPACE
+AC_IOS_BINARY
+#endif
+
+AC_LANG_C
+
+AC_ARG_WITH(python,
+[  --with-python=DIR       Prefix where Python is installed (usually /usr/local)])
+
+have_python=no
+include_python=
+if test "$with_python" != "no"; then
+  if test "$with_python" = "yes" -o "$with_python" = ""; then
+    AC_SEARCH_HPACKAGE(/usr/local /usr,
+                       python1.6 python,
+	               Python.h, python)
+  else
+    AC_SEARCH_HPACKAGE($with_python,
+                       python1.6 python,
+	               Python.h, python)
+  fi
+
+  if test "$with_python" != ""; then
+    if test "$python_PKG" != "yes"; then
+      dnl  If the user specified to search for python but we didn't find it,
+      dnl  abort now.
+
+      echo ""
+      echo "**** Could not locate Python package.  Use --with-python=directory,"
+      echo "     e.g. --with-python=/usr/local, or just --with-python."
+      echo "     If Python is not installed, specify --without-python."
+      echo ""
+      exit 1
+    fi
+  fi
+
+  if test "$python_PKG" = "yes"; then
+#if $[ne $[CONFIG_HEADER],]
+    AC_DEFINE(HAVE_PYTHON)
+#endif
+    have_python=yes
+    python_cflags=-I$python_INCLUDE
+  fi
+fi
+
+AC_SUBST(have_python)
+AC_SUBST(python_cflags)
+AM_CONDITIONAL(HAVE_PYTHON, test "$have_python" = "yes")
+
+
+AC_ARG_WITH(nspr,
+[  --with-nspr=DIR         Prefix where NSPR is installed (usually /usr/local/mozilla)])
+
+have_nspr=no
+include_nspr=
+if test "$with_nspr" != "no"; then
+  if test "$with_nspr" = "yes" -o "$with_nspr" = ""; then
+    AC_SEARCH_PACKAGE(/usr/local/mozilla /usr/local/mozilla/dist/*,,
+	              nspr.h, nspr3, PR_Init, nspr)
+  else
+    AC_SEARCH_PACKAGE($with_nspr $with_nspr/dist/*,,
+	              nspr.h, nspr3, PR_Init, nspr)
+  fi
+
+  if test "$with_nspr" != ""; then
+    if test "$nspr_PKG" != "yes"; then
+      dnl  If the user specified to search for NSPR but we didn't find it,
+      dnl  abort now.
+
+      echo ""
+      echo "**** Could not locate NSPR package.  Use --with-nspr=directory,"
+      echo "     e.g. --with-nspr=/usr/local, or just --with-nspr."
+      echo "     If NSPR is not installed, specify --without-nspr."
+      echo ""
+      exit 1
+    fi
+  fi
+
+  if test "$nspr_PKG" = "yes"; then
+#if $[ne $[CONFIG_HEADER],]
+    AC_DEFINE(HAVE_NSPR)
+#endif
+    have_nspr=yes
+    nspr_cflags="-I$nspr_INCLUDE"
+    nspr_ldflags="-L$nspr_LIB"
+    nspr_libs="-lnspr3"
+  fi
+fi
+
+AC_SUBST(have_nspr)
+AC_SUBST(nspr_cflags)
+AC_SUBST(nspr_lflags)
+AC_SUBST(nspr_libs)
+AM_CONDITIONAL(HAVE_NSPR, test "$have_nspr" = "yes")
+
+
+AC_ARG_WITH(zlib,
+[  --with-zlib=DIR         Prefix where zlib is installed (usually /usr)])
+
+have_zlib=no
+include_zlib=
+if test "$with_zlib" != "no"; then
+  if test "$with_zlib" = "yes" -o "$with_zlib" = ""; then
+    AC_SEARCH_PACKAGE(/usr /usr/local,,
+	              zlib.h, z, gzopen, zlib)
+  else
+    AC_SEARCH_PACKAGE($with_zlib,,
+	              zlib.h, z, gzopen, zlib)
+  fi
+
+  if test "$with_zlib" != ""; then
+    if test "$zlib_PKG" != "yes"; then
+      dnl  If the user specified to search for zlib but we didn't find it,
+      dnl  abort now.
+
+      echo ""
+      echo "**** Could not locate zlib package.  Use --with-zlib=directory,"
+      echo "     e.g. --with-zlib=/usr/local, or just --with-zlib."
+      echo "     If zlib is not installed, specify --without-zlib."
+      echo ""
+      exit 1
+    fi
+  fi
+
+  if test "$zlib_PKG" = "yes"; then
+#if $[ne $[CONFIG_HEADER],]
+    AC_DEFINE(HAVE_ZLIB)
+#endif
+    have_zlib=yes
+    if test "$zlib_INCLUDE" != ""; then
+      zlib_cflags="-I$zlib_INCLUDE"
+    fi
+    if test "$zlib_LIB" != ""; then
+      zlib_lflags="-L$zlib_LIB"
+    fi
+    zlib_libs="-lz"
+  fi
+fi
+
+AC_SUBST(have_zlib)
+AC_SUBST(zlib_cflags)
+AC_SUBST(zlib_lflags)
+AC_SUBST(zlib_libs)
+AM_CONDITIONAL(HAVE_ZLIB, test "$have_zlib" = "yes")
+
+
+AC_ARG_WITH(gl,
+[  --with-gl=DIR           Prefix where OpenGL is installed (usually /usr)])
+
+have_gl=no
+include_gl=
+if test "$with_gl" != "no"; then
+  if test "$with_gl" = "yes" -o "$with_gl" = ""; then
+    AC_SEARCH_PACKAGE(/usr /usr/local,,
+	              GL/gl.h, GL, glVertex3f, gl)
+  else
+    AC_SEARCH_PACKAGE($with_gl,,
+	              GL/gl.h, GL, glVertex3f, gl)
+  fi
+
+  if test "$with_gl" != ""; then
+    if test "$gl_PKG" != "yes"; then
+      dnl  If the user specified to search for OpenGL but we didn't find it,
+      dnl  abort now.
+
+      echo ""
+      echo "**** Could not locate OpenGL package.  Use --with-gl=directory,"
+      echo "     e.g. --with-gl=/usr/local, or just --with-gl."
+      echo "     If OpenGL is not installed, specify --without-gl."
+      echo ""
+      exit 1
+    fi
+  fi
+
+  if test "$gl_PKG" = "yes"; then
+#if $[ne $[CONFIG_HEADER],]
+    AC_DEFINE(HAVE_GL)
+#endif
+    have_gl=yes
+    if test "$gl_INCLUDE" != ""; then
+      gl_cflags="-I$gl_INCLUDE"
+    fi
+    if test "$gl_LIB" != ""; then
+      gl_lflags="-L$gl_LIB"
+    fi
+    gl_libs="-lGL -lGLU"
+  fi
+fi
+
+AC_SUBST(have_gl)
+AC_SUBST(gl_cflags)
+AC_SUBST(gl_lflags)
+AC_SUBST(gl_libs)
+AM_CONDITIONAL(HAVE_GL, test "$have_gl" = "yes")
+
+
+AC_ARG_WITH(glu,
+[  --with-glu=DIR           Prefix where GL util library is installed (usually /usr)])
+
+have_glu=no
+include_glu=
+if test "$with_glu" != "no"; then
+  if test "$with_glu" = "yes" -o "$with_glu" = ""; then
+    AC_SEARCH_PACKAGE($gl_INCLUDE /usr /usr/local,,
+	              GL/glu.h, GLU, gluSphere, glu)
+  else
+    AC_SEARCH_PACKAGE($with_glu,,
+	              GL/glu.h, GLU, gluSphere, glu)
+  fi
+
+  if test "$with_glu" != ""; then
+    if test "$glu_PKG" != "yes"; then
+      dnl  If the user specified to search for GL util library but we didn't find it,
+      dnl  abort now.
+
+      echo ""
+      echo "**** Could not locate GL util library.  Use --with-glu=directory,"
+      echo "     e.g. --with-glu=/usr/local, or just --with-glu."
+      echo "     If GL util library is not installed, specify --without-glu."
+      echo ""
+      exit 1
+    fi
+  fi
+
+  if test "$glu_PKG" = "yes"; then
+#if $[ne $[CONFIG_HEADER],]
+    AC_DEFINE(HAVE_GLU)
+#endif
+    have_glu=yes
+    if test "$glu_INCLUDE" != ""; then
+      glu_cflags="-I$glu_INCLUDE"
+    fi
+    if test "$glu_LIB" != ""; then
+      glu_lflags="-L$glu_LIB"
+    fi
+    glu_libs="-lGLU -lGLUU"
+  fi
+fi
+
+AC_SUBST(have_glu)
+AC_SUBST(glu_cflags)
+AC_SUBST(glu_lflags)
+AC_SUBST(glu_libs)
+AM_CONDITIONAL(HAVE_GLU, test "$have_glu" = "yes")
+
+
+AC_ARG_WITH(glx,
+[  --with-glx=DIR          Prefix where GLX is installed (usually /usr)])
+
+have_glx=no
+include_glx=
+if test "$with_glx" != "no"; then
+  if test "$with_glx" = "yes" -o "$with_glx" = ""; then
+    AC_SEARCH_HPACKAGE($gl_INCLUDE /usr /usr/local $x_libraries,,
+	               GL/glx.h, glx)
+  else
+    AC_SEARCH_HPACKAGE($with_glx,,
+	               GL/glx.h, glx)
+  fi
+
+  if test "$with_glx" != ""; then
+    if test "$glx_PKG" != "yes"; then
+      dnl  If the user specified to search for GLX but we didn't find it,
+      dnl  abort now.
+
+      echo ""
+      echo "**** Could not locate GLX package.  Use --with-glx=directory,"
+      echo "     e.g. --with-glx=/usr/local, or just --with-glx."
+      echo "     If GLX is not installed, specify --without-glx."
+      echo ""
+      exit 1
+    fi
+  fi
+
+  if test "$glx_PKG" = "yes"; then
+#if $[ne $[CONFIG_HEADER],]
+    AC_DEFINE(HAVE_GLX)
+#endif
+    have_glx=yes
+    if test "$glx_INCLUDE" != ""; then
+      glx_cflags="-I$glx_INCLUDE"
+    fi
+  fi
+fi
+
+AC_SUBST(have_glx)
+AC_SUBST(glx_cflags)
+AM_CONDITIONAL(HAVE_GLX, test "$have_glx" = "yes")
+
+
+AC_ARG_WITH(glut,
+[  --with-glut=DIR         Prefix where glut is installed (usually /usr)])
+
+have_glut=no
+include_glut=
+if test "$with_glut" != "no"; then
+  if test "$with_glut" = "yes" -o "$with_glut" = ""; then
+    AC_SEARCH_PACKAGE($gl_INCLUDE /usr /usr/local $x_libraries,,
+	              GL/glut.h, glut, glutInit, glut, -lGL -lGLU)
+  else
+    AC_SEARCH_PACKAGE($with_glut,,
+	              GLUT/glut.h, glut, glutInit, glut, -lGL -lGLU)
+  fi
+
+  if test "$with_glut" != ""; then
+    if test "$glut_PKG" != "yes"; then
+      dnl  If the user specified to search for glut but we didn't find it,
+      dnl  abort now.
+
+      echo ""
+      echo "**** Could not locate glut package.  Use --with-glut=directory,"
+      echo "     e.g. --with-glut=/usr/local, or just --with-glut."
+      echo "     If glut is not installed, specify --without-glut."
+      echo ""
+      exit 1
+    fi
+  fi
+
+  if test "$glut_PKG" = "yes"; then
+#if $[ne $[CONFIG_HEADER],]
+    AC_DEFINE(HAVE_GLUT)
+#endif
+    have_glut=yes
+    if test "$glut_INCLUDE" != ""; then
+      glut_cflags="-I$glut_INCLUDE"
+    fi
+    if test "$glut_LIB" != ""; then
+      glut_lflags="-L$glut_LIB"
+    fi
+    glut_libs="-lglut"
+  fi
+fi
+
+AC_SUBST(have_glut)
+AC_SUBST(glut_cflags)
+AC_SUBST(glut_lflags)
+AC_SUBST(glut_libs)
+AM_CONDITIONAL(HAVE_GLUT, test "$have_glut" = "yes")
+
+
+AC_ARG_WITH(rib,
+[  --with-rib              Compile in the Renderman interface.])
+
+have_rib=no
+if test "$with_rib" = "yes"; then
+  have_rib=yes
+fi
+
+AC_SUBST(have_rib)
+#if $[ne $[CONFIG_HEADER],]
+if test "$have_rib" = "yes"; then
+AC_DEFINE(HAVE_RIB)
+fi
+#endif
+AM_CONDITIONAL(HAVE_RIB, test "$have_rib" = "yes")
+
+
+
+AC_ARG_WITH(mikmod,
+[  --with-mikmod[=libmikmod-config]  Use the mikmod interface for audio.])
+
+have_mikmod=no
+include_mikmod=
+if test "$with_mikmod" != "no"; then
+  if test "$with_mikmod" = "" -o "$with_mikmod" = "yes"; then
+    dnl search for the libmikmod-config program on the path.
+    AC_CHECK_PROG(with_mikmod, libmikmod-config, libmikmod-config, "no")
+  fi
+fi
+
+if test "$with_mikmod" != "no"; then
+  have_mikmod=yes
+  CFLAGS="$CFLAGS "`$with_mikmod --cflags`  
+  CXXFLAGS="$CXXFLAGS "`$with_mikmod --cflags`  
+  LDFLAGS="$LDFLAGS "`$with_mikmod --libs`  
+#if $[ne $[CONFIG_HEADER],]
+  AC_DEFINE(HAVE_MIKMOD)
+#endif
+fi
+
+AC_SUBST(have_mikmod)
+AM_CONDITIONAL(HAVE_MIKMOD, test "$have_mikmod" = "yes")
+
+ldflags=$LDFLAGS
+AC_SUBST(ldflags)
+
+AC_OUTPUT([$[TREE:%=%/Makefile]])
+
+#end configure.in
+
+//////////////////////////////////////////////////////////////////////
+#endif // DIR_TYPE

+ 699 - 0
dtool/pptempl/Template.stopgap.pp

@@ -0,0 +1,699 @@
+//
+// Template.stopgap.pp
+//
+// This file defines the set of output files that will be generated to
+// support our old-style Makefile system.  It is intended to aid as a
+// transition to the new system.
+//
+
+//////////////////////////////////////////////////////////////////////
+#if $[eq $[DIR_TYPE], src]
+//////////////////////////////////////////////////////////////////////
+
+// For a source directory, build a Makefile, Makefile.install, and a 
+// Makefile.target for each target.
+
+#define submakes $[TARGET(static_lib_target):%=%.a] $[TARGET(lib_target noinst_lib_target):%=%.so] $[TARGET(sed_bin_target bin_target noinst_bin_target test_bin_target)]
+#define install $[TARGET(static_lib_target):%=%.a] $[TARGET(lib_target noinst_lib_target):%=%.so] $[TARGET(sed_bin_target bin_target noinst_bin_target)]
+
+// Now iterate through the libraries we're building and see which ones
+// actually *are* being included in a metalib.  For each one that is,
+// we install the appropriate deferred file.
+#define deferred
+#forscopes lib_target
+  #define metalib $[module $[TARGET],$[TARGET]]
+  #if $[ne $[metalib],]
+    #set deferred $[deferred] Deferred.$[metalib].lib$[TARGET].so
+  #endif
+#end lib_target
+
+// Get the full set of libraries we depend on.
+#call get_depend_libs
+
+// Also get the targets we'll be installing.
+#define install_libs $[sort $[TARGET(lib_target):%=lib%.so] $[TARGET(static_lib_target):%=lib%.a] $[INSTALL_LIBS]]
+#define install_bin $[sort $[TARGET(bin_target)] $[INSTALL_BIN]]
+#define install_scripts $[sort $[INSTALL_SCRIPTS(static_lib_target lib_target bin_target)] $[TARGET(sed_bin_target)] $[INSTALL_SCRIPTS]]
+#define install_headers $[sort $[INSTALL_HEADERS(static_lib_target lib_target bin_target)] $[INSTALL_HEADERS]]
+#define install_data $[sort $[INSTALL_DATA(static_lib_target lib_target sed_bin_target bin_target)] $[INSTALL_DATA]] $[sort $[INSTALL_CONFIG(static_lib_target lib_target sed_bin_target bin_target)] $[INSTALL_CONFIG]]
+
+// Collect the set of interrogate database files we'll install,
+// possibly one for each library we build.
+#define install_igatedb
+#if $[run_interrogate]
+  #forscopes lib_target
+    #if $[ne $[IGATESCAN],]
+      #set install_igatedb $[install_igatedb] lib$[TARGET].in
+    #endif
+  #end lib_target
+#endif
+
+
+#output Makefile
+#format makefile
+#### Meta Makefile.
+#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+################################# DO NOT EDIT ###########################
+
+
+#### Sub make targets (extension of sub Makefile, eg 'foo' for Makefile.foo):
+SUBMAKES = $[submakes]
+
+#### List the minimal set of sub makes on the list above required to install.
+INSTALL = $[install]
+
+#### Location of sub Makefiles.
+MAKEDIR = .
+
+#### The action is here.
+include $(DTOOL)/include/Makefile.meta.rules
+
+#### Sub-make build order dependencies:
+# foo: bar
+#end Makefile
+
+
+
+#output Makefile.install
+#format makefile
+#### Installation makefile
+#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+################################# DO NOT EDIT ###########################
+
+# Note: This file is included by the project-wide Makefile so the current
+# directory is the project root.  Also, commented-out fields are optional.
+
+#### Package name and location (if not src/all/$(PACKAGE)):
+PACKAGE = $[DIRNAME]
+PKGROOT = $[PATH]
+
+ifneq (,$(PACKAGE))
+
+#### Package dependencies (USESOTHER needs relative paths from project root):
+USESLIBS = $[depend_libs]
+# USESINCLUDE = 
+# USESOTHER = 
+
+#### Installed files:
+LIBS = $[install_libs]
+DEFERRED = $[deferred]
+INCLUDE = $[install_headers]
+BINS = $[install_bin]
+SCRIPTS = $[install_scripts]
+# SS = 
+# STK = 
+# MODELS = 
+ETC = $[install_data]
+IGATEDB =$[install_igatedb]
+# DOC =
+# MAN =
+# FONTS = 
+# ICONS = 
+# APPDEFAULTS = 
+# TCL = 
+# TELEUSE = 
+# SHADERS = 
+
+#### Other files to be installed (use relative pathname from project root):
+#if $[ne $[INSTALL_PARSER_INC],]
+PARSER_INC = $[INSTALL_PARSER_INC]
+SRC_PARSER_INC = $(addprefix $(PKGROOT)/,$(PARSER_INC))
+INST_PARSER_INC = $(addprefix include/parser-inc/,$(PARSER_INC))
+OTHER = $(INST_PARSER_INC)
+#else
+# OTHER =
+#endif
+
+#### Where the action happens.
+include $(DTOOL)/include/Makefile.install.rules
+
+#### Install actions for OTHER files (source must be in $(PKGROOT)):
+# [ installed file ] : $(PKGROOT)/[ source file ]  # Files must have same name
+#	$(INSTALL)                      # Copies from source to dest
+#
+# [ installed file ] : $(PKGROOT)/[ source file ]
+#	$(MKINSTALL)			# Also makes directory if needed
+
+#if $[ne $[INSTALL_PARSER_INC],]
+$(INST_PARSER_INC) : include/parser-inc/% : $(PKGROOT)/%
+	$(MKINSTALL)
+#endif
+
+#### Other install/uninstall actions:
+# install-$(PKGROOT): #Add dependencies here
+#	Add actions here
+#
+# uninstall-$(PKGROOT): #Add dependencies here
+#	Add actions here
+
+#### Sub-package Makefile.install inclusions:
+# include foo/Makefile.install
+
+endif
+#end Makefile.install
+
+
+
+// Now generate a suitable Makefile for each library target.
+#forscopes lib_target noinst_lib_target
+
+// Again, is this library included in a metalib?  If so, output the
+// appropriate deferred rules.
+#define metalib $[module $[TARGET],$[TARGET]]
+
+// We might need to define a BUILDING_ symbol for win32.  We use the
+// BUILDING_DLL variable name, defined typically in the metalib, for
+// this; but in some cases, where the library isn't part of a metalib,
+// we define BUILDING_DLL directly for the target.
+#define building_var $[BUILDING_DLL]
+#if $[ne $[metalib],]
+  #set building_var $[module $[BUILDING_DLL],$[TARGET]]
+#endif
+
+// Get the full set of sources for this target.
+#call get_sources
+#call get_libs
+
+// Which files will we interrogate, if any?
+#define igatescan $[get_igatescan]
+
+#output Makefile.$[TARGET].so
+#format makefile
+#### Makefile for DSO's.  Any fields commented out are optional.
+#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+################################# DO NOT EDIT ###########################
+
+#### Target's name:
+TARGET = lib$[TARGET].so
+DEFERRED_TARGET = $[metalib]
+
+# Standard .o file conversion information.
+
+#### Lex files 
+LFILES = $[filter %.lxx,$[sources]]
+LEX = flex
+LFLAGS = $[LFLAGS] $[YACC_PREFIX:%=-P%] -olex.yy.c
+LEXTENSION = cxx
+
+#### Yacc files 
+YFILES = $[filter %.yxx,$[sources]]
+YACC = bison
+YFLAGS = -y -d $[patsubst %,--name-prefix=%,$[YACC_PREFIX]]
+YEXTENSION = cxx
+
+#### C files 
+CFILES = $[filter %.c,$[sources]]
+CFLAGS = $[building_var:%=-D%] $[alt_cflags] $[CFLAGS]
+
+#### C++ files 
+C++FILES = $[filter %.cxx,$[sources]]
+C++FLAGS = $[building_var:%=-D%] $[alt_cflags] $[C++FLAGS]
+# USETEMPLATES = TRUE
+# PTREPOSITORY = # Specify only if you want a specific name
+
+#### Interrogate info
+IGATESCAN  = $[igatescan]
+IGATEFLAGS = $[alt_ipath:%=-I%]
+# IGATEFILE  = # Specify only if you want a specific name
+
+#### Additional search directories for C/C++ header files:
+IPATH = $[alt_ipath:%=-I%]
+
+#### Location to put .o files:
+# ODIR = 
+
+#### Source file dependencies (unnecessary with clearmake)
+# foo.c: foo.h
+
+#### Other files and lib.  Include $(ODIR) in any .o names.
+# OFILES = 
+WHEN_NO_DEFER_LIBS = $[when_no_defer:%=-l%]
+WHEN_DEFER_LIBS = $[when_defer:%=-l%]
+LIBS = $[when_either:%=-l%]
+SYSLIBS = $[patsubst %.lib,%.lib,%,-l%,$[unique $[alt_libs]]]
+
+#### Additional search directories for lib:
+LPATH = $[alt_lpath:%=-L%]
+
+#### Other linker flags. 
+#if $[ne $[alt_ld],]
+LD = $[alt_ld]
+#endif
+# LDFLAGS = 
+
+#### Pull in standard .o make variables
+include $(DTOOL)/include/Makefile.o.vars
+
+#### The .o action is here.
+include $(DTOOL)/include/Makefile.o.rules
+
+#### Pull in standard binary make variables.
+include $(DTOOL)/include/Makefile.bin.vars
+
+#### The .so action is here.
+include $(DTOOL)/include/Makefile.so.rules
+#end Makefile.$[TARGET].so
+
+#end lib_target noinst_lib_target
+
+
+
+// Also generate a suitable Makefile for each static library target.
+#forscopes static_lib_target
+
+// Get the full set of sources for this target.
+#call get_sources
+#call get_libs
+
+#output Makefile.$[TARGET].a
+#format makefile
+#### Makefile for archive libraries.  Any fields commented out are optional.
+#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+################################# DO NOT EDIT ###########################
+
+#### Target's name:
+TARGET = lib$[TARGET].a
+
+# Standard .o file conversion information.
+
+#### Lex files 
+LFILES = $[filter %.lxx,$[sources]]
+LEX = flex
+LFLAGS = $[LFLAGS] $[YACC_PREFIX:%=-P%] -olex.yy.c
+LEXTENSION = yy.cxx
+# LSUBST =
+
+#### Yacc files 
+YFILES = $[filter %.yxx,$[sources]]
+YACC = bison
+YFLAGS = -y -d $[patsubst %,--name-prefix=%,$[YACC_PREFIX]]
+YEXTENSION = tab.cxx
+# YSUBST =
+
+#### C files 
+CFILES = $[filter %.c,$[sources]]
+CFLAGS = $[building_var:%=-D%] $[alt_cflags] $[CFLAGS]
+
+#### C++ files 
+C++FILES = $[filter %.cxx,$[sources]]
+C++FLAGS = $[building_var:%=-D%] $[alt_cflags] $[C++FLAGS]
+# USETEMPLATES = TRUE
+# PTREPOSITORY = # Specify only if you want a specific name
+
+#### Additional search directories for C/C++ header files:
+IPATH = $[alt_ipath:%=-I%]
+
+#### Location to put .o files:
+# ODIR = 
+
+#### Source file dependencies (unnecessary with clearmake)
+# foo.c: foo.h
+
+#### Other .o files.
+# OFILES = 
+
+#### Libs and flags for template instantiation.
+WHEN_NO_DEFER_LIBS = $[when_no_defer:%=-l%]
+WHEN_DEFER_LIBS = $[when_defer:%=-l%]
+LIBS = $[when_either:%=-l%]
+SYSLIBS = $[patsubst %.lib,%.lib,%,-l%,$[unique $[alt_libs]]]
+
+#### Additional search directories for lib:
+LPATH = $[alt_lpath:%=-L%]
+
+#### Archiver flags
+# ARFLAGS = 
+
+#### Pull in standard .o make variables
+include $(DTOOL)/include/Makefile.o.vars
+
+#### The .o action is here.
+include $(DTOOL)/include/Makefile.o.rules
+
+#### Pull in standard binary make variables.
+include $(DTOOL)/include/Makefile.bin.vars
+
+#### The .a action is here.
+include $(DTOOL)/include/Makefile.a.rules
+#end Makefile.$[TARGET].a
+
+#end static_lib_target
+
+
+
+// And also generate a suitable Makefile for each binary target.
+#forscopes bin_target noinst_bin_target test_bin_target
+
+// Get the full set of sources for this target.
+#call get_sources
+#call get_libs
+
+#output Makefile.$[TARGET]
+#format makefile
+#### Makefile for binaries.  Any fields commented out are optional.
+#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+################################# DO NOT EDIT ###########################
+
+#### Target's name:
+TARGET = $[TARGET]
+
+# Standard .o file conversion information.
+
+#### Lex files 
+LFILES = $[filter %.lxx,$[sources]]
+LEX = flex
+LFLAGS = $[LFLAGS] $[YACC_PREFIX:%=-P%] -olex.yy.c
+LEXTENSION = yy.cxx
+# LSUBST =
+
+#### Yacc files 
+YFILES = $[filter %.yxx,$[sources]]
+YACC = bison
+YFLAGS = -y -d $[patsubst %,--name-prefix=%,$[YACC_PREFIX]]
+YEXTENSION = tab.cxx
+# YSUBST =
+
+#### C files 
+CFILES = $[filter %.c,$[sources]]
+CFLAGS = $[building_var:%=-D%] $[alt_cflags] $[CFLAGS]
+
+#### C++ files 
+C++FILES = $[filter %.cxx,$[sources]]
+C++FLAGS = $[building_var:%=-D%] $[alt_cflags] $[C++FLAGS]
+
+#### Additional search directories for C/C++ header files:
+IPATH = $[alt_ipath:%=-I%]
+
+#### Location to put .o files:
+# ODIR = 
+
+#### Source file dependencies (unnecessary with clearmake)
+# foo.c: foo.h
+
+#### Other files and lib.  Include $(ODIR) in any .o names.
+# OFILES = 
+WHEN_NO_DEFER_LIBS = $[when_no_defer:%=-l%]
+WHEN_DEFER_LIBS = $[when_defer:%=-l%]
+LIBS = $[when_either:%=-l%]
+SYSLIBS = $[patsubst %.lib,%.lib,%,-l%,$[unique $[alt_libs]]]
+
+#### Additional search directories for lib:
+LPATH = $[alt_lpath:%=-L%]
+
+#### Other linker flags. 
+#if $[ne $[alt_ld],]
+LD = $[alt_ld]
+#endif
+# LDFLAGS =
+
+#### Pull in standard .o make variables
+include $(DTOOL)/include/Makefile.o.vars
+
+#### The .o action is here.
+include $(DTOOL)/include/Makefile.o.rules
+
+#### Pull in standard binary make variables.
+include $(DTOOL)/include/Makefile.bin.vars
+
+#### The bin action is here.
+include $(DTOOL)/include/Makefile.bin.rules
+#end Makefile.$[TARGET]
+
+#end bin_target noinst_bin_target test_bin_target
+
+
+// Finally, generate the special scripts from the sed_bin_targets.  Hopefully
+// there won't be too many of these in the tree, since these are fairly
+// Unix-specific.
+#forscopes sed_bin_target
+#output Makefile.$[TARGET]
+#format makefile
+#### This is a special makefile just to generate the $[TARGET] script.
+
+$[TARGET] : $[SOURCE]
+	sed $[COMMAND] $^ >$@
+	chmod +x $@
+
+clean :
+
+cleanall :
+	rm -f $[TARGET]
+#end Makefile.$[TARGET]
+#end sed_bin_target
+
+
+//////////////////////////////////////////////////////////////////////
+#elif $[eq $[DIR_TYPE], metalib]
+//////////////////////////////////////////////////////////////////////
+
+// A metalib directory is similar to a regular source directory, 
+// but a little simpler.
+
+#define submakes $[TARGET(metalib_target):%=%.so]
+
+
+// Get the full set of libraries we depend on.
+#call get_depend_libs
+
+// Also get the targets we'll be installing.
+#define install_libs $[TARGET(metalib_target):%=lib%.so]
+#define install_headers $[INSTALL_HEADERS(metalib_target)]
+#define install_data $[INSTALL_DATA(metalib_target)] $[INSTALL_CONFIG(metalib_target)]
+
+
+#output Makefile
+#format makefile
+#### Meta Makefile.
+#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+################################# DO NOT EDIT ###########################
+
+
+#### Sub make targets (extension of sub Makefile, eg 'foo' for Makefile.foo):
+SUBMAKES = $[submakes]
+
+#### List the minimal set of sub makes on the list above required to install.
+INSTALL = $[submakes]
+
+#### Location of sub Makefiles.
+MAKEDIR = .
+
+#### The action is here.
+include $(DTOOL)/include/Makefile.meta.rules
+
+#### Sub-make build order dependencies:
+# foo: bar
+#end Makefile
+
+
+
+#output Makefile.install
+#format makefile
+#### Installation makefile
+#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+################################# DO NOT EDIT ###########################
+
+# Note: This file is included by the project-wide Makefile so the current
+# directory is the project root.  Also, commented-out fields are optional.
+
+#### Package name and location (if not src/all/$(PACKAGE)):
+PACKAGE = $[DIRNAME]
+PKGROOT = $[PATH]
+
+ifneq (,$(PACKAGE))
+
+#### Package dependencies (USESOTHER needs relative paths from project root):
+USESLIBS = $[depend_libs]
+# USESINCLUDE = 
+# USESOTHER = 
+
+#### Installed files:
+LIBS = $[install_libs]
+INCLUDE = $[install_headers]
+# BINS =
+# SS = 
+# STK = 
+# MODELS = 
+# ETC =
+# DOC =
+# MAN =
+# FONTS = 
+# ICONS = 
+# APPDEFAULTS = 
+# TCL = 
+# TELEUSE = 
+# SHADERS = 
+
+#### Other files to be installed (use relative pathname from project root):
+# OTHER = 
+
+#### Where the action happens.
+include $(DTOOL)/include/Makefile.install.rules
+
+#### Install actions for OTHER files (source must be in $(PKGROOT)):
+# [ installed file ] : $(PKGROOT)/[ source file ]  # Files must have same name
+#	$(INSTALL)                      # Copies from source to dest
+#
+# [ installed file ] : $(PKGROOT)/[ source file ]
+#	$(MKINSTALL)			# Also makes directory if needed
+
+#### Other install/uninstall actions:
+# install-$(PKGROOT): #Add dependencies here
+#	Add actions here
+#
+# uninstall-$(PKGROOT): #Add dependencies here
+#	Add actions here
+
+#### Sub-package Makefile.install inclusions:
+# include foo/Makefile.install
+
+endif
+#end Makefile.install
+
+// Now generate a suitable Makefile for each metalib target.
+#forscopes metalib_target
+
+#define building_var $[BUILDING_DLL]
+
+// Get the full set of sources for this target.
+#call get_sources
+#call get_libs
+
+#define igatemscan $[get_igatemscan]
+
+#output Makefile.$[TARGET].so
+#format makefile
+#### Makefile for DSO's.  Any fields commented out are optional.
+#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+################################# DO NOT EDIT ###########################
+
+#### Target's name:
+TARGET = lib$[TARGET].so
+
+# Standard .o file conversion information.
+
+#### Lex files 
+LFILES = $[filter %.lxx,$[sources]]
+LEX = flex
+LFLAGS = $[LFLAGS] $[YACC_PREFIX:%=-P%] -olex.yy.c
+LEXTENSION = yy.cxx
+# LSUBST =
+
+#### Yacc files 
+YFILES = $[filter %.yxx,$[sources]]
+YACC = bison
+YFLAGS = -y -d $[patsubst %,--name-prefix=%,$[YACC_PREFIX]]
+YEXTENSION = tab.cxx
+# YSUBST =
+
+#### C files 
+CFILES = $[filter %.c,$[sources]]
+CFLAGS = $[building_var:%=-D%] $[alt_cflags] $[CFLAGS]
+
+#### C++ files 
+C++FILES = $[filter %.cxx,$[sources]]
+C++FLAGS = $[building_var:%=-D%] $[alt_cflags] $[C++FLAGS]
+# USETEMPLATES = TRUE
+# PTREPOSITORY = # Specify only if you want a specific name
+
+#### Interrogate info
+# IGATESCAN  = 
+# IGATEFLAGS = 
+# IGATEFILE  = # Specify only if you want a specific name
+IGATEMSCAN = $[igatemscan]
+
+#### Pull in deferred-target files built in other packages
+DEFERRED_FILES = $[TARGET]
+
+#### Additional search directories for C/C++ header files:
+IPATH = $[alt_ipath:%=-I%]
+
+#### Location to put .o files:
+# ODIR = 
+
+#### Source file dependencies (unnecessary with clearmake)
+# foo.c: foo.h
+
+#### Other files and lib.  Include $(ODIR) in any .o names.
+# OFILES = 
+WHEN_NO_DEFER_LIBS = $[when_no_defer:%=-l%]
+WHEN_DEFER_LIBS = $[when_defer:%=-l%]
+LIBS = $[when_either:%=-l%]
+SYSLIBS = $[patsubst %.lib,%.lib,%,-l%,$[unique $[alt_libs]]]
+
+#### Additional search directories for lib:
+LPATH = $[alt_lpath:%=-L%]
+
+#### Other linker flags. 
+#if $[ne $[alt_ld],]
+LD = $[alt_ld]
+#endif
+# LDFLAGS = 
+
+#### Pull in standard .o make variables
+include $(DTOOL)/include/Makefile.o.vars
+
+#### The .o action is here.
+include $(DTOOL)/include/Makefile.o.rules
+
+#### Pull in standard binary make variables.
+include $(DTOOL)/include/Makefile.bin.vars
+
+#### The .so action is here.
+include $(DTOOL)/include/Makefile.so.rules
+#end Makefile.$[TARGET].so
+
+#end metalib_target
+
+
+//////////////////////////////////////////////////////////////////////
+#elif $[eq $[DIR_TYPE], group]
+//////////////////////////////////////////////////////////////////////
+
+// This is a group directory: a directory above a collection of source
+// directories, e.g. $DTOOL/src.  We don't need to output anything in
+// this directory.
+
+
+
+//////////////////////////////////////////////////////////////////////
+#elif $[eq $[DIR_TYPE], toplevel]
+//////////////////////////////////////////////////////////////////////
+
+// This is the toplevel directory, e.g. $DTOOL.  Here we build the
+// root makefile and also synthesize the dtool_config.h (or whichever
+// file) we need.
+
+#output Makefile
+#format makefile
+#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+################################# DO NOT EDIT ###########################
+
+# Specify project name and project root directory.
+CTPROJECT = $[PACKAGE]
+CTPROJROOT = $($[upcase $[PACKAGE]])
+
+include $(DTOOL)/include/Makefile.project.vars
+
+// Iterate through all of our known source files.  Each src and
+// metalib type file gets its corresponding Makefile.install listed
+// here.  However, we test for $[DIR_TYPE] of toplevel, because the
+// source directories typically don't define their own DIR_TYPE
+// variable, and they end up inheriting this one dynamically.
+#forscopes */
+#if $[or $[eq $[DIR_TYPE], src],$[eq $[DIR_TYPE], metalib],$[and $[eq $[DIR_TYPE], toplevel],$[ne $[DIRNAME],top]]]
+#if $[build_directory]
+include $[PATH]/Makefile.install
+#endif
+#endif
+#end */
+
+#end Makefile
+
+// If there is a file called LocalSetup.pp in the package's top
+// directory, then invoke that.  It might contain some further setup
+// instructions.
+#sinclude $[TOPDIRPREFIX]LocalSetup.stopgap.pp
+#sinclude $[TOPDIRPREFIX]LocalSetup.pp
+
+//////////////////////////////////////////////////////////////////////
+#endif // DIR_TYPE

+ 572 - 0
dtool/pptempl/Template.unix.pp

@@ -0,0 +1,572 @@
+//
+// Template.unix.pp
+//
+// This file defines the set of output files that will be generated to
+// support a generic Unix-style build system.  It generates a number
+// of shared libraries named libtarget.so for each lib_target, assumes
+// object files are named file.o, and makes other Unix-like
+// assumptions.
+//
+
+//////////////////////////////////////////////////////////////////////
+#if $[or $[eq $[DIR_TYPE], src],$[eq $[DIR_TYPE], metalib]]
+//////////////////////////////////////////////////////////////////////
+
+// For a source directory, build a single Makefile with rules to build
+// each target.
+
+#define lib_targets $[TARGET(metalib_target lib_target noinst_lib_target):%=$[so_dir]/lib%.so]
+#define static_lib_targets $[TARGET(static_lib_target):%=$[st_dir]/lib%.a]
+#define bin_targets $[TARGET(bin_target noinst_bin_target sed_bin_target):%=$[st_dir]/%]
+#define test_bin_targets $[TARGET(test_bin_target):%=$[st_dir]/%]
+
+#define install_lib $[TARGET(metalib_target lib_target static_lib_target)]
+#define install_bin $[TARGET(bin_target)]
+#define install_scripts $[TARGET(sed_bin_target)] $[sort $[INSTALL_SCRIPTS(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_SCRIPTS]]
+#define install_headers $[sort $[INSTALL_HEADERS(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_HEADERS]]
+#define install_parser_inc $[sort $[INSTALL_PARSER_INC]]
+#define install_data $[sort $[INSTALL_DATA(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_DATA]]
+#define install_config $[sort $[INSTALL_CONFIG(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_CONFIG]]
+#define install_igatedb $[sort $[get_igatedb(metalib_target lib_target)]]
+
+#define so_sources $[get_sources(metalib_target lib_target noinst_lib_target)]
+#define st_sources $[get_sources(static_lib_target bin_target noinst_bin_target test_bin_target)]
+
+// These are the source files that our dependency cache file will
+// depend on.  If it's an empty list, we won't bother writing rules to
+// freshen the cache file.
+#define dep_sources $[sort $[filter %.c %.cxx %.yxx %.lxx %.h %.I,$[so_sources] $[st_sources]]]
+
+#if $[eq $[so_dir],$[st_dir]]
+  // If the static and shared directories are the same, we have to use the
+  // same rules to build both shared and static targets.
+  #set st_sources $[so_sources] $[st_sources]
+  #set so_sources
+#endif
+
+#define cxx_so_sources $[filter %.cxx,$[so_sources]]
+#define cxx_st_sources $[filter %.cxx,$[st_sources]]
+#define c_so_sources $[filter %.c,$[so_sources]]
+#define c_st_sources $[filter %.c,$[st_sources]]
+#define yxx_so_sources $[filter %.yxx,$[so_sources]]
+#define yxx_st_sources $[filter %.yxx,$[st_sources]]
+#define lxx_so_sources $[filter %.lxx,$[so_sources]]
+#define lxx_st_sources $[filter %.lxx,$[st_sources]]
+
+#map all_sources get_sources(metalib_target lib_target noinst_lib_target static_lib_target bin_target noinst_bin_target test_bin_target)
+
+#defer complete_local_libs $[sort $[closure all_libs,$[active_libs]]]
+#defer complete_ipath $[all_libs $[RELDIR],$[complete_local_libs]] $[RELDIR($[LOCAL_INCS:%=%/])]
+#defer file_ipath $[other_trees:%=%/include] $[TOPDIR] $[sort $[all_sources $[complete_ipath],$[file]]] $[all_sources $[get_ipath],$[file]]
+#defer target_ipath $[other_trees:%=%/include] $[TOPDIR] $[sort $[complete_ipath]] $[get_ipath]
+
+#defer cflags $[all_sources $[get_cflags] $[CFLAGS],$[file]] $[CFLAGS_OPT$[OPTIMIZE]]
+#defer c++flags $[all_sources $[get_cflags] $[C++FLAGS],$[file]] $[CFLAGS_OPT$[OPTIMIZE]]
+
+#defer target_lpath $[other_trees:%=%/lib] $[sort $[static_libs $[RELDIR:%=%/$[st_dir]],$[complete_local_libs]] $[dynamic_libs $[RELDIR:%=%/$[so_dir]],$[complete_local_libs]]]
+#defer lpath $[target_lpath] $[get_lpath]
+#defer libs $[unique $[complete_local_libs] $[patsubst %:m,,%:c %,%,$[OTHER_LIBS]] $[get_libs]]
+
+#output Makefile
+#format makefile
+#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+################################# DO NOT EDIT ###########################
+
+#define all_targets \
+    Makefile \
+    $[if $[dep_sources],$[DEPENDENCY_CACHE_FILENAME]] \
+    $[if $[so_sources],$[so_dir]] \
+    $[if $[st_sources],$[st_dir]] \
+    $[sort $[lib_targets] $[static_lib_targets] $[bin_targets]]
+all : $[all_targets]
+
+test : $[test_bin_targets]
+
+clean :
+#if $[so_sources]
+	rm -rf $[so_dir]
+#endif
+#if $[st_sources]
+	rm -rf $[st_dir]
+#endif
+
+cleanall : clean
+#if $[yxx_so_sources] $[yxx_st_sources] $[lxx_so_sources] $[lxx_st_sources]
+	rm -f $[patsubst %.yxx %.lxx,%.cxx,$[yxx_so_sources] $[yxx_st_sources] $[lxx_so_sources] $[lxx_st_sources]]
+#endif
+#if $[ne $[DEPENDENCY_CACHE_FILENAME],]
+	rm -f $[DEPENDENCY_CACHE_FILENAME]
+#endif
+
+#define installed_files \
+     $[INSTALL_SCRIPTS:%=$[install_bin_dir]/%] \
+     $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \
+     $[INSTALL_PARSER_INC:%=$[install_parser_inc_dir]/%] \
+     $[INSTALL_DATA:%=$[install_data_dir]/%] \
+     $[INSTALL_CONFIG:%=$[install_config_dir]/%]
+
+#define install_targets \
+     $[sort \
+       $[if $[install_lib],$[install_lib_dir]] \
+       $[if $[install_bin] $[install_scripts],$[install_bin_dir]] \
+       $[if $[install_headers],$[install_headers_dir]] \
+       $[if $[install_parser_inc],$[install_parser_inc_dir]] \
+       $[if $[install_data],$[install_data_dir]] \
+       $[if $[install_config],$[install_config_dir]] \
+       $[if $[install_igatedb],$[install_igatedb_dir]] \
+     ] \
+     $[TARGET(metalib_target lib_target static_lib_target):%=install-lib%] $[TARGET(bin_target):%=install-%] \
+     $[installed_files]
+install : all $[install_targets]
+
+uninstall : $[TARGET(metalib_target lib_target static_lib_target):%=uninstall-lib%] $[TARGET(bin_target):%=uninstall-%]
+#if $[installed_files]
+	rm -f $[sort $[installed_files]]
+#endif
+
+
+// Define rules to create each install directory when needed.
+#foreach directory $[sort \
+    $[if $[so_sources],$[so_dir]] \
+    $[if $[st_sources],$[st_dir]] \
+    $[if $[install_lib],$[install_lib_dir]] \
+    $[if $[install_bin] $[install_scripts],$[install_bin_dir]] \
+    $[if $[install_headers],$[install_headers_dir]] \
+    $[if $[install_parser_inc],$[install_parser_inc_dir]] \
+    $[if $[install_data],$[install_data_dir]] \
+    $[if $[install_config],$[install_config_dir]] \
+    $[if $[install_igatedb],$[install_igatedb_dir]] \
+    ]
+$[directory] :
+	@test -d $[directory] || echo mkdir -p $[directory]
+	@test -d $[directory] || mkdir -p $[directory]
+#end directory
+
+#forscopes metalib_target lib_target
+#define igatescan $[get_igatescan]
+#define igateoutput $[if $[igatescan],lib$[TARGET]_igate.cxx]
+#define igatedb $[get_igatedb]
+
+// Should we build a metalib module for all the interrogated libraries
+// that are included on this metalib?
+#define igatemscan $[components $[get_igatedb:%=$[RELDIR]/$[so_dir]/%],$[active_component_libs]]
+#define igatemout $[if $[igatemscan],lib$[TARGET]_module.cxx]
+
+lib_$[TARGET]_so = $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[so_dir]/%.o,%,,$[get_sources] $[igateoutput] $[igatemout]]]
+$[so_dir]/lib$[TARGET].so : $(lib_$[TARGET]_so)
+#define target $@
+#define sources $(lib_$[TARGET]_so)
+#if $[filter %.cxx %.yxx %.lxx,$[get_sources]]
+	$[SHARED_LIB_C++]
+#else
+	$[SHARED_LIB_C]
+#endif
+
+#define installed_files \
+    $[install_lib_dir]/lib$[TARGET].so \
+    $[INSTALL_SCRIPTS:%=$[install_bin_dir]/%] \
+    $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \
+    $[INSTALL_DATA:%=$[install_data_dir]/%] \
+    $[INSTALL_CONFIG:%=$[install_config_dir]/%] \
+    $[igatedb:%=$[install_igatedb_dir]/%]
+
+install-lib$[TARGET] : $[installed_files]
+
+uninstall-lib$[TARGET] :
+#if $[installed_files]
+	rm -f $[sort $[installed_files]]
+#endif
+
+$[install_lib_dir]/lib$[TARGET].so : $[so_dir]/lib$[TARGET].so
+#define local $<
+#define dest $[install_lib_dir]
+	$[INSTALL]
+
+#if $[igatescan]
+// Now, some additional rules to build the interrogate file into the
+// library, if requested.
+
+// The library name is based on this library.
+#define igatelib lib$[TARGET]
+// The module name comes from the metalib that includes this library.
+#define igatemod $[module $[TARGET],$[TARGET]]
+#if $[eq $[igatemod],]
+  // Unless no metalib includes this library.
+  #define igatemod $[TARGET]
+#endif
+
+$[install_igatedb_dir]/$[igatedb] : $[so_dir]/$[igatedb]
+#define local $<
+#define dest $[install_igatedb_dir]
+	$[INSTALL]
+
+lib$[TARGET]_igatescan = $[igatescan]
+$[so_dir]/$[igatedb] $[so_dir]/$[igateoutput] : $[filter-out .c .cxx,$[igatescan]]
+	interrogate -od $[so_dir]/$[igatedb] -oc $[so_dir]/$[igateoutput] -DCPPPARSER -D__cplusplus $[SYSTEM_IGATE_FLAGS] -S$[install_parser_inc_dir] $[target_ipath:%=-I%] $[filter -D%,$[get_cflags] $[C++FLAGS]] -module "$[igatemod]" -library "$[igatelib]" -fnames -string -refcount -assert -promiscuous -python $(lib$[TARGET]_igatescan)
+
+$[igateoutput:%.cxx=$[so_dir]/%.o] : $[so_dir]/$[igateoutput]
+#define target $@
+#define source $<
+#define ipath . $[target_ipath]
+#define flags $[get_cflags] $[C++FLAGS] $[CFLAGS_OPT$[OPTIMIZE]] $[CFLAGS_SHARED]
+	$[COMPILE_C++]
+#endif
+
+#if $[igatemout]
+// And finally, some additional rules to build the interrogate module
+// file into the library, if this is a metalib that includes
+// interrogated components.
+
+#define igatelib lib$[TARGET]
+#define igatemod $[TARGET]
+
+lib$[TARGET]_igatemscan = $[igatemscan]
+$[so_dir]/$[igatemout] : $(lib$[TARGET]_igatemscan)
+	interrogate_module -oc $@ -module "$[igatemod]" -library "$[igatelib]" -python $(lib$[TARGET]_igatemscan)
+
+$[igatemout:%.cxx=$[so_dir]/%.o] : $[so_dir]/$[igatemout]
+#define target $@
+#define source $<
+#define ipath . $[target_ipath]
+#define flags $[get_cflags] $[C++FLAGS] $[CFLAGS_OPT$[OPTIMIZE]] $[CFLAGS_SHARED]
+	$[COMPILE_C++]
+#endif
+
+#end metalib_target lib_target
+
+
+
+#forscopes noinst_lib_target
+lib_$[TARGET]_so = $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[so_dir]/%.o,%,,$[get_sources]]]
+$[so_dir]/lib$[TARGET].so : $(lib_$[TARGET]_so)
+#define target $@
+#define sources $(lib_$[TARGET]_so)
+#if $[filter %.cxx %.yxx %.lxx,$[get_sources]]
+	$[SHARED_LIB_C++]
+#else
+	$[SHARED_LIB_C]
+#endif
+
+#end noinst_lib_target
+
+
+
+#forscopes static_lib_target
+lib_$[TARGET]_a = $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[st_dir]/%.o,%,,$[get_sources]]]
+$[st_dir]/lib$[TARGET].a : $(lib_$[TARGET]_a)
+#define target $@
+#define sources $(lib_$[TARGET]_a)
+#if $[filter %.cxx %.yxx %.lxx,$[get_sources]]
+	$[STATIC_LIB_C++]
+#else
+	$[STATIC_LIB_C]
+#endif
+#if $[RANLIB]
+	$[RANLIB]
+#endif
+
+#define installed_files \
+    $[install_lib_dir]/lib$[TARGET].a \
+    $[INSTALL_SCRIPTS:%=$[install_bin_dir]/%] \
+    $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \
+    $[INSTALL_DATA:%=$[install_data_dir]/%] \
+    $[INSTALL_CONFIG:%=$[install_config_dir]/%]
+
+install-lib$[TARGET] : $[installed_files]
+
+uninstall-lib$[TARGET] :
+#if $[installed_files]
+	rm -f $[sort $[installed_files]]
+#endif
+
+$[install_lib_dir]/lib$[TARGET].a : $[st_dir]/lib$[TARGET].a
+#define local $<
+#define dest $[install_lib_dir]
+	$[INSTALL]
+
+#end static_lib_target
+
+
+#forscopes sed_bin_target
+// The sed_bin_target is a special target: it defines a file that is to
+// be processed with sed to produce an executable script.  Pretty 
+// Unix-specific, so we'd better not have too many of these.
+$[st_dir]/$[TARGET] : $[SOURCE]
+	$[SED] $[COMMAND] $^ >$@
+	chmod +x $@
+
+#define installed_files \
+    $[install_bin_dir]/$[TARGET]
+
+install-$[TARGET] : $[installed_files]
+
+uninstall-$[TARGET] :
+#if $[installed_files]
+	rm -f $[sort $[installed_files]]
+#endif
+
+$[install_bin_dir]/$[TARGET] : $[st_dir]/$[TARGET]
+#define local $<
+#define dest $[install_bin_dir]
+	$[INSTALL_PROG]
+
+#end sed_bin_target
+
+
+#forscopes bin_target
+bin_$[TARGET] = $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[st_dir]/%.o,%,,$[get_sources]]]
+$[st_dir]/$[TARGET] : $(bin_$[TARGET])
+#define target $@
+#define sources $(bin_$[TARGET])
+#define ld $[get_ld]
+#if $[ld]
+  // If there's a custom linker defined for the target, we have to use it.
+	$[ld] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]	
+#else
+  // Otherwise, we can use the normal linker.
+  #if $[filter %.cxx %.yxx %.lxx,$[get_sources]]
+	$[LINK_BIN_C++]
+  #else
+	$[LINK_BIN_C]
+  #endif
+#endif
+
+#define installed_files \
+    $[install_bin_dir]/$[TARGET] \
+    $[INSTALL_SCRIPTS:%=$[install_bin_dir]/%] \
+    $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \
+    $[INSTALL_DATA:%=$[install_data_dir]/%] \
+    $[INSTALL_CONFIG:%=$[install_config_dir]/%]
+
+install-$[TARGET] : $[installed_files]
+
+uninstall-$[TARGET] :
+#if $[installed_files]
+	rm -f $[sort $[installed_files]]
+#endif
+
+$[install_bin_dir]/$[TARGET] : $[st_dir]/$[TARGET]
+#define local $<
+#define dest $[install_bin_dir]
+	$[INSTALL_PROG]
+
+#end bin_target
+
+
+
+#forscopes noinst_bin_target test_bin_target
+bin_$[TARGET] = $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[st_dir]/%.o,%,,$[get_sources]]]
+$[st_dir]/$[TARGET] : $(bin_$[TARGET])
+#define target $@
+#define sources $(bin_$[TARGET])
+#if $[filter %.cxx %.yxx %.lxx,$[get_sources]]
+	$[LINK_BIN_C++]
+#else
+	$[LINK_BIN_C]
+#endif
+
+#end noinst_bin_target test_bin_target
+
+
+
+#foreach file $[sort $[yxx_so_sources] $[yxx_st_sources]]
+$[patsubst %.yxx,%.cxx,$[file]] : $[file]
+	$[BISON] -y $[if $[YACC_PREFIX],-d --name-prefix=$[YACC_PREFIX]] $<
+	mv y.tab.c $@
+	mv y.tab.h $[patsubst %.yxx,%.h,$[file]]
+
+#end file
+#foreach file $[sort $[lxx_so_sources] $[lxx_st_sources]]
+$[patsubst %.lxx,%.cxx,$[file]] : $[file]
+	$[FLEX] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $<
+	$[SED] '/#include <unistd.h>/d' lex.yy.c > $@
+	rm lex.yy.c
+
+#end file
+#foreach file $[sort $[c_so_sources]]
+$[patsubst %.c,$[so_dir]/%.o,$[file]] : $[file] $[dependencies $[file]]
+#define target $@
+#define source $<
+#define ipath $[file_ipath]
+#define flags $[cflags] $[CFLAGS_SHARED]
+	$[COMPILE_C]
+
+#end file
+#foreach file $[sort $[c_st_sources]]
+$[patsubst %.c,$[st_dir]/%.o,$[file]] : $[file] $[dependencies $[file]]
+#define target $@
+#define source $<
+#define ipath $[file_ipath]
+#define flags $[cflags]
+	$[COMPILE_C]
+
+#end file
+#foreach file $[sort $[cxx_so_sources] $[yxx_so_sources] $[lxx_so_sources]]
+$[patsubst %.cxx %.lxx %.yxx,$[so_dir]/%.o,$[file]] : $[patsubst %.cxx %.lxx %.yxx,%.cxx,$[file]] $[dependencies $[file]]
+#define target $@
+#define source $<
+#define ipath $[file_ipath]
+#define flags $[c++flags] $[CFLAGS_SHARED]
+	$[COMPILE_C++]
+
+#end file
+#foreach file $[sort $[cxx_st_sources] $[yxx_st_sources] $[lxx_st_sources]]
+$[patsubst %.cxx %.lxx %.yxx,$[st_dir]/%.o,$[file]] : $[patsubst %.cxx %.lxx %.yxx,%.cxx,$[file]] $[dependencies $[file]]
+#define target $@
+#define source $<
+#define ipath $[file_ipath]
+#define flags $[c++flags]
+	$[COMPILE_C++]
+
+#end file
+
+// And now the rules to install the auxiliary files, like headers and
+// data files.
+#foreach file $[install_scripts]
+$[install_bin_dir]/$[file] : $[file]
+#define local $<
+#define dest $[install_bin_dir]
+	$[INSTALL_PROG]
+#end file
+
+#foreach file $[install_headers]
+$[install_headers_dir]/$[file] : $[file]
+#define local $<
+#define dest $[install_headers_dir]
+	$[INSTALL]
+#end file
+
+#foreach file $[install_parser_inc]
+$[install_parser_inc_dir]/$[file] : $[file]
+#define local $<
+#define dest $[install_parser_inc_dir]
+	$[INSTALL]
+#end file
+
+#foreach file $[install_data]
+$[install_data_dir]/$[file] : $[file]
+#define local $<
+#define dest $[install_data_dir]
+	$[INSTALL]
+#end file
+
+#foreach file $[install_config]
+$[install_config_dir]/$[file] : $[file]
+#define local $<
+#define dest $[install_config_dir]
+	$[INSTALL]
+#end file
+
+
+// Finally, the rules to freshen the Makefile itself.
+Makefile : $[SOURCE_FILENAME]
+	ppremake
+
+#if $[and $[DEPENDENCY_CACHE_FILENAME],$[dep_sources]]
+$[DEPENDENCY_CACHE_FILENAME] : $[dep_sources]
+	@ppremake -D $[DEPENDENCY_CACHE_FILENAME]
+#endif
+
+
+#end Makefile
+
+
+//////////////////////////////////////////////////////////////////////
+#elif $[eq $[DIR_TYPE], group]
+//////////////////////////////////////////////////////////////////////
+
+// This is a group directory: a directory above a collection of source
+// directories, e.g. $DTOOL/src.  We don't need to output anything in
+// this directory.
+
+
+
+//////////////////////////////////////////////////////////////////////
+#elif $[eq $[DIR_TYPE], toplevel]
+//////////////////////////////////////////////////////////////////////
+
+// This is the toplevel directory, e.g. $DTOOL.  Here we build the
+// root makefile and also synthesize the dtool_config.h (or whichever
+// file) we need.
+
+#map subdirs
+// Iterate through all of our known source files.  Each src and
+// metalib type file gets its corresponding Makefile listed
+// here.  However, we test for $[DIR_TYPE] of toplevel, because the
+// source directories typically don't define their own DIR_TYPE
+// variable, and they end up inheriting this one dynamically.
+#forscopes */
+#if $[or $[eq $[DIR_TYPE], src],$[eq $[DIR_TYPE], metalib],$[and $[eq $[DIR_TYPE], toplevel],$[ne $[DIRNAME],top]]]
+#if $[build_directory]
+  #addmap subdirs $[DIRNAME]
+#endif
+#endif
+#end */
+
+#output Makefile
+#format makefile
+#### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
+################################# DO NOT EDIT ###########################
+
+all : $[subdirs]
+test : $[subdirs:%=test-%]
+clean : $[subdirs:%=clean-%]
+cleanall : $[subdirs:%=cleanall-%]
+install : $[if $[CONFIG_HEADER],$[install_headers_dir] $[install_headers_dir]/$[CONFIG_HEADER]] $[subdirs:%=install-%]
+uninstall : $[subdirs:%=uninstall-%]
+#if $[CONFIG_HEADER]
+	rm -f $[install_headers_dir]/$[CONFIG_HEADER]
+#endif
+
+#formap dirname subdirs
+#define depends 
+$[dirname] : $[dirnames $[if $[build_directory],$[DIRNAME]],$[DEPEND_DIRS]]
+	cd $[PATH]; $(MAKE) all
+#end dirname
+
+#formap dirname subdirs
+test-$[dirname] :
+	cd $[PATH]; $(MAKE) test
+#end dirname
+
+#formap dirname subdirs
+clean-$[dirname] :
+	cd $[PATH]; $(MAKE) clean
+#end dirname
+
+#formap dirname subdirs
+cleanall-$[dirname] :
+	cd $[PATH]; $(MAKE) cleanall
+#end dirname
+
+#formap dirname subdirs
+install-$[dirname] : $[patsubst %,install-%,$[dirnames $[if $[build_directory],$[DIRNAME]],$[DEPEND_DIRS]]]
+	cd $[PATH]; $(MAKE) install
+#end dirname
+
+#formap dirname subdirs
+uninstall-$[dirname] :
+	cd $[PATH]; $(MAKE) uninstall
+#end dirname
+
+#if $[ne $[CONFIG_HEADER],]
+$[install_headers_dir] :
+	@test -d $[install_headers_dir] || echo mkdir -p $[install_headers_dir]
+	@test -d $[install_headers_dir] || mkdir -p $[install_headers_dir]
+
+$[install_headers_dir]/$[CONFIG_HEADER] : $[CONFIG_HEADER]
+#define local $<
+#define dest $[install_headers_dir]
+	$[INSTALL]
+#endif
+
+#end Makefile
+
+// If there is a file called LocalSetup.pp in the package's top
+// directory, then invoke that.  It might contain some further setup
+// instructions.
+#sinclude $[TOPDIRPREFIX]LocalSetup.unix.pp
+#sinclude $[TOPDIRPREFIX]LocalSetup.pp
+
+//////////////////////////////////////////////////////////////////////
+#endif // DIR_TYPE

+ 1 - 1
dtool/src/attach/Sources.pp

@@ -8,6 +8,6 @@
     ctunco ctattachcc cttimewarp get-cttree update-cttree get-delta \
     ctsanity ctmkelem ctmkdir ctci ctco ctrm ctmv ctmake neartool
 
-#define INSTALL_DATA \
+#define INSTALL_CONFIG \
     dtool.cshrc dtool.init dtool.emacs dtool.alias \
     dtool.sh dtool.alias-sh

+ 5 - 5
dtool/src/attach/ctallihave

@@ -9,11 +9,11 @@ if ( $tool eq "" ) {
    die "not configured for using CTtools\n" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 $projs = $ENV{"CTPROJS"} ;
 @projsplit = split( / +/, $projs ) ;

+ 3 - 3
dtool/src/attach/ctattach.drv

@@ -25,7 +25,7 @@ if ( $tool eq "" ) {
     die "\$" . "DTOOL environment must be set to use CTtools\n" ;
 }
 
-require "$tool/inc/ctattch.pl" ;
+require "$tool/include/ctattch.pl" ;
 
 $tmpname = "/tmp/script.$$" ;
 
@@ -90,8 +90,8 @@ if (( $noflav == 1 ) || ( $flav eq "default" )) {
 # act on the arguments we got
 #
 
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctvspec.pl" ;
 
 if (( $proj eq "-" ) || ( $flav eq "-" )) {
    if ( $#ARGV == 0 ) {

+ 4 - 4
dtool/src/attach/ctattch.pl

@@ -1,4 +1,4 @@
-require "$tool/inc/ctutils.pl" ;
+require "$tool/include/ctutils.pl" ;
 
 $shell_type = "csh" ;
 if ( $ENV{"SHELL_TYPE"} ne "" ) {
@@ -10,7 +10,7 @@ if ( $ENV{"SHELL_TYPE"} ne "" ) {
 $docnt = 0 ;
 @attachqueue = () ;
 
-require "$tool/inc/ctquery.pl" ;
+require "$tool/include/ctquery.pl" ;
 
 # force set a variable in the 'new' environment
 # input is in:
@@ -136,7 +136,7 @@ sub CTAttachMod {
     }
 }
 
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 # given the project and flavor, build the lists of variables to set/modify
 # input is in:
@@ -367,7 +367,7 @@ sub CTAttachCompute {
       #if ( -e $item ) {
 	  &CTAttachMod( "CDPATH", $item, $root, $proj ) ;
       #}
-      $item = $root . "/inc" ;
+      $item = $root . "/include" ;
       #if ( -e $item ) {
 	  &CTAttachMod( "CT_INCLUDE_PATH", $item, $root, $proj ) ;
       #}

+ 3 - 3
dtool/src/attach/ctattch.pl.rnd

@@ -1,4 +1,4 @@
-require "$tool/inc/ctutils.pl" ;
+require "$tool/include/ctutils.pl" ;
 
 # get list of all projects
 sub CTAttachListProj {
@@ -490,7 +490,7 @@ sub CTAttachAddToSet {
 $docnt = 0 ;
 @attachqueue = () ;
 
-require "$tool/inc/ctquery.pl" ;
+require "$tool/include/ctquery.pl" ;
 
 # given the project and flavor, build the lists of variables to set/modify
 # input is in:
@@ -566,7 +566,7 @@ sub CTAttachCompute {
       &CTAttachAddToMod( "PATH", $root . "/bin" ) ;
       &CTAttachAddToMod( "LD_LIBRARY_PATH", $root . "/lib" ) ;
       &CTAttachAddToMod( "CDPATH", $root . "/src/all" ) ;
-      &CTAttachAddToMod( "CT_INCLUDE_PATH", $root . "/inc" ) ;
+      &CTAttachAddToMod( "CT_INCLUDE_PATH", $root . "/include" ) ;
       &CTAttachAddToMod( "DC_PATH", $root . "/etc" ) ;
       &CTAttachAddToMod( "PFPATH", $root . "/etc/models" ) ;
       &CTAttachAddToMod( "SSPATH", $root . "/lib/ss" ) ;

+ 2 - 2
dtool/src/attach/ctccase.pl

@@ -241,7 +241,7 @@ $timestamp =~ s/:/_/g ;
 # output:
 # return success or failure
 sub CTCcaseDelta {
-    require "$tool/inc/ctdelta.pl" ;
+    require "$tool/include/ctdelta.pl" ;
 
     &CTUDebug( "in CTCcaseDelta\n" ) ;
     local( $ret ) = 0 ;
@@ -310,7 +310,7 @@ sub CTCcaseCheckin {
 # output:
 # return success or failure
 sub CTCcaseUncheckout {
-    require "$tool/inc/unco.pl" ;
+    require "$tool/include/unco.pl" ;
     &CTUDebug( "in CTCcaseUncheckout\n" ) ;
     local( $ret ) = 1 ;
     # need better error checking on this

+ 5 - 5
dtool/src/attach/ctci

@@ -17,11 +17,11 @@ if ( $tool eq "" ) {
    die "Environment not configured for CTtools" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 $comment = "" ;
 

+ 34 - 34
dtool/src/attach/ctcm.pl

@@ -1,5 +1,5 @@
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
 
 # given a spec line, do the 'correct' setup for it
 # input is in:
@@ -11,7 +11,7 @@ sub CTCMSetup {
     if ( $type eq "vroot" ) {
 	&CTUDebug( "running setup for an atria tree\n" ) ;
 	if ( $ENV{"HAVE_ATRIA"} eq "yes" ) {
-	    require "$tool/inc/ctccase.pl" ;
+	    require "$tool/include/ctccase.pl" ;
 	    &CTAttachCCSetup( $_[0], $_[1], $_[2] ) ;
 	} else {
 	    &CTUDebug( "don't HAVE_ATRIA!\n" ) ;
@@ -19,7 +19,7 @@ sub CTCMSetup {
 	# if we don't have atria, and it's a vroot, well..
     } elsif ( $type eq "croot" ) {
 	&CTUDebug( "running setup for CVS\n" ) ;
-	require "$tool/inc/ctcvs.pl" ;
+	require "$tool/include/ctcvs.pl" ;
 	local( $serve ) = &CTCvsServerLine( $_[0], $_[1] ) ;
 	local( $thing ) = &CTCvsLogin( $serve ) ;
 	if ( ! $thing ) {
@@ -72,13 +72,13 @@ sub CTCMMkdir {
 	    # now switch off on how to actually do it
 	    local( $type ) = &CTSpecType( $_[2] ) ;
 	    if ( $type eq "vroot" ) {
-		require "$tool/inc/ctccase.pl" ;
+		require "$tool/include/ctccase.pl" ;
 		$ret = &CTCcaseMkdir( $_[0], $pwd, $_[3] ) ;
 	    } elsif ( $type eq "root" ) {
-		require "$tool/inc/ctntool.pl" ;
+		require "$tool/include/ctntool.pl" ;
 		$ret = &CTNtoolMkdir( $_[0], $pwd, $_[3] ) ;
 	    } elsif ( $type eq "croot" ) {
-		require "$tool/inc/ctcvs.pl" ;
+		require "$tool/include/ctcvs.pl" ;
 		$ret = &CTCvsMkdir( $_[0], $_[1], $_[2], $_[3] ) ;
 	    } else {
 		print STDERR "CTCMMkdir::error! got invalid spec type '" .
@@ -141,13 +141,13 @@ sub CTCMMkelem {
 	# now switch off on how to actually do the work
 	local( $type ) = &CTSpecType( $_[2] ) ;
 	if ( $type eq "vroot" ) {
-	    require "$tool/inc/ctccase.pl" ;
+	    require "$tool/include/ctccase.pl" ;
 	    $ret = &CTCcaseMkelem( $_[0], $pwd, $_[3], $_[4] ) ;
 	} elsif ( $type eq "root" ) {
-	    require "$tool/inc/ctntool.pl" ;
+	    require "$tool/include/ctntool.pl" ;
 	    $ret = &CTNtoolMkelem( $_[0], $pwd, $_[3], $_[4] ) ;
 	} elsif ( $type eq "croot" ) {
-	    require "$tool/inc/ctcvs.pl" ;
+	    require "$tool/include/ctcvs.pl" ;
 	    $ret = &CTCvsMkelem( $_[0], $_[1], $_[2], $_[3] ) ;
 	} else {
 	    print STDERR "CTCMMkelem::error! got invalid spec type '" .
@@ -198,13 +198,13 @@ sub CTCMDelta {
 	# now switch off on how to actually do the work
 	local( $type ) = &CTSpecType( $_[2] ) ;
 	if ( $type eq "vroot" ) {
-	    require "$tool/inc/ctccase.pl" ;
+	    require "$tool/include/ctccase.pl" ;
 	    $ret = &CTCcaseDelta( $_[0] ) ;
 	} elsif ( $type eq "root" ) {
-	    require "$tool/inc/ctntool.pl" ;
+	    require "$tool/include/ctntool.pl" ;
 	    $ret = &CTNtoolDelta( $_[0] ) ;
 	} elsif ( $type eq "croot" ) {
-	    require "$tool/inc/ctcvs.pl" ;
+	    require "$tool/include/ctcvs.pl" ;
 	    $ret = &CTCvsDelta( $_[0], $_[1], $_[2] ) ;
 	} else {
 	    print STDERR "CTCMDelta::error! got invalid spec type '" . $type .
@@ -258,13 +258,13 @@ sub CTCMCheckout {
 	# now switch off on how to actually do the work
 	local( $type ) = &CTSpecType( $_[2] ) ;
 	if ( $type eq "vroot" ) {
-	    require "$tool/inc/ctccase.pl" ;
+	    require "$tool/include/ctccase.pl" ;
 	    $ret = &CTCcaseCheckout( $_[0], $_[3] ) ;
 	} elsif ( $type eq "root" ) {
-	    require "$tool/inc/ctntool.pl" ;
+	    require "$tool/include/ctntool.pl" ;
 	    $ret = &CTNtoolCheckout( $_[0], $_[3] ) ;
 	} elsif ( $type eq "croot" ) {
-	    require "$tool/inc/ctcvs.pl" ;
+	    require "$tool/include/ctcvs.pl" ;
 	    $ret = &CTCvsCheckout( $_[0], $_[1], $_[2], $_[3] ) ;
 	} else {
 	    print STDERR "CTCMCheckout::error! got invalid spec type '" .
@@ -316,13 +316,13 @@ sub CTCMCheckin {
 	# now switch off on how to actually do the work
 	local( $type ) = &CTSpecType( $_[2] ) ;
 	if ( $type eq "vroot" ) {
-	    require "$tool/inc/ctccase.pl" ;
+	    require "$tool/include/ctccase.pl" ;
 	    $ret = &CTCcaseCheckin( $_[0], $_[3] ) ;
 	} elsif ( $type eq "root" ) {
-	    require "$tool/inc/ctntool.pl" ;
+	    require "$tool/include/ctntool.pl" ;
 	    $ret = &CTNtoolCheckin( $_[0], $_[3] ) ;
 	} elsif ( $type eq "croot" ) {
-	    require "$tool/inc/ctcvs.pl" ;
+	    require "$tool/include/ctcvs.pl" ;
 	    $ret = &CTCvsCheckin( $_[0], $_[1], $_[2], $_[3] ) ;
 	} else {
 	    print STDERR "CTCMCheckin::error! got invalid spec type '" .
@@ -373,13 +373,13 @@ sub CTCMUncheckout {
 	# now switch off on how to actually do the work
 	local( $type ) = &CTSpecType( $_[2] ) ;
 	if ( $type eq "vroot" ) {
-	    require "$tool/inc/ctccase.pl" ;
+	    require "$tool/include/ctccase.pl" ;
 	    $ret = &CTCcaseUncheckout( $_[0] ) ;
 	} elsif ( $type eq "root" ) {
-	    require "$tool/inc/ctntool.pl" ;
+	    require "$tool/include/ctntool.pl" ;
 	    $ret = &CTNtoolUncheckout( $_[0] ) ;
 	} elsif ( $type eq "croot" ) {
-	    require "$tool/inc/ctcvs.pl" ;
+	    require "$tool/include/ctcvs.pl" ;
 	    $ret = &CTCvsUncheckout( $_[0], $_[1], $_[2] ) ;
 	} else {
 	    print STDERR "CTCMUncheckout::error! got invalid spec type '" .
@@ -403,13 +403,13 @@ sub CTCMIHave {
     local( $ret ) = "" ;
     local( $type ) = &CTSpecType( $_[2] ) ;
     if ( $type eq "vroot" ) {
-	require "$tool/inc/ctccase.pl" ;
+	require "$tool/include/ctccase.pl" ;
 	$ret = &CTCcaseIHave( $_[0], $_[1], $_[2] ) ;
     } elsif ( $type eq "root" ) {
-	require "$tool/inc/ctntool.pl" ;
+	require "$tool/include/ctntool.pl" ;
 	$ret = &CTNtoolIHave( $_[0], $_[1], $_[2] ) ;
     } elsif ( $type eq "croot" ) {
-	require "$tool/inc/ctcvs.pl" ;
+	require "$tool/include/ctcvs.pl" ;
 	$ret = &CTCvsIHave( $_[0], $_[1], $_[2] ) ;
     } else {
 	print STDERR "CTCMIHave::error! got invalid spec type '" . $type .
@@ -459,13 +459,13 @@ sub CTCMRmElem {
 	# now switch off on how to actually do the work
 	local( $type ) = &CTSpecType( $_[2] ) ;
 	if ( $type eq "vroot" ) {
-	    require "$tool/inc/ctccase.pl" ;
+	    require "$tool/include/ctccase.pl" ;
 	    $ret = &CTCcaseRnElem( $_[0], $pwd ) ;
 	} elsif ( $type eq "root" ) {
-	    require "$tool/inc/ctntool.pl" ;
+	    require "$tool/include/ctntool.pl" ;
 	    $ret = &CTNtoolRmElem( $_[0], $pwd ) ;
 	} elsif ( $type eq "croot" ) {
-	    require "$tool/inc/ctcvs.pl" ;
+	    require "$tool/include/ctcvs.pl" ;
 	    $ret = &CTCvsRmElem( $_[0], $_[1], $_[2] ) ;
 	} else {
 	    print STDERR "CTCMRmElem::error! got invalid spec type '" .
@@ -529,13 +529,13 @@ sub CTCMMv {
 	# now switch off on how to actually do the work
 	local( $type ) = &CTSpecType( $_[3] ) ;
 	if ( $type eq "vroot" ) {
-	    require "$tool/inc/ctccase.pl" ;
+	    require "$tool/include/ctccase.pl" ;
 	    $ret = &CTCcaseMv( $_[0], $_[1], $pwd ) ;
 	} elsif ( $type eq "root" ) {
-	    require "$tool/inc/ctntool.pl" ;
+	    require "$tool/include/ctntool.pl" ;
 	    $ret = &CTNtoolMv( $_[0], $_[1], $pwd ) ;
 	} elsif ( $type eq "croot" ) {
-	    require "$tool/inc/ctcvs.pl" ;
+	    require "$tool/include/ctcvs.pl" ;
 	    $ret = &CTCvsMv( $_[0], $_[1], $_[2], $_[3] ) ;
 	} else {
 	    print STDERR "CTCMMv::error! got invalid spec type '" .
@@ -560,13 +560,13 @@ sub CTCMMake {
     # now switch off on how to actually do the work
     local( $type ) = &CTSpecType( $_[2] ) ;
     if ( $type eq "vroot" ) {
-	require "$tool/inc/ctccase.pl" ;
+	require "$tool/include/ctccase.pl" ;
 	$ret = &CTCcaseMake( $_[0] ) ;
     } elsif ( $type eq "root" ) {
-	require "$tool/inc/ctntool.pl" ;
+	require "$tool/include/ctntool.pl" ;
 	$ret = &CTNtoolMake( $_[0] ) ;
     } elsif ( $type eq "croot" ) {
-	require "$tool/inc/ctcvs.pl" ;
+	require "$tool/include/ctcvs.pl" ;
 	$ret = &CTCvsMake( $_[0] ) ;
     } else {
 	print STDERR "CTCMMake::error! got invalid spec type '" . $type .

+ 5 - 5
dtool/src/attach/ctco

@@ -17,11 +17,11 @@ if ( $tool eq "" ) {
    die "Environment not configured for CTtools" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 $comment = "" ;
 

+ 1 - 1
dtool/src/attach/ctcvs.pl

@@ -81,7 +81,7 @@ sub CTCvsLogin {
     $ret ;
 }
 
-require "$tool/inc/ctproj.pl" ;
+require "$tool/include/ctproj.pl" ;
 
 # add a versioned element to the repository
 # input is in:

+ 5 - 5
dtool/src/attach/ctdelta

@@ -9,11 +9,11 @@ if ( $tool eq "" ) {
     die "not configured for using ct-tools\n" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 $comment = "" ;
 $skip = 0 ;

+ 5 - 5
dtool/src/attach/ctihave

@@ -9,11 +9,11 @@ if ( $tool eq "" ) {
    die "not configured for using CTtools\n" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 $projname = &CTProj ;
 $projname =~ tr/A-Z/a-z/ ;

+ 5 - 5
dtool/src/attach/ctmake

@@ -5,11 +5,11 @@ if ( $tool eq "" ) {
     die "not configured for using ct-tools\n" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 $projname = &CTProj ;
 $projname =~ tr/A-Z/a-z/ ;

+ 5 - 5
dtool/src/attach/ctmkdir

@@ -17,11 +17,11 @@ if ( $tool eq "" ) {
    die "Environment not configured for CTtools" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 $comment = "" ;
 if ( $ARGV[0] eq "-nc" ) {

+ 5 - 5
dtool/src/attach/ctmkelem

@@ -18,11 +18,11 @@ if ( $tool eq "" ) {
    die "Environment not configured for CTtools" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 $comment = "" ;
 $eltype = "" ;

+ 5 - 5
dtool/src/attach/ctmv

@@ -9,11 +9,11 @@ if ( $tool eq "" ) {
    die "Environment not configured for CTtools" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 $projname = &CTProj ;
 $projname =~ tr/A-Z/a-z/ ;

+ 5 - 5
dtool/src/attach/ctrm

@@ -9,11 +9,11 @@ if ( $tool eq "" ) {
    die "Environment not configured for CTtools" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 $projname = &CTProj ;
 $projname =~ tr/A-Z/a-z/ ;

+ 1 - 1
dtool/src/attach/ctsanity

@@ -27,7 +27,7 @@ foreach $item ( @ARGV ) {
     }
 }
 
-require "$tool/inc/ctvspec.pl" ;
+require "$tool/include/ctvspec.pl" ;
 
 if ( $check_vspecs ) {
     local( $projs ) = &CTListAllProjects ;

+ 3 - 3
dtool/src/attach/ctunattach.drv

@@ -12,9 +12,9 @@ sub CTUnattachUsage {
 
 $tool = $ENV{"DTOOL"} ;
 
-require "$tool/inc/ctattch.pl" ;
-require "$tool/inc/ctunattach.pl" ;
-require "$tool/inc/ctquery.pl" ;
+require "$tool/include/ctattch.pl" ;
+require "$tool/include/ctunattach.pl" ;
+require "$tool/include/ctquery.pl" ;
 
 $tmpname = "/tmp/script.$$" ;
 

+ 2 - 2
dtool/src/attach/ctunattach.pl

@@ -1,4 +1,4 @@
-require "$tool/inc/ctquery.pl" ;
+require "$tool/include/ctquery.pl" ;
 
 $shell_type = "csh" ;
 if ( $ENV{"SHELL_TYPE"} ne "" ) {
@@ -94,7 +94,7 @@ sub CTUnattachCompute {
       &CTUnattachMod( "LD_LIBRARY_PATH", $item ) ;
       $item = $root . "/src/all" ;
       &CTUnattachMod( "CDPATH", $item ) ;
-      $item = $root . "/inc" ;
+      $item = $root . "/include" ;
       &CTUnattachMod( "CT_INCLUDE_PATH", $item ) ;
       $item = $root . "/etc" ;
       &CTUnattachMod( "ETC_PATH", $item ) ;

+ 5 - 5
dtool/src/attach/ctunco

@@ -9,11 +9,11 @@ if ( $tool eq "" ) {
     die "not configured for using CTtools" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 $projname = &CTProj ;
 $projname =~ tr/A-Z/a-z/ ;

+ 1 - 1
dtool/src/attach/ctvspec.pl

@@ -1,4 +1,4 @@
-require "$tool/inc/ctutils.pl" ;
+require "$tool/include/ctutils.pl" ;
 
 # read a .vspec file into a map
 # $_[0] = project

+ 1 - 0
dtool/src/attach/neartool

@@ -205,6 +205,7 @@ function is_install_dir {
   case $rel_dir in
     inc) return 0;;
     inc/*) return 0;;
+    include/*) return 0;;
     lib) return 0;;
     lib/*) return 0;;
   esac

+ 2 - 2
dtool/src/attach/unco.pl

@@ -1,5 +1,5 @@
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctdelta.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctdelta.pl" ;
 
 # Remove a branch for an element if needed
 # input is in:

+ 2 - 2
dtool/src/build/Makefile.a.template

@@ -6,7 +6,7 @@
 #CTINCLUDE $DTOOL/lib/Makefile.o.include
 
 #### Pull in standard binary make variables.
-include $(DTOOL)/inc/Makefile.bin.vars
+include $(DTOOL)/include/Makefile.bin.vars
 
 #### Other .o files.
 # OFILES = 
@@ -19,5 +19,5 @@ include $(DTOOL)/inc/Makefile.bin.vars
 # ARFLAGS = 
 
 #### The .a action is here.
-include $(DTOOL)/inc/Makefile.a.rules
+include $(DTOOL)/include/Makefile.a.rules
 

+ 2 - 2
dtool/src/build/Makefile.bin.template

@@ -6,7 +6,7 @@
 #CTINCLUDE $DTOOL/lib/Makefile.o.include
 
 #### Pull in standard binary make variables.
-include $(DTOOL)/inc/Makefile.bin.vars
+include $(DTOOL)/include/Makefile.bin.vars
 
 #### Other files and lib.  Include $(ODIR) in any .o names.
 # OFILES = 
@@ -19,5 +19,5 @@ include $(DTOOL)/inc/Makefile.bin.vars
 # LDFLAGS = 
 
 #### The bin action is here.
-include $(DTOOL)/inc/Makefile.bin.rules
+include $(DTOOL)/include/Makefile.bin.rules
 

+ 1 - 1
dtool/src/build/Makefile.bin.vars

@@ -1,6 +1,6 @@
 # Pull in the .o vars if they haven't been read already
 ifeq (,$(MAKEFILE_O_VARS))
-include $(DTOOL)/inc/Makefile.o.vars
+include $(DTOOL)/include/Makefile.o.vars
 endif
 
 # Get the project root

+ 2 - 2
dtool/src/build/Makefile.foreign.template

@@ -4,7 +4,7 @@
 #CTTARGET
 
 #### Pull in standard foreign package make variables
-include $(DTOOL)/inc/Makefile.foreign.vars
+include $(DTOOL)/include/Makefile.foreign.vars
 
 #### commands for building a foreign package.  DIR?, if ommitted, defaults to
 #### '.'.  COMMAND?, if ommitted, does nothing.
@@ -25,4 +25,4 @@ include $(DTOOL)/inc/Makefile.foreign.vars
 
 
 #### The foreign package build action is here.
-include $(DTOOL)/inc/Makefile.foreign.rules
+include $(DTOOL)/include/Makefile.foreign.rules

+ 1 - 1
dtool/src/build/Makefile.foreign.vars

@@ -4,7 +4,7 @@ ifeq (,$(MAKEFILE_FOREIGN_VARS))
 MAKEFILE_FOREIGN_VARS = TRUE
 
 ifeq (,$(MAKEFILE_PENV_VARS))
-include $(DTOOL)/inc/Makefile.penv.vars
+include $(DTOOL)/include/Makefile.penv.vars
 endif
 
 # Delete the default suffixes

+ 5 - 5
dtool/src/build/Makefile.install.rules

@@ -6,12 +6,12 @@ PACKAGE := $(strip $(PACKAGE))
 
 # Pull in standard install make variables.
 ifeq (,$(MAKEFILE_INSTALL_VARS))
-include $(DTOOL)/inc/Makefile.install.vars
+include $(DTOOL)/include/Makefile.install.vars
 endif
 
 # We need this one to define DEBUGNAME for us.
 ifeq (,$(MAKEFILE_O_VARS))
-include $(DTOOL)/inc/Makefile.o.vars
+include $(DTOOL)/include/Makefile.o.vars
 endif
 
 # Infer the package root from the package name, if not already set.
@@ -115,12 +115,12 @@ endif
 INCLUDE := $(strip $(INCLUDE))
 SRCINCLUDE := $(addprefix $(PKGROOT)/,$(INCLUDE))
 ALLSRC := $(ALLSRC) $(SRCINCLUDE)
-INSTINCLUDE := $(addprefix inc/,$(INCLUDE))
+INSTINCLUDE := $(addprefix include/,$(INCLUDE))
 ALLINST := $(ALLINST) $(INSTINCLUDE)
 INCLUDE = 
 
 ifneq (,$(INSTINCLUDE))
-$(INSTINCLUDE): inc/% : $(PKGROOT)/%
+$(INSTINCLUDE): include/% : $(PKGROOT)/%
 	$(MKINSTALL)
 endif
 
@@ -426,7 +426,7 @@ ALLUSES := $(ALLUSES) $(addprefix lib/,$(strip $(USESLIBS)))
 USESLIBS = 
 
 # USESINCLUDE supplied by package's Makefile.install.
-ALLUSES := $(ALLUSES) $(addprefix inc/,$(strip $(USESINCLUDE)))
+ALLUSES := $(ALLUSES) $(addprefix include/,$(strip $(USESINCLUDE)))
 USESINCLUDE = 
 
 # USESDEFERREDLIBS supplied by package's Makefile.install, but only

+ 1 - 1
dtool/src/build/Makefile.install.template

@@ -39,7 +39,7 @@ ifneq (,$(PACKAGE))
 # OTHER = 
 
 #### Where the action happens.
-include $(DTOOL)/inc/Makefile.install.rules
+include $(DTOOL)/include/Makefile.install.rules
 
 #### Install actions for OTHER files (source must be in $(PKGROOT)):
 # [ installed file ] : $(PKGROOT)/[ source file ]  # Files must have same name

+ 2 - 2
dtool/src/build/Makefile.install.vars

@@ -5,11 +5,11 @@ MAKEFILE_INSTALL_VARS = TRUE
 
 # This makes the variables available to sub-Makes.
 ifeq (,$(MAKEFILE_PENV_VARS))
-include $(DTOOL)/inc/Makefile.penv.vars
+include $(DTOOL)/include/Makefile.penv.vars
 endif
 
 ifeq (,$(MAKEFILE_PROJECT_VARS))
-include $(DTOOL)/inc/Makefile.project.vars
+include $(DTOOL)/include/Makefile.project.vars
 endif
 
 # Delete the standard suffixes

+ 1 - 1
dtool/src/build/Makefile.meta.template

@@ -10,7 +10,7 @@ INSTALL =
 MAKEDIR = .
 
 #### The action is here.
-include $(DTOOL)/inc/Makefile.meta.rules
+include $(DTOOL)/include/Makefile.meta.rules
 
 #### Sub-make build order dependencies:
 # foo: bar

+ 2 - 2
dtool/src/build/Makefile.o.include

@@ -1,7 +1,7 @@
 # Standard .o file conversion information.
 
 #### Pull in standard .o make variables
-include $(DTOOL)/inc/Makefile.o.vars
+include $(DTOOL)/include/Makefile.o.vars
 
 #### Lex files 
 # LFILES = 
@@ -40,4 +40,4 @@ include $(DTOOL)/inc/Makefile.o.vars
 # foo.c: foo.h
 
 #### The .o action is here.
-include $(DTOOL)/inc/Makefile.o.rules
+include $(DTOOL)/include/Makefile.o.rules

+ 2 - 2
dtool/src/build/Makefile.o.vars

@@ -5,7 +5,7 @@ ifeq (,$(MAKEFILE_O_VARS))
 MAKEFILE_O_VARS = TRUE
 
 ifeq (,$(MAKEFILE_PENV_VARS))
-  include $(DTOOL)/inc/Makefile.penv.vars
+  include $(DTOOL)/include/Makefile.penv.vars
 endif
 
 # First, examine the OPTIMIZE variable.  Make sure it is set to one
@@ -67,7 +67,7 @@ ifeq (OSX,$(PENV))
   endif # .so
 endif # OSX
 
-IGATESYSPATH = -S$(DTOOL)/inc/parser-inc -DCPPPARSER -D__cplusplus $(SYSTEM_IGATE_FLAGS)
+IGATESYSPATH = -S$(DTOOL)/include/parser-inc -DCPPPARSER -D__cplusplus $(SYSTEM_IGATE_FLAGS)
 
 # Delete the default suffixes
 .SUFFIXES:

+ 1 - 1
dtool/src/build/Makefile.project.template

@@ -9,7 +9,7 @@
 #CTPROJECT
 #CTPROJROOT
 
-include $(DTOOL)/inc/Makefile.project.vars
+include $(DTOOL)/include/Makefile.project.vars
 
 # Add packages to end of file as follows:
 # 	include src/all/PACKAGE/Makefile.install

+ 1 - 1
dtool/src/build/Makefile.project.vars

@@ -22,7 +22,7 @@ TELEUSE :=
 SHADERS :=
 
 ifeq (,$(MAKEFILE_PENV_VARS))
-include $(DTOOL)/inc/Makefile.penv.vars
+include $(DTOOL)/include/Makefile.penv.vars
 endif
 
 ifeq (,$(CTPROJECT))

+ 2 - 2
dtool/src/build/Makefile.so.template

@@ -6,7 +6,7 @@
 #CTINCLUDE $DTOOL/lib/Makefile.o.include
 
 #### Pull in standard binary make variables.
-include $(DTOOL)/inc/Makefile.bin.vars
+include $(DTOOL)/include/Makefile.bin.vars
 
 #### Other files and lib.  Include $(ODIR) in any .o names.
 # OFILES = 
@@ -19,4 +19,4 @@ include $(DTOOL)/inc/Makefile.bin.vars
 # LDFLAGS = 
 
 #### The .so action is here.
-include $(DTOOL)/inc/Makefile.so.rules
+include $(DTOOL)/include/Makefile.so.rules

+ 2 - 2
dtool/src/build/Makefile.ss.template

@@ -4,7 +4,7 @@
 #CTTARGET
 
 #### Pull in standard .ss make variables
-include $(DTOOL)/inc/Makefile.ss.vars
+include $(DTOOL)/include/Makefile.ss.vars
 
 #### Source files
 # HFILES  = 
@@ -18,4 +18,4 @@ include $(DTOOL)/inc/Makefile.ss.vars
 # STRAIGHTINCLUDE = TRUE
 
 #### The .ss action is here.
-include $(DTOOL)/inc/Makefile.ss.rules
+include $(DTOOL)/include/Makefile.ss.rules

+ 1 - 1
dtool/src/build/Makefile.ss.vars

@@ -4,7 +4,7 @@ ifeq (,$(MAKEFILE_SS_VARS))
 MAKEFILE_SS_VARS = TRUE
 
 ifeq (,$(MAKEFILE_PENV_VARS))
-include $(DTOOL)/inc/Makefile.penv.vars
+include $(DTOOL)/include/Makefile.penv.vars
 endif
 
 # Delete the default suffixes

+ 1 - 1
dtool/src/build/Makefile.uxb.template

@@ -4,4 +4,4 @@
 UFLAGS = 
 
 #### The uxb action is here.
-include $(DTOOL)/inc/Makefile.uxb.rules
+include $(DTOOL)/include/Makefile.uxb.rules

+ 5 - 5
dtool/src/build/ctaddpkg

@@ -12,9 +12,9 @@ if ( $tool eq "" ) {
 }
 
 #pull in tools for getting information on the project
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
 
 #get what project we're currently in, and where it's root is.
 $proj = &CTProj ;
@@ -45,7 +45,7 @@ if ( ! -e "$tool/lib/Makefile.install.template" ) {
 }
 
 #make the package directory
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctcm.pl" ;
 $item = "$projroot/src/all/$pkgname" ;
 if ( ! -e $item ) {
     if ( ! &CTCMMkdir( $item, $projname, $spec ) ) {
@@ -54,7 +54,7 @@ if ( ! -e $item ) {
 }
 
 #pull in tools for installing Makefiles
-require "$tool/inc/ctinstmake.pl" ;
+require "$tool/include/ctinstmake.pl" ;
 
 #install a package makefile and package install makefile into the package
 $item = "$projroot/src/all/$pkgname/Makefile" ;

+ 5 - 5
dtool/src/build/ctaddtgt

@@ -9,9 +9,9 @@ if ($#ARGV == -1) {
    exit print "Usage: ctaddtgt [{bin,a,so,ss,foreign}] target-name ...\n" ;
 }
 
-require "$tool/inc/ctproj.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
+require "$tool/include/ctproj.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
 
 @arglist = @ARGV ;
 
@@ -42,8 +42,8 @@ while ( @arglist != () ) {
    $fulltgtname = $tgtname ;
    shift( @arglist ) ;
 
-   require "$tool/inc/ctinstmake.pl" ;
-   require "$tool/inc/ctcm.pl" ;
+   require "$tool/include/ctinstmake.pl" ;
+   require "$tool/include/ctcm.pl" ;
 
    $item = "$projroot/src/$pkgname" ;
    if ( ! &CTCMCheckout( $item, $projname, $spec )) {

+ 7 - 7
dtool/src/build/ctinitproj

@@ -11,9 +11,9 @@ if ( $tool eq "" ) {
    die "Environment not configured for CTtools" ;
 }
 
-require "$tool/inc/ctutils.pl" ;
-require "$tool/inc/ctvspec.pl" ;
-require "$tool/inc/ctquery.pl" ;
+require "$tool/include/ctutils.pl" ;
+require "$tool/include/ctvspec.pl" ;
+require "$tool/include/ctquery.pl" ;
 
 $projname = $ARGV[0] ;
 $projroot = &CTUShellEval( $ARGV[1] );
@@ -25,7 +25,7 @@ if ( ! -e $projroot ) {
    die "Project root ('$projroot') does not exist" ;
 }
 
-require "$tool/inc/ctcm.pl" ;
+require "$tool/include/ctcm.pl" ;
 
 # make all the default subdirectories
 $item = "$projroot/bin" ;
@@ -40,7 +40,7 @@ if ( ! -e $item ) {
 	die "Could not create directory '" . $item . "'\n" ;
     }
 }
-$item = "$projroot/inc" ;
+$item = "$projroot/include" ;
 if ( ! -e $item ) {
     if ( ! &CTCMMkdir( $item, $projname, $spec ) ) {
 	die "Could not create directory '" . $item . "'\n" ;
@@ -78,7 +78,7 @@ if ( ! -e "$projroot/src/all" ) {
 }
 
 # install the project-wide Makefile
-require "$tool/inc/ctinstmake.pl" ;
+require "$tool/include/ctinstmake.pl" ;
 
 $item = "$projroot/Makefile" ;
 &CTInstallMake( "$tool/lib/Makefile.project.template", $item ) ;
@@ -110,7 +110,7 @@ $item = "$projroot/lib" ;
 if ( ! &CTCMDelta( $item, $projname, $spec ) ) {
     die "Could not delta '" . $item . "'\n" ;
 }
-$item = "$projroot/inc" ;
+$item = "$projroot/include" ;
 if ( ! &CTCMDelta( $item, $projname, $spec ) ) {
     die "Could not delta '" . $item . "'\n" ;
 }

+ 1 - 1
dtool/src/build/ctinstmake.pl

@@ -8,7 +8,7 @@ sub CTInstallMakeWrite {
 	 local( @CTIMWlist ) ;
 	 @CTIMWlist = split ;
 	 local( $tool ) = $ENV{ "DTOOL" } ;
-	 require "$tool/inc/ctutils.pl" ;
+	 require "$tool/include/ctutils.pl" ;
 	 local( $CTIMWtmp ) = &CTUShellEval( $CTIMWlist[1] ) ;
 	 &CTInstallMakeWrite( $CTIMWtmp ) ;
       } elsif (( /^#CTPROJECT/ ) && ( $projname ne "" )){

+ 1 - 1
dtool/src/build/ctproj

@@ -5,7 +5,7 @@ if ( $tool eq "" ) {
    die "Environment not configured to run CTtools" ;
 }
 
-require "$tool/inc/ctproj.pl" ;
+require "$tool/include/ctproj.pl" ;
 
 @arglist = @ARGV ;
 

+ 1 - 1
dtool/src/build/ctproj.pl

@@ -1,4 +1,4 @@
-require "$tool/inc/ctutils.pl" ;
+require "$tool/include/ctutils.pl" ;
 
 # return the root of the given project.
 sub CTProjRoot {

+ 2 - 2
dtool/src/build/initialize

@@ -6,10 +6,10 @@ if test "$1" = ""; then
   exit 1
 fi
 
-test -d ../../inc || mkdir ../../inc
+test -d ../../include || mkdir ../../include
 test -d ../../bin || mkdir ../../bin
 
-cp Makefile.install.rules Makefile.meta.rules Makefile.install.vars Makefile.project.vars Makefile.penv.vars Makefile.o.vars ctproj.pl ../../inc
+cp Makefile.install.rules Makefile.meta.rules Makefile.install.vars Makefile.project.vars Makefile.penv.vars Makefile.o.vars ctproj.pl ../../include
 cp ctproj ctpathadjust ../../bin
 cd ../..
 if test "$DTOOL" = ""; then

+ 3 - 3
dtool/src/dtoolbase/dtoolsymbols.h

@@ -36,7 +36,7 @@
 
 #define EXPCL_EMPTY
 
-#if defined(PENV_WIN32) && !defined(CPPPARSER)
+#if defined(WIN32_VC) && !defined(CPPPARSER)
 
 #ifdef BUILDING_DTOOL
   #define EXPCL_DTOOL __declspec(dllexport)
@@ -54,7 +54,7 @@
   #define EXPTP_MISC extern
 #endif /* BUILDING_MISC */
 
-#else   /* !PENV_WIN32 */
+#else   /* !WIN32_VC */
 
 #define EXPCL_DTOOL
 #define EXPTP_DTOOL
@@ -62,6 +62,6 @@
 #define EXPCL_MISC
 #define EXPTP_MISC
 
-#endif  /* PENV_WIN32 */
+#endif  /* WIN32_VC */
 
 #endif

+ 22 - 29
dtool/src/dtoolutil/executionEnvironment.cxx

@@ -11,26 +11,18 @@
 // this case, we must read all of the environment variables directly
 // and cache them locally.
 
-#if defined(PENV_LINUX)
+#ifdef STATIC_INIT_GETENV
 #define PREREAD_ENVIRONMENT
 #endif
 
 
-// We define the symbol USE_ARGV if we have global variables named
-// ARGC/ARGV that we can read at static init time to determine our
-// command-line arguments.
+// We define the symbol HAVE_GLOBAL_ARGV if we have global variables
+// named GLOBAL_ARGC/GLOBAL_ARGV that we can read at static init time
+// to determine our command-line arguments.
 
-#if defined(WIN32_VC)
-  #define USE_ARGV
-  #define ARGV __argv
-  #define ARGC __argc
-
-#elif defined(PENV_SGI)
-  #define USE_ARGV
-  extern char **__Argv;
-  extern int __Argc;
-  #define ARGV __Argv
-  #define ARGC __Argc
+#if defined(HAVE_GLOBAL_ARGV) && defined(PROTOTYPE_GLOBAL_ARGV)
+extern char **GLOBAL_ARGV;
+extern int GLOBAL_ARGC;
 #endif
 
 // Linux with GNU libc does have global argv/argc variables, but we
@@ -158,11 +150,11 @@ get_ptr() {
 ////////////////////////////////////////////////////////////////////
 void ExecutionEnvironment::
 read_environment_variables() {
-#if defined(PENV_LINUX)
-  // In Linux, we might not be able to use getenv() at static init
-  // time.  However, we may be lucky and have a file called
-  // /proc/self/environ that may be read to determine all of our
-  // environment variables.
+#if defined(HAVE_PROC_SELF_ENVIRON)
+  // In Linux, and possibly in other systems, we might not be able to
+  // use getenv() at static init time.  However, we may be lucky and
+  // have a file called /proc/self/environ that may be read to
+  // determine all of our environment variables.
 
   ifstream proc("/proc/self/environ");
   if (proc.fail()) {
@@ -204,21 +196,22 @@ read_environment_variables() {
 ////////////////////////////////////////////////////////////////////
 void ExecutionEnvironment::
 read_args() {
-#if defined(USE_ARGV)
-  int argc = ARGC;
+#if defined(HAVE_GLOBAL_ARGV)
+  int argc = GLOBAL_ARGC;
   if (argc > 0) {
-    _binary_name = ARGV[0];
+    _binary_name = GLOBAL_ARGV[0];
   }
 
   for (int i = 1; i < argc; i++) {
-    _args.push_back(ARGV[i]);
+    _args.push_back(GLOBAL_ARGV[i]);
   }
 
-#elif defined(PENV_LINUX)
-  // In Linux, we might not be able to use the global ARGC/ARGV
-  // variables at static init time.  However, we may be lucky and have
-  // a file called /proc/self/cmdline that may be read to determine
-  // all of our command-line arguments.
+#elif defined(HAVE_PROC_SELF_CMDLINE)
+  // In Linux, and possibly in other systems as well, we might not be
+  // able to use the global ARGC/ARGV variables at static init time.
+  // However, we may be lucky and have a file called
+  // /proc/self/cmdline that may be read to determine all of our
+  // command-line arguments.
 
   ifstream proc("/proc/self/cmdline");
   if (proc.fail()) {

+ 4 - 11
dtool/src/dtoolutil/pfstream.h

@@ -11,17 +11,10 @@
 #include <string>
 #include <stdio.h>
 
-#if defined(PENV_LINUX) || defined(PENV_WIN32)
-extern "C" {
-#if defined(PENV_WIN32)
-  #define popen _popen
-  #define pclose _pclose
-#else
-  FILE* popen(const char*, const char*);
-  int pclose(FILE *);
+#ifdef WIN32_VC
+#define popen _popen
+#define pclose _pclose
 #endif
-}
-#endif /* PENV_LINUX */
 
 class EXPCL_DTOOL ipfstream {
    private:
@@ -75,7 +68,7 @@ class EXPCL_DTOOL opfstream {
 #ifndef PENV_PS2
 	 fd = popen(cmd.c_str(), (mode & ios::out)?"w":"r");
 	 if (fd != (FILE *)0L) {
-#ifndef PENV_WIN32 
+#ifndef WIN32_VC 
 	    ofs = new ofstream(fileno(fd));
 #endif
 	    ok = true;

+ 2 - 0
dtool/src/interrogate/interrogate.cxx

@@ -23,6 +23,7 @@ CPPParser parser;
 
 Filename output_code_filename;
 Filename output_data_filename;
+string output_data_basename;
 bool output_module_specific = false;
 bool output_function_pointers = false;
 bool output_function_names = false;
@@ -376,6 +377,7 @@ main(int argc, char *argv[]) {
 
   output_code_filename.set_text();
   output_data_filename.set_text();
+  output_data_basename = output_data_filename.get_basename();
 
   if (output_function_names && true_wrapper_names) {
     cerr

+ 1 - 0
dtool/src/interrogate/interrogate.h

@@ -17,6 +17,7 @@ extern CPPParser parser;
 // A few global variables that control the interrogate process.
 extern Filename output_code_filename;
 extern Filename output_data_filename;
+extern string output_data_basename;
 extern bool output_module_specific;
 extern bool output_function_pointers;
 extern bool output_function_names;

+ 1 - 1
dtool/src/interrogate/interrogateBuilder.cxx

@@ -508,7 +508,7 @@ make_module_def(int file_identifier) {
   def->library_hash_name = _library_hash_name.c_str();
   def->module_name = module_name.c_str();
   if (!output_data_filename.empty()) {
-    def->database_filename = output_data_filename.c_str();
+    def->database_filename = output_data_basename.c_str();
   }
 
   return def;

+ 0 - 18
panda/Config.pp

@@ -1,18 +0,0 @@
-//
-// Config.pp
-//
-// This file defines certain configuration variables that are written
-// into the various make scripts.  It is processed by ppremake (along
-// with the Sources.pp files in each of the various directories) to
-// generate build scripts appropriate to each environment.
-//
-// There are not too many variables to declare at this level; most of
-// them are defined in the DTOOL-specific Config.pp.
-
-
-// Where should we find DTOOL?  This will come from the environment
-// variable if it is set.
-#if $[eq $[DTOOL],]
-  #define DTOOL /usr/local/panda
-#endif
-

+ 38 - 6
panda/Package.pp

@@ -13,6 +13,13 @@
 // files.
 
 
+// Check the version of ppremake in use.  This is temporary until
+// everyone gets up to at least 0.50.  After that, the test in dtool
+// will suffice.
+#if $[not $[>= $[PPREMAKE_VERSION],0.50]]
+  #error You need at least ppremake version 0.50 to process this tree.
+#endif
+
 
 // What is the name and version of this source tree?
 #if $[eq $[PACKAGE],]
@@ -21,14 +28,39 @@
 #endif
 
 
-// Pull in the package-level Config file.  This contains a few
-// configuration variables that the user might want to fine-tune.
-#include $[THISDIRPREFIX]Config.pp
+// Where should we find the DTOOL source directory?
+#if $[or $[CTPROJS],$[DTOOL]]
+  // If we are presently attached, use the environment variable.
+  #define DTOOL_SOURCE $[DTOOL]
+  #if $[eq $[DTOOL],]
+    #error You seem to be attached to some trees, but not DTOOL!
+  #endif
+#else
+  // Otherwise, if we are not attached, we guess that the source is a
+  // sibling directory to this source root.
+  #define DTOOL_SOURCE $[standardize $[TOPDIR]/../dtool]
+#endif
+
+// Where should we install PANDA?
+#if $[or $[CTPROJS],$[PANDA]]
+  #define PANDA_INSTALL $[PANDA]
+  #define PANDA_INSTALL_OTHER $(PANDA)
+  #if $[eq $[PANDA],]
+    #error You seem to be attached to some trees, but not PANDA!
+  #endif
+#else
+  #defer PANDA_INSTALL $[INSTALL_DIR]
+  #defer PANDA_INSTALL_OTHER $[INSTALL_DIR]
+#endif
+
+
+// Define the inter-tree dependencies.
+#define NEEDS_TREES $[NEEDS_TREES] dtool
 
 
 // Also get the DTOOL Package file and everything that includes.
-#if $[eq $[wildcard $[DTOOL]],]
-  #error Directory defined by $DTOOL not found!  Are you attached properly?
+#if $[not $[isfile $[DTOOL_SOURCE]/Package.pp]]
+  #error DTOOL source directory not found!  Are you attached properly?
 #endif
 
-#include $[DTOOL]/Package.pp
+#include $[DTOOL_SOURCE]/Package.pp

+ 1 - 1
panda/Sources.pp

@@ -7,4 +7,4 @@
 #define REQUIRED_TREES dtool
 
 #define EXTRA_DIST \
-    Config.Irix.pp Config.Linux.pp Config.Win32.pp Package.pp
+    Config.pp Package.pp Sources.pp

+ 1 - 0
panda/src/audio/Sources.pp

@@ -3,6 +3,7 @@
 
 #begin lib_target
   #define USE_AUDIO yes
+  #define USE_MIKMOD yes
 
   #define TARGET audio
   #define LOCAL_LIBS putil ipc

+ 2 - 2
panda/src/audio/audio_trait.h

@@ -59,9 +59,9 @@ public:
 // this is really ugly.  But since we have to be able to include/compile
 // all of the driver files on any system, I need to centralize a switch
 // for which one is real.
-#ifdef PENV_LINUX
+#ifdef HAVE_SYS_SOUNDCARD_H
 #define AUDIO_USE_LINUX
-#elif defined(PENV_WIN32)
+#elif defined(WIN32_VC)
 #define AUDIO_USE_WIN32
 #elif defined(HAVE_MIKMOD)
 #define AUDIO_USE_MIKMOD

+ 6 - 19
panda/src/builder/builderFuncs.I

@@ -13,17 +13,12 @@
 #include <geomNode.h>
 
 #include <algorithm>
-#ifndef PENV_WIN32
-#include <alloca.h>
-#endif
 
-#ifdef WIN32_VC
-struct Vtx {
+struct DecompVtx {
   int index;
   BuilderV coord;
-  struct Vtx *next;
+  struct DecompVtx *next;
 };
-#endif
 
 ////////////////////////////////////////////////////////////////////
 //     Function: decomp_concave
@@ -36,20 +31,12 @@ static bool
 decomp_concave(const PrimType &prim, BuilderBucket &bucket, 
 	       OutputIterator result,
 	       int asum, int x, int y) {
-#ifndef WIN32_VC
-  struct Vtx {
-    int index;
-    BuilderV coord;
-    struct Vtx *next;
-  };
-#endif
-  
 #define VX(p, c)    p->coord[c]
 
   vector<PrimType> output_prims;
 
-  Vtx *p0, *p1, *p2, *t0, *vert;
-  Vtx *m[3];
+  DecompVtx *p0, *p1, *p2, *t0, *vert;
+  DecompVtx *m[3];
   float	xmin, xmax, ymin, ymax;
   int i, init, csum, chek;
   float a[3], b[3], c[3], s[3];
@@ -58,13 +45,13 @@ decomp_concave(const PrimType &prim, BuilderBucket &bucket,
   nassertr(num_verts >= 3, false);
   
   /* Make linked list of verts */
-  vert = (Vtx *) alloca(sizeof(Vtx));
+  vert = (DecompVtx *) alloca(sizeof(DecompVtx));
   vert->index = 0;
   vert->coord = prim.get_vertex(0).get_coord_value(bucket);
   p1 = vert;
 
   for (i = 1; i < num_verts; i++) {
-    p0 = (Vtx *) alloca(sizeof(Vtx));
+    p0 = (DecompVtx *) alloca(sizeof(DecompVtx));
     p0->index = i;
     p0->coord = prim.get_vertex(i).get_coord_value(bucket);
     // There shouldn't be two consecutive identical vertices.  If

+ 0 - 4
panda/src/builder/mesherTempl.I

@@ -10,10 +10,6 @@
 #include "config_builder.h"
 
 #include <algorithm>
-#ifndef PENV_WIN32
-#include <alloca.h>
-#endif
-
 
 template <class PrimType>
 MesherTempl<PrimType>::

+ 1 - 1
panda/src/chancfg/Sources.pp

@@ -17,7 +17,7 @@
     chansetup.h chanshare.h chanviewport.I chanviewport.h chanwindow.I \
     chanwindow.h
 
-  #define INSTALL_DATA \
+  #define INSTALL_CONFIG \
     layout_db setup_db window_db
 
   #define IGATESCAN chancfg.h

+ 4 - 0
panda/src/char/characterJointBundle.I

@@ -3,6 +3,10 @@
 // 
 ////////////////////////////////////////////////////////////////////
 
+// This comment tells ppremake that we know this is a circular
+// #include reference, and please don't bother us about it.  The line
+// must be exactly as shown.
+/* okcircular */
 #include "character.h"
 
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/configfiles/Sources.pp

@@ -1,2 +1,2 @@
-#define INSTALL_DATA \
+#define INSTALL_CONFIG \
   panda.emacs panda.emacs.Xdefaults panda.init Configrc

+ 1 - 1
panda/src/dgraph/describe_data_verbose.cxx

@@ -35,7 +35,7 @@ describe_data_verbose(ostream &out, const NodeAttributes &state,
 	string actual_name = type.get_name();
 	string::size_type underscore = actual_name.rfind('_');
 	string name;
-	if (underscore == NPOS) {
+	if (underscore == string::npos) {
 	  // There was no underscore, so this name wasn't created via
 	  // register_data_transition().  Huh.  Well, that's legitimate
 	  // (if unexpected), so just print the whole name.

+ 1 - 0
panda/src/downloadertools/Sources.pp

@@ -22,6 +22,7 @@
 
 #begin bin_target
   #define TARGET check_adler
+  #define TARGET_IF_ZLIB yes
 
   #define SOURCES \
     check_adler.cxx

+ 0 - 2
panda/src/dxgsg/dxGraphicsStateGuardian.h

@@ -30,12 +30,10 @@
 
 extern char * ConvD3DErrorToString(const HRESULT &error);   // defined in wdxGraphicsPipe.cxx
 
-#ifdef PENV_WIN32
 // Must include windows.h before gl.h on NT
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #undef WIN32_LEAN_AND_MEAN
-#endif
 
 #include <ddraw.h>
 #include <d3d.h>

+ 3 - 4
panda/src/dxgsg/dxTextureContext.h

@@ -6,14 +6,13 @@
 #ifndef DXTEXTURECONTEXT_H
 #define DXTEXTURECONTEXT_H
 
-#ifdef PENV_WIN32
-// Must include windows.h before gl.h on NT
-#define WIN32_LEAN_AND_MEAN
 #include <pandabase.h>
 
+// Must include windows.h before gl.h on NT
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #undef WIN32_LEAN_AND_MEAN
-#endif
+
 #include <texture.h>
 #include <textureContext.h>
 

+ 0 - 2
panda/src/express/Sources.pp

@@ -39,6 +39,4 @@
 
   #define IGATESCAN all
 
-  #define IGATESCAN all
-
 #end lib_target

+ 4 - 3
panda/src/express/multifile.h

@@ -11,12 +11,13 @@
 ////////////////////////////////////////////////////////////////////
 #include <pandabase.h>
 
-#include <typedef.h>
+#include "typedef.h"
+#include "datagram.h"
+#include "datagramIterator.h"
+
 #include <notify.h>
 #include <filename.h>
 #include <list>
-#include <datagram.h>
-#include <datagramIterator.h>
 
 ////////////////////////////////////////////////////////////////////
 //       Class : Multifile 

+ 1 - 1
panda/src/express/referenceCount.I

@@ -169,7 +169,7 @@ ref() const {
   // somewhere.
   nassertv(_ref_count >= 0);
 
-#ifdef PENV_SGI  
+#if 0
   // This is an SGI-specific hack.  Maybe this isn't a valid test at
   // all.  This is supposed to fail if the 'this' pointer is on the
   // stack, instead of on the heap--I assume if the first two hex

+ 1 - 1
panda/src/express/trueClock.cxx

@@ -130,7 +130,7 @@ TrueClock() {
 }
 
 
-#elif !defined(WIN32)
+#else
 
 ////////////////////////////////////////////////////////////////////
 //

+ 6 - 6
panda/src/express/typeHandle.cxx

@@ -120,7 +120,7 @@ register_type(TypeHandle &type_handle, const string &name) {
   RegistryNode *rnode = (*ri).second;
   nassertr(rnode->_name == (*ri).first, false);
   nassertr(rnode->_handle._index >= 0 && 
-	   rnode->_handle._index < _handle_registry.size(), false);
+	   rnode->_handle._index < (int)_handle_registry.size(), false);
   nassertr(_handle_registry[rnode->_handle._index] == rnode, false);
   nassertr(rnode->_handle._index != 0, false);
 
@@ -340,7 +340,7 @@ TypeHandle TypeRegistry::
 get_parent_class(TypeHandle child, int index) const {
   RegistryNode *rnode = look_up(child, (TypedObject *)NULL);
   nassertr(rnode != (RegistryNode *)NULL, TypeHandle::none());
-  nassertr(index >= 0 && index < rnode->_parent_classes.size(),
+  nassertr(index >= 0 && index < (int)rnode->_parent_classes.size(),
 	   TypeHandle::none());
   return rnode->_parent_classes[index]->_handle;
 }
@@ -375,7 +375,7 @@ TypeHandle TypeRegistry::
 get_child_class(TypeHandle child, int index) const {
   RegistryNode *rnode = look_up(child, (TypedObject *)NULL);
   nassertr(rnode != (RegistryNode *)NULL, TypeHandle::none());
-  nassertr(index >= 0 && index < rnode->_child_classes.size(),
+  nassertr(index >= 0 && index < (int)rnode->_child_classes.size(),
 	   TypeHandle::none());
   return rnode->_child_classes[index]->_handle;
 }
@@ -537,13 +537,13 @@ write_node(ostream &out, int indent_level, const RegistryNode *node) const {
   indent(out, indent_level) << node->_handle.get_index() << " " << node->_name;
   if (!node->_parent_classes.empty()) {
     out << " : " << node->_parent_classes[0]->_name;
-    for (int pi = 1; pi < node->_parent_classes.size(); pi++) {
+    for (int pi = 1; pi < (int)node->_parent_classes.size(); pi++) {
       out << ", " << node->_parent_classes[pi]->_name;
     }
   }
   out << "\n";
   
-  for (int i = 0; i < node->_child_classes.size(); i++) {
+  for (int i = 0; i < (int)node->_child_classes.size(); i++) {
     write_node(out, indent_level + 2, node->_child_classes[i]);
   }
 }
@@ -603,7 +603,7 @@ look_up(TypeHandle handle, TypedObject *object) const {
   }
 
   if (handle._index < 0 ||
-      handle._index >= _handle_registry.size()) {
+      handle._index >= (int)_handle_registry.size()) {
     express_cat->fatal()
       << "Invalid TypeHandle index " << handle._index 
       << "!  Is memory corrupt?\n";

+ 3 - 15
panda/src/express/typedef.h

@@ -5,25 +5,13 @@
 //
 #ifndef TYPEDEF_H
 #define TYPEDEF_H
-//
-////////////////////////////////////////////////////////////////////
-// Defines
-////////////////////////////////////////////////////////////////////
+
+#include <pandabase.h>
+
 typedef unsigned char uchar;
 typedef unsigned short ushort;
 typedef unsigned int uint;
 typedef unsigned long ulong;
 
-#ifndef NPOS
-  #define NPOS string::npos
-#endif
-
-// Declare the namespace std in case it's not already.
-namespace std {
-};
-
-// Let's always be in the std namespace unless we specify otherwise.
-using namespace std;
-
 
 #endif

+ 0 - 8
panda/src/framework/framework.cxx

@@ -92,14 +92,6 @@
 #include <ipc_thread.h>
 #endif
 
-/*
-#ifdef PENV_WIN32
-#include <time.h>
-#else
-#include <sys/time.h>
-#endif
-*/
-
 Configure(framework);
 
 ConfigureFn(framework) {

+ 5 - 3
panda/src/glgsg/glGraphicsStateGuardian.cxx

@@ -3657,9 +3657,9 @@ get_fog_mode_type(Fog::Mode m) const {
     case Fog::M_linear: return GL_LINEAR;
     case Fog::M_exponential: return GL_EXP;
     case Fog::M_super_exponential: return GL_EXP2;
-#ifdef PENV_SGI
+#ifdef GL_FOG_FUNC_SGIS
     case Fog::M_spline: return GL_FOG_FUNC_SGIS;
-#endif /* PENV_SGI */
+#endif
   }
   glgsg_cat.error() << "Invalid Fog::Mode value" << endl;
   return GL_EXP;
@@ -3701,9 +3701,11 @@ print_gfx_visual() {
 
   glGetBooleanv( GL_STEREO, &j ); cout << "Stereo? " << (int)j << endl;
 
-#ifdef PENV_SGI
+#ifdef GL_MULTISAMPLE_SGIS
   glGetBooleanv( GL_MULTISAMPLE_SGIS, &j ); cout << "Multisample? " 
 						 << (int)j << endl;
+#endif
+#ifdef GL_SAMPLES_SGIS
   glGetIntegerv( GL_SAMPLES_SGIS, &i ); cout << "Samples: " << i << endl;
 #endif
 

+ 2 - 1
panda/src/glgsg/glGraphicsStateGuardian.h

@@ -21,12 +21,13 @@
 #include <stencilProperty.h>
 #include <fog.h>
 
-#ifdef PENV_WIN32
+#ifdef WIN32_VC
 // Must include windows.h before gl.h on NT
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #undef WIN32_LEAN_AND_MEAN
 #endif
+
 #include <GL/gl.h>
 
 #include <pointerToArray.h>

+ 4 - 3
panda/src/glgsg/glTextureContext.h

@@ -6,14 +6,15 @@
 #ifndef GLTEXTURECONTEXT_H
 #define GLTEXTURECONTEXT_H
 
-#ifdef PENV_WIN32
-// Must include windows.h before gl.h on NT
-#define WIN32_LEAN_AND_MEAN
 #include <pandabase.h>
 
+#ifdef WIN32_VC
+// Must include windows.h before gl.h on NT
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #undef WIN32_LEAN_AND_MEAN
 #endif
+
 #include <GL/gl.h>
 #include <textureContext.h>
 

+ 2 - 1
panda/src/glutdisplay/glutGraphicsWindow.cxx

@@ -15,11 +15,12 @@
 #include <keyboardButton.h>
 #include <pStatTimer.h>
 
-#ifdef PENV_WIN32
+#ifdef WIN32_VC
 #define WINDOWS_LEAN_AND_MEAN
 #include <windows.h>
 #undef WINDOWS_LEAN_AND_MEAN
 #endif
+
 #include <GL/glut.h>
 
 ////////////////////////////////////////////////////////////////////

+ 5 - 0
panda/src/graph/nodeRelation.h

@@ -230,6 +230,11 @@ typedef map<TypeHandle, UpRelationPointers> UpRelations;
 // type ReferenceCount and will be able to compile anything that uses
 // a NodeRelation.  We have to include it here at the end instead of
 // the beginning because node.h also includes nodeRelation.h.
+
+// This comment tells ppremake that we know this is a circular
+// #include reference, and please don't bother us about it.  The line
+// must be exactly as shown.
+/* okcircular */
 #include "node.h"
 
 #endif

+ 1 - 1
panda/src/ipc/ipc_traits.h

@@ -54,7 +54,7 @@
 #define __IPC_FLAVOR_DUJOUR__ posix
 #define __IPC_FLAVOR_DUJOUR_TOKEN__ 2
 
-#elif defined(PENV_WIN32)
+#elif defined(WIN32_VC)
 
 #define __IPC_FLAVOR_DUJOUR__ nt
 #define __IPC_FLAVOR_DUJOUR_TOKEN__ 1

+ 3 - 3
panda/src/ipc/test_diners.cxx

@@ -12,7 +12,7 @@
 #include "ipc_thread.h"
 #include "ipc_condition.h"
 
-#ifdef PENV_WIN32
+#ifdef WIN32_VC
 static int last_rand = 0;
 #endif /* __WIN32__ */
 
@@ -22,7 +22,7 @@ static int random_l(void)
 {
    mutex_lock l(rand_mutex);
    int i = rand();
-#ifdef PENV_WIN32
+#ifdef WIN32_VC
    last_rand = i;
 #endif /* __WIN32__ */
    return i;
@@ -54,7 +54,7 @@ class philosopher : public thread {
       void run(void* arg) {
 	 int id = *(int*)arg;
 	 delete (int*)arg;
-#ifdef PENV_WIN32
+#ifdef WIN32_VC
 	 rand_mutex.lock();
 	 srand(last_rand);
 	 rand_mutex.unlock();

Some files were not shown because too many files changed in this diff