Răsfoiți Sursa

replace USE_GL, USE_DX, etc. with USE_PACKAGES

David Rose 23 ani în urmă
părinte
comite
304264d481

+ 22 - 2
dtool/pptempl/Global.pp

@@ -337,13 +337,21 @@
 #defer get_igatemscan \
   $[if $[and $[run_interrogate],$[components $[IGATESCAN],$[active_component_libs]]], \
     $[TARGET]]
+
+// This variable returns the set of external packages used by this
+// target, and by all the components shared by this target.
+#defer use_packages $[sort $[USE_PACKAGES] $[components $[USE_PACKAGES],$[active_component_libs]]]
     
 // 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 $[stl_cflags] $[nspr_cflags] $[python_cflags]
-  
+
+  #foreach package $[use_packages]
+    #set alt_cflags $[alt_cflags] $[$[package]_cflags]
+  #end package
+
   #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs]],]
     #set alt_cflags $[alt_cflags] $[crypto_cflags]
   #endif
@@ -418,6 +426,10 @@
 #defun get_ipath
   #define alt_ipath $[stl_ipath] $[nspr_ipath] $[python_ipath]
   
+  #foreach package $[use_packages]
+    #set alt_ipath $[alt_ipath] $[$[package]_ipath]
+  #end package
+
   #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs]],]
     #set alt_ipath $[alt_ipath] $[crypto_ipath]
   #endif
@@ -491,6 +503,10 @@
 // directory names only; the -L switch is not included here.
 #defun get_lpath
   #define alt_lpath $[stl_lpath] $[nspr_lpath] $[python_lpath]
+
+  #foreach package $[use_packages]
+    #set alt_lpath $[alt_lpath] $[$[package]_lpath]
+  #end package
   
   #if $[WINDOWS_PLATFORM]  
     #set alt_lpath $[WIN32_PLATFORMSDK_LIBPATH] $[alt_lpath] 
@@ -569,6 +585,10 @@
 // included here.
 #defun get_libs
   #define alt_libs $[stl_libs] $[nspr_libs] $[python_libs] $[TARGET_LIBS]
+
+  #foreach package $[use_packages]
+    #set alt_libs $[alt_libs] $[$[package]_libs]
+  #end package
   
   #if $[ne $[USE_CRYPTO] $[components $[USE_CRYPTO],$[active_component_libs] $[transitive_link]],]
     #set alt_libs $[alt_libs] $[crypto_libs]
@@ -645,7 +665,7 @@
 
 // This function returns the appropriate value for ld for the target.
 #defun get_ld
-  #if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LD]],]
+  #if $[filter maya,$[use_packages]]
     $[maya_ld]
   #endif
 #end get_ld

+ 1 - 1
panda/metalibs/panda/Sources.pp

@@ -6,7 +6,7 @@
 
 #define DIR_TYPE metalib
 #define BUILDING_DLL BUILDING_PANDA
-#define USE_NET yes
+#define USE_PACKAGES net
 
 #define COMPONENT_LIBS \
     pgraph \

+ 0 - 2
panda/metalibs/pandacr/Sources.pp

@@ -8,8 +8,6 @@
 #define BUILDING_DLL BUILDING_PANDACR
 #define BUILD_DIRECTORY $[HAVE_CHROMIUM]
 
-//#define USE_CHROMIUM yes
-
 #define COMPONENT_LIBS \
     crgsg wcrdisplay
 

+ 1 - 1
panda/metalibs/pandaexpress/Sources.pp

@@ -6,7 +6,7 @@
 
 #define DIR_TYPE metalib
 #define BUILDING_DLL BUILDING_PANDAEXPRESS
-#define USE_NET yes
+#define USE_PACKAGES net
 
 #define COMPONENT_LIBS downloader event ipc express pandabase
 #define OTHER_LIBS dtoolconfig dtool

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

@@ -4,7 +4,7 @@
 #begin lib_target
   #define TARGET miles_audio
   #define BUILD_TARGET $[HAVE_RAD_MSS]
