Browse Source

eliminate IF_*_SOURCES, etc.

David Rose 23 years ago
parent
commit
945f7dfe92

+ 2 - 2
dtool/metalibs/dtoolconfig/Sources.pp

@@ -13,6 +13,6 @@
 #begin metalib_target
 #begin metalib_target
   #define TARGET dtoolconfig
   #define TARGET dtoolconfig
 
 
-  #define SOURCES dtoolconfig.cxx
-  #define IF_PYTHON_SOURCES pydtool.cxx
+  #define SOURCES dtoolconfig.cxx \
+     $[if $[HAVE_PYTHON], pydtool.cxx]
 #end metalib_target
 #end metalib_target

+ 3 - 13
dtool/pptempl/Global.pp

@@ -296,19 +296,9 @@
 #defer get_sources \
 #defer get_sources \
   $[SOURCES] \
   $[SOURCES] \
   $[PRECOMPILED_HEADER] \
   $[PRECOMPILED_HEADER] \
-  $[if $[ne $[NO_COMBINED_SOURCES],], $[INCLUDED_SOURCES], $[get_combined_sources]] \  
-  $[if $[HAVE_CRYPTO],$[IF_CRYPTO_SOURCES]] \
-  $[if $[HAVE_TIFF],$[IF_TIFF_SOURCES]] \
-  $[if $[HAVE_FFTW],$[IF_FFTW_SOURCES]] \
-  $[if $[HAVE_NURBSPP],$[IF_NURBSPP_SOURCES]] \
-  $[if $[HAVE_JPEG], $[IF_JPEG_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_JPEG_INCLUDED_SOURCES], $[IF_JPEG_COMBINED_SOURCES]]] \
-  $[if $[HAVE_JPEG2000], $[IF_JPEG2000_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_JPEG2000_INCLUDED_SOURCES], $[IF_JPEG2000_COMBINED_SOURCES]]] \
-  $[if $[HAVE_ZLIB], $[IF_ZLIB_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_ZLIB_INCLUDED_SOURCES], $[IF_ZLIB_COMBINED_SOURCES]]] \
-  $[if $[HAVE_NET], $[IF_NET_SOURCES] $[if $[ne $[NO_COMBINED_SOURCES],], $[IF_NET_INCLUDED_SOURCES], $[IF_NET_COMBINED_SOURCES]]] \
-  $[if $[HAVE_IPC],$[IF_IPC_SOURCES]] \
-  $[if $[HAVE_PYTHON],$[IF_PYTHON_SOURCES]]
-
-#defer included_sources $[INCLUDED_SOURCES] $[if $[HAVE_ZLIB],$[IF_ZLIB_INCLUDED_SOURCES]] $[if $[HAVE_NET],$[IF_NET_INCLUDED_SOURCES]] $[if $[USE_SINGLE_COMPOSITE_SOURCEFILE], $[COMBINED_SOURCES]] $[if $[HAVE_JPEG],$[IF_JPEG_INCLUDED_SOURCES]]
+  $[if $[ne $[NO_COMBINED_SOURCES],], $[INCLUDED_SOURCES], $[get_combined_sources]]
+
+#defer included_sources $[INCLUDED_SOURCES]
   
   
 // This variable returns the set of sources that are to be
 // This variable returns the set of sources that are to be
 // interrogated for the current target.
 // interrogated for the current target.

+ 10 - 25
panda/src/downloader/Sources.pp

@@ -8,38 +8,23 @@
 #begin lib_target
 #begin lib_target
   #define TARGET downloader
   #define TARGET downloader
   
   
-  #define COMBINED_SOURCES $[TARGET]_composite1.cxx
+  #define COMBINED_SOURCES $[TARGET]_composite1.cxx \
+    $[if $[HAVE_NET], $[TARGET]_composite3.cxx] \
+    $[if $[HAVE_ZLIB], $[TARGET]_composite4.cxx] \
 
 
   #define SOURCES \
   #define SOURCES \
     config_downloader.h asyncUtility.I asyncUtility.h \
     config_downloader.h asyncUtility.I asyncUtility.h \
     extractor.h  multiplexStream.I multiplexStream.h \
     extractor.h  multiplexStream.I multiplexStream.h \
-    multiplexStreamBuf.I multiplexStreamBuf.h 
+    multiplexStreamBuf.I multiplexStreamBuf.h \
+    $[if $[HAVE_NET], downloadDb.I downloadDb.h downloader.I downloader.h] \
+    $[if $[HAVE_ZLIB], decompressor.h zcompressor.I zcompressor.h download_utils.h] \
+    $[if $[HAVE_CRYPTO], patcher.cxx patcher.h patcher.I]
     
     
   #define INCLUDED_SOURCES                 \
   #define INCLUDED_SOURCES                 \
     config_downloader.cxx asyncUtility.cxx \
     config_downloader.cxx asyncUtility.cxx \