-  #define USE_RAD_MSS yes
+  #define USE_PACKAGES rad_mss
   #define BUILDING_DLL BUILDING_MILES_AUDIO
   #define LOCAL_LIBS audio
   #define WIN_SYS_LIBS $[WIN_SYS_LIBS] user32.lib advapi32.lib

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

@@ -2,7 +2,7 @@
 
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
-#define USE_CHROMIUM yes
+#define USE_PACKAGES chromium
 
 #begin lib_target
   #define TARGET crgsg

+ 2 - 4
panda/src/downloader/Sources.pp

@@ -1,13 +1,11 @@
 #define LOCAL_LIBS event ipc express pandabase
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
-#define USE_ZLIB yes
-#define USE_IPC yes
-#define USE_NET yes
+#define USE_PACKAGES zlib ipc net
 
 #begin lib_target
   #define TARGET downloader
-  
+
   #define COMBINED_SOURCES $[TARGET]_composite1.cxx \
     $[if $[HAVE_NET], $[TARGET]_composite3.cxx] \
     $[if $[HAVE_ZLIB], $[TARGET]_composite4.cxx] \

+ 7 - 7
panda/src/downloadertools/Sources.pp

@@ -1,8 +1,8 @@
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m pystub
 #define LOCAL_LIBS downloader express event ipc
-#define USE_IPC yes
 #define BUILD_DIRECTORY $[HAVE_IPC]
+#define USE_PACKAGES ipc
 
 #begin bin_target
   #define TARGET apply_patch
@@ -27,7 +27,7 @@
 #begin bin_target
   #define TARGET check_adler
   #define BUILD_TARGET $[HAVE_ZLIB]
-  #define USE_ZLIB yes
+  #define USE_PACKAGES $[USE_PACKAGES] zlib
 
   #define SOURCES \
     check_adler.cxx
@@ -37,7 +37,7 @@
 #begin bin_target
   #define TARGET check_crc
   #define BUILD_TARGET $[HAVE_ZLIB]
-  #define USE_ZLIB yes
+  #define USE_PACKAGES $[USE_PACKAGES] zlib
 
   #define SOURCES \
     check_crc.cxx
@@ -47,7 +47,7 @@
 #begin bin_target
   #define TARGET check_md5
   #define BUILD_TARGET $[HAVE_CRYPTO]
-  #define USE_CRYPTO yes
+  #define USE_PACKAGES $[USE_PACKAGES] crypto
 
   #define SOURCES \
     check_md5.cxx
@@ -65,7 +65,7 @@
 #begin bin_target
   #define TARGET pcompress
   #define BUILD_TARGET $[HAVE_ZLIB]
-  #define USE_ZLIB yes
+  #define USE_PACKAGES $[USE_PACKAGES] zlib
 
   #define SOURCES \
     pcompress.cxx
@@ -75,7 +75,7 @@
 #begin bin_target
   #define TARGET pdecompress
   #define BUILD_TARGET $[HAVE_ZLIB]
-  #define USE_ZLIB yes
+  #define USE_PACKAGES $[USE_PACKAGES] zlib
 
   #define SOURCES \
     pdecompress.cxx
@@ -85,7 +85,7 @@
 #begin bin_target
   #define TARGET test_downloader
   #define BUILD_TARGET $[HAVE_ZLIB]
-  #define USE_ZLIB yes
+  #define USE_PACKAGES $[USE_PACKAGES] zlib
 
   #define SOURCES \
     test_downloader.cxx

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

@@ -2,7 +2,7 @@
 
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
-#define USE_DX yes
+#define USE_PACKAGES dx
 
 #begin lib_target
 

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

@@ -2,7 +2,7 @@
 
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
-#define USE_DX yes
+#define USE_PACKAGES dx
 
 #begin lib_target
   #define TARGET dxgsg8

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

@@ -1,7 +1,7 @@
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
 
-#define USE_NURBSPP yes
+#define USE_PACKAGES nurbspp
 
 #begin lib_target
   #define TARGET egg2pg