-    extractor.cxx multiplexStream.cxx multiplexStreamBuf.cxx
-
-  #define IF_NET_SOURCES \
-    downloadDb.I downloadDb.h downloader.I downloader.h
-    
-  #define IF_NET_INCLUDED_SOURCES \
-    downloadDb.cxx downloader.cxx 
-    
-  #define IF_NET_COMBINED_SOURCES \ 
-    $[TARGET]_composite3.cxx        
-
-  #define IF_ZLIB_SOURCES \
-    decompressor.h zcompressor.I zcompressor.h download_utils.h
-    
-  #define IF_ZLIB_COMBINED_SOURCES \    
-    $[TARGET]_composite4.cxx    
-    
-  #define IF_ZLIB_INCLUDED_SOURCES \
-    decompressor.cxx zcompressor.cxx download_utils.cxx
-
-  #define IF_CRYPTO_SOURCES \
-    patcher.cxx                             \
-    patcher.h patcher.I
+    extractor.cxx multiplexStream.cxx multiplexStreamBuf.cxx \
+    $[if $[HAVE_NET], downloadDb.cxx downloader.cxx] \
+    $[if $[HAVE_ZLIB], decompressor.cxx zcompressor.cxx download_utils.cxx]
 
 
   #define INSTALL_HEADERS \
   #define INSTALL_HEADERS \
     asyncUtility.h asyncUtility.I \
     asyncUtility.h asyncUtility.I \

+ 5 - 6
panda/src/express/Sources.pp

@@ -39,8 +39,11 @@
      typedReferenceCount.I typedReferenceCount.h typedef.h \
      typedReferenceCount.I typedReferenceCount.h typedef.h \
      typeRegistry.I typeRegistry.h \
      typeRegistry.I typeRegistry.h \
      typeRegistryNode.I typeRegistryNode.h \
      typeRegistryNode.I typeRegistryNode.h \
-     vector_uchar.h
-    
+     vector_uchar.h \
+     $[if $[HAVE_CRYPTO], \
+        crypto_utils.cxx crypto_utils.h patchfile.I \
+        patchfile.cxx patchfile.h ]
+
   #define INCLUDED_SOURCES  \
   #define INCLUDED_SOURCES  \
      buffer.cxx checksumHashGenerator.cxx clockObject.cxx \
      buffer.cxx checksumHashGenerator.cxx clockObject.cxx \
      config_express.cxx datagram.cxx datagramGenerator.cxx \
      config_express.cxx datagram.cxx datagramGenerator.cxx \
@@ -56,10 +59,6 @@
      typedObject.cxx typedReferenceCount.cxx \
      typedObject.cxx typedReferenceCount.cxx \
      typeRegistry.cxx typeRegistryNode.cxx vector_uchar.cxx
      typeRegistry.cxx typeRegistryNode.cxx vector_uchar.cxx
 
 
-  #define IF_CRYPTO_SOURCES                         \
-    crypto_utils.cxx crypto_utils.h \
-    patchfile.I patchfile.cxx patchfile.h
-
   #define INSTALL_HEADERS                       \
   #define INSTALL_HEADERS                       \
     bigEndian.h buffer.I buffer.h checksumHashGenerator.I  \
     bigEndian.h buffer.I buffer.h checksumHashGenerator.I  \
     checksumHashGenerator.h circBuffer.I circBuffer.h clockObject.I \
     checksumHashGenerator.h circBuffer.I circBuffer.h clockObject.I \

+ 3 - 4
panda/src/parametrics/Sources.pp

@@ -18,7 +18,9 @@
      nurbsCurveDrawer.h nurbsCurveInterface.I  \
      nurbsCurveDrawer.h nurbsCurveInterface.I  \
      nurbsCurveInterface.h parametricCurve.h  \
      nurbsCurveInterface.h parametricCurve.h  \
      parametricCurveCollection.I parametricCurveCollection.h  \
      parametricCurveCollection.I parametricCurveCollection.h  \
-     piecewiseCurve.h
+     piecewiseCurve.h \
+     $[if $[HAVE_NURBSPP], nurbsPPCurve.cxx nurbsPPCurve.h]
+
 
 
   #define INCLUDED_SOURCES \
   #define INCLUDED_SOURCES \
      classicNurbsCurve.cxx config_parametrics.cxx cubicCurveseg.cxx  \
      classicNurbsCurve.cxx config_parametrics.cxx cubicCurveseg.cxx  \
@@ -27,9 +29,6 @@
      parametricCurve.cxx parametricCurveCollection.cxx  \
      parametricCurve.cxx parametricCurveCollection.cxx  \
      piecewiseCurve.cxx 
      piecewiseCurve.cxx 
 
 
-  #define IF_NURBSPP_SOURCES \
-    nurbsPPCurve.cxx nurbsPPCurve.h
-
   #define INSTALL_HEADERS \
   #define INSTALL_HEADERS \
     classicNurbsCurve.I classicNurbsCurve.h \
     classicNurbsCurve.I classicNurbsCurve.h \
     config_parametrics.h \
     config_parametrics.h \

+ 11 - 26
panda/src/pnmimagetypes/Sources.pp

@@ -10,14 +10,20 @@
   #define LOCAL_LIBS \
   #define LOCAL_LIBS \
     pnm pnmimage
     pnm pnmimage
 
 
-  #define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx
+  #define COMBINED_SOURCES \
+     $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx \
+     $[if $[HAVE_JPEG], $[TARGET]_composite3.cxx] \
+     $[if $[HAVE_JPEG2000], $[TARGET]_composite4.cxx]
 
 
   #define SOURCES  \
   #define SOURCES  \
      config_pnmimagetypes.h pnmFileTypeAlias.h pnmFileTypeBMP.h  \
      config_pnmimagetypes.h pnmFileTypeAlias.h pnmFileTypeBMP.h  \
      pnmFileTypeIMG.h pnmFileTypePNM.h pnmFileTypeRadiance.h  \
      pnmFileTypeIMG.h pnmFileTypePNM.h pnmFileTypeRadiance.h  \
      pnmFileTypeSGI.h pnmFileTypeSoftImage.h  \
      pnmFileTypeSGI.h pnmFileTypeSoftImage.h  \
      pnmFileTypeTGA.h pnmFileTypeYUV.h color.c colrops.c resolu.c  \
      pnmFileTypeTGA.h pnmFileTypeYUV.h color.c colrops.c resolu.c  \
-     header.c  
+     header.c \
+     $[if $[HAVE_TIFF], pnmFileTypeTIFF.cxx pnmFileTypeTIFF.h] \
+     $[if $[HAVE_JPEG], pnmFileTypeJPG.h] \
+     $[if $[HAVE_JPEG2000], pnmFileTypeJPG2000.h]
 
 
   #define INCLUDED_SOURCES  \
   #define INCLUDED_SOURCES  \
      config_pnmimagetypes.cxx pnmFileTypeAlias.cxx  \
      config_pnmimagetypes.cxx pnmFileTypeAlias.cxx  \
@@ -26,30 +32,9 @@
      pnmFileTypeRadiance.cxx pnmFileTypeSGI.cxx  \
      pnmFileTypeRadiance.cxx pnmFileTypeSGI.cxx  \
      pnmFileTypeSGIReader.cxx pnmFileTypeSGIWriter.cxx  \
      pnmFileTypeSGIReader.cxx pnmFileTypeSGIWriter.cxx  \
      pnmFileTypeSoftImage.cxx \
      pnmFileTypeSoftImage.cxx \
-     pnmFileTypeTGA.cxx pnmFileTypeYUV.cxx
-    
-  #define IF_TIFF_SOURCES \
-    pnmFileTypeTIFF.cxx pnmFileTypeTIFF.h
-     
-  #define IF_JPEG_INCLUDED_SOURCES \
-    pnmFileTypeJPG.cxx \
-    pnmFileTypeJPGReader.cxx pnmFileTypeJPGWriter.cxx
-    
-  #define IF_JPEG_SOURCES \
-    pnmFileTypeJPG.h 
-    
-  #define IF_JPEG_COMBINED_SOURCES \    
-    $[TARGET]_composite3.cxx        
-
-  #define IF_JPEG2000_INCLUDED_SOURCES \
-    pnmFileTypeJPG2000.cxx \
-    pnmFileTypeJPG2000Reader.cxx pnmFileTypeJPG2000Writer.cxx
-    
-  #define IF_JPEG2000_SOURCES \
-    pnmFileTypeJPG2000.h 
-    
-  #define IF_JPEG2000_COMBINED_SOURCES \    
-    $[TARGET]_composite4.cxx
+     pnmFileTypeTGA.cxx pnmFileTypeYUV.cxx \
+     $[if $[HAVE_JPEG], pnmFileTypeJPG.cxx pnmFileTypeJPGReader.cxx pnmFileTypeJPGWriter.cxx] \
+     $[if $[HAVE_JPEG2000], pnmFileTypeJPG2000.cxx pnmFileTypeJPG2000Reader.cxx pnmFileTypeJPG2000Writer.cxx]
 
 
   #define INSTALL_HEADERS \
   #define INSTALL_HEADERS \
     config_pnmimagetypes.h
     config_pnmimagetypes.h