+ 1 - 3
panda/src/express/Sources.pp

@@ -4,9 +4,7 @@
 
 #begin lib_target
   #define TARGET express
-  #define USE_NSPR yes
-  #define USE_CRYPTO yes
-  #define USE_NET yes
+  #define USE_PACKAGES nspr crypto net
   
   #define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx
 

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

@@ -2,7 +2,7 @@
 
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
-#define USE_GL yes
+#define USE_PACKAGES gl
 
 #begin lib_target
   #define TARGET glgsg

+ 1 - 2
panda/src/glutdisplay/Sources.pp

@@ -2,8 +2,7 @@
 
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
-#define USE_GL yes
-#define USE_GLUT yes
+#define USE_PACKAGES gl glut
 
 #begin lib_target
   #define TARGET glutdisplay

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

@@ -2,7 +2,7 @@
 
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
-#define USE_GL yes
+#define USE_PACKAGES gl glx
 
 #begin lib_target
   #define TARGET glxdisplay

+ 1 - 2
panda/src/ipc/Sources.pp

@@ -1,8 +1,7 @@
 #define LOCAL_LIBS express pandabase
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
-#define USE_NSPR yes
-#define USE_IPC yes
+#define USE_PACKAGES nspr ipc
 #define BUILD_DIRECTORY $[HAVE_IPC]
 
 #begin lib_target

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

@@ -5,7 +5,7 @@
   #define TARGET mathutil
   #define LOCAL_LIBS \
     linmath putil event express
-  #define USE_FFTW yes
+  #define USE_PACKAGES fftw
   #define UNIX_SYS_LIBS m
 
   #define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx 

+ 1 - 2
panda/src/net/Sources.pp

@@ -1,8 +1,7 @@
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
 #define BUILD_DIRECTORY $[and $[HAVE_NET],$[HAVE_NSPR]]
-#define USE_NET yes
-#define USE_NSPR yes
+#define USE_PACKAGES net nspr
 
 #begin lib_target
   #define TARGET net

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

@@ -1,7 +1,7 @@
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
 
-#define USE_NURBSPP yes
+#define USE_PACKAGES nurbspp
 
 #begin lib_target
   #define TARGET parametrics

+ 1 - 4
panda/src/pnmimagetypes/Sources.pp

@@ -1,9 +1,6 @@
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
-
-#define USE_TIFF yes
-#define USE_JPEG yes
-#define USE_JPEG2000 yes
+#define USE_PACKAGES tiff jpeg jpeg2000
 
 #begin lib_target
   #define TARGET pnmimagetypes

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

@@ -2,7 +2,7 @@
                    dtoolutil:c dtoolbase:c dtool:m
 
 #begin lib_target
-  #define USE_FREETYPE yes
+  #define USE_PACKAGES freetype
 
   #define TARGET text
   #define LOCAL_LIBS \

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

@@ -7,7 +7,7 @@
   #define TARGET pvrpn
   #define LOCAL_LIBS \
     device dgraph
-  #define USE_VRPN yes
+  #define USE_PACKAGES vrpn
 
   #define SOURCES \
     config_vrpn.cxx config_vrpn.h vrpnClient.I vrpnClient.cxx \

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

@@ -3,7 +3,7 @@
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
 #define WIN_SYS_LIBS Imm32.lib
-#define USE_CHROMIUM yes
+#define USE_PACKAGES chromium
 
 #begin lib_target
   #define TARGET wcrdisplay

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

@@ -3,7 +3,7 @@
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
 #define WIN_SYS_LIBS Imm32.lib
-#define USE_DX yes
+#define USE_PACKAGES dx
 
 #begin lib_target
   #define TARGET wdxdisplay

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

@@ -3,7 +3,7 @@
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m
 #define WIN_SYS_LIBS Imm32.lib
-#define USE_DX yes
+#define USE_PACKAGES dx
 
 #begin lib_target
   #define TARGET wdxdisplay8

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

@@ -1,6 +1,6 @@
 #define BUILD_DIRECTORY $[HAVE_WGL]
 
-#define USE_GL yes
+#define USE_PACKAGES gl
 
 #define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                    dtoolutil:c dtoolbase:c dtool:m

+ 1 - 2
pandatool/src/gtk-stats/Sources.pp

@@ -1,6 +1,5 @@
 #define BUILD_DIRECTORY $[and $[HAVE_GTKMM],$[HAVE_NET]]
-#define USE_GTKMM yes
-#define USE_NET yes
+#define USE_PACKAGES net gtkmm
 
 #begin bin_target
   #define TARGET gtk-stats

+ 1 - 1
pandatool/src/gtkbase/Sources.pp

@@ -1,5 +1,5 @@
 #define BUILD_DIRECTORY $[HAVE_GTKMM]
-#define USE_GTKMM yes
+#define USE_PACKAGES gtkmm
 
 #begin ss_lib_target
   #define TARGET gtkbase

+ 1 - 1
pandatool/src/maya/Sources.pp

@@ -1,7 +1,7 @@
 #define BUILD_DIRECTORY $[HAVE_MAYA]
 
 #begin ss_lib_target
-  #define USE_MAYA yes
+  #define USE_PACKAGES maya
   #define TARGET maya
   #define LOCAL_LIBS \
     converter pandatoolbase

+ 1 - 1
pandatool/src/mayaegg/Sources.pp

@@ -1,7 +1,7 @@
 #define BUILD_DIRECTORY $[HAVE_MAYA]
 
 #begin ss_lib_target
-  #define USE_MAYA yes
+  #define USE_PACKAGES maya
   #define TARGET mayaegg
   #define LOCAL_LIBS \
     maya converter pandatoolbase

+ 2 - 2
pandatool/src/mayaprogs/Sources.pp

@@ -22,7 +22,7 @@
 #endif   // $[UNIX_PLATFORM]
 
 #begin bin_target
-  #define USE_MAYA yes
+  #define USE_PACKAGES maya
   #define TARGET $[binary_name]
   #define LOCAL_LIBS \
     mayaegg maya eggbase progbase
@@ -42,7 +42,7 @@
 
 
 #begin bin_target
-  #define USE_MAYA yes
+  #define USE_PACKAGES_maya
   #define TARGET mayacopy
   #define LOCAL_LIBS cvscopy maya progbase
 

+ 5 - 5
pandatool/src/ptloader/Sources.pp

@@ -11,15 +11,15 @@
   #define UNIX_SYS_LIBS \
     m
 
+  // If we've got Maya, link in the Maya libraries.
+  // To link in xfile, we need to also link in the DX libraries.
+  #define USE_PACKAGES maya dx
+
   #if $[HAVE_DX]
-    // To link in xfile, we need to also link in the DX libraries.
+    // This should have come in through USE_PACKAGES dx.  Fix this.
     #define WIN_SYS_LIBS d3dxof.lib
-    #define USE_DX yes
   #endif
 
-  // If we've got Maya, link in the Maya libraries.
-  #define USE_MAYA yes
-
   #define SOURCES \
     config_ptloader.cxx config_ptloader.h \
     loaderFileTypePandatool.cxx loaderFileTypePandatool.h

+ 1 - 1
pandatool/src/xfile/Sources.pp

@@ -2,7 +2,7 @@
 // This package is temporarily disabled.
 #define BUILD_DIRECTORY
 //#define BUILD_DIRECTORY $[HAVE_DX]
-#define USE_DX yes
+#define USE_PACKAGES dx
 
 #begin ss_lib_target
   #define TARGET xfile

+ 1 - 1
pandatool/src/xfileprogs/Sources.pp

@@ -2,7 +2,7 @@
 // This package is temporarily disabled.
 #define BUILD_DIRECTORY
 //#define BUILD_DIRECTORY $[HAVE_DX]
-#define USE_DX yes
+#define USE_PACKAGES dx
 
 #begin bin_target
   #define TARGET egg2x