diff --git a/dtool/pptempl/Global.pp b/dtool/pptempl/Global.pp index 7c6ce5eff6..50ec91648f 100644 --- a/dtool/pptempl/Global.pp +++ b/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 diff --git a/panda/metalibs/panda/Sources.pp b/panda/metalibs/panda/Sources.pp index 3a3e7e31bb..a1d6f589f2 100644 --- a/panda/metalibs/panda/Sources.pp +++ b/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 \ diff --git a/panda/metalibs/pandacr/Sources.pp b/panda/metalibs/pandacr/Sources.pp index 3e4fd20ce4..66d63bbd25 100644 --- a/panda/metalibs/pandacr/Sources.pp +++ b/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 diff --git a/panda/metalibs/pandaexpress/Sources.pp b/panda/metalibs/pandaexpress/Sources.pp index 42e1a24cfd..61ee6d6681 100644 --- a/panda/metalibs/pandaexpress/Sources.pp +++ b/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 diff --git a/panda/src/audiotraits/Sources.pp b/panda/src/audiotraits/Sources.pp index 49905c7530..2f3beead46 100644 --- a/panda/src/audiotraits/Sources.pp +++ b/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 diff --git a/panda/src/crgsg/Sources.pp b/panda/src/crgsg/Sources.pp index 2b3fd52d9f..e27237548d 100644 --- a/panda/src/crgsg/Sources.pp +++ b/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 diff --git a/panda/src/downloader/Sources.pp b/panda/src/downloader/Sources.pp index 5eadaefc0d..e8228c7690 100644 --- a/panda/src/downloader/Sources.pp +++ b/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] \ diff --git a/panda/src/downloadertools/Sources.pp b/panda/src/downloadertools/Sources.pp index 6878ac0073..fd29a670d4 100644 --- a/panda/src/downloadertools/Sources.pp +++ b/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 diff --git a/panda/src/dxgsg/Sources.pp b/panda/src/dxgsg/Sources.pp index b4a1102655..fd7f77a34e 100644 --- a/panda/src/dxgsg/Sources.pp +++ b/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 diff --git a/panda/src/dxgsg8/Sources.pp b/panda/src/dxgsg8/Sources.pp index 587cccc8e9..dcea0faeb8 100644 --- a/panda/src/dxgsg8/Sources.pp +++ b/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 diff --git a/panda/src/egg2pg/Sources.pp b/panda/src/egg2pg/Sources.pp index 9a48c7a140..75378f0033 100644 --- a/panda/src/egg2pg/Sources.pp +++ b/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 diff --git a/panda/src/express/Sources.pp b/panda/src/express/Sources.pp index 095d10796f..8e5aa45dcc 100644 --- a/panda/src/express/Sources.pp +++ b/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 diff --git a/panda/src/glgsg/Sources.pp b/panda/src/glgsg/Sources.pp index c17c871be1..8deaf67e6f 100644 --- a/panda/src/glgsg/Sources.pp +++ b/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 diff --git a/panda/src/glutdisplay/Sources.pp b/panda/src/glutdisplay/Sources.pp index b5f1da9dfb..ba3e3a7983 100644 --- a/panda/src/glutdisplay/Sources.pp +++ b/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 diff --git a/panda/src/glxdisplay/Sources.pp b/panda/src/glxdisplay/Sources.pp index a08f7707d0..adca876c9e 100644 --- a/panda/src/glxdisplay/Sources.pp +++ b/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 diff --git a/panda/src/ipc/Sources.pp b/panda/src/ipc/Sources.pp index bd404c7c1b..ac791d9194 100644 --- a/panda/src/ipc/Sources.pp +++ b/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 diff --git a/panda/src/mathutil/Sources.pp b/panda/src/mathutil/Sources.pp index 1efdb18475..82fb5be87d 100644 --- a/panda/src/mathutil/Sources.pp +++ b/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 diff --git a/panda/src/net/Sources.pp b/panda/src/net/Sources.pp index 9ac79fb91d..353a233499 100644 --- a/panda/src/net/Sources.pp +++ b/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 diff --git a/panda/src/parametrics/Sources.pp b/panda/src/parametrics/Sources.pp index e45d216aa1..4ac7725ea2 100644 --- a/panda/src/parametrics/Sources.pp +++ b/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 diff --git a/panda/src/pnmimagetypes/Sources.pp b/panda/src/pnmimagetypes/Sources.pp index 69e852dec0..c12dd29899 100644 --- a/panda/src/pnmimagetypes/Sources.pp +++ b/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 diff --git a/panda/src/text/Sources.pp b/panda/src/text/Sources.pp index 92afe46f0c..2c7c080ea0 100644 --- a/panda/src/text/Sources.pp +++ b/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 \ diff --git a/panda/src/vrpn/Sources.pp b/panda/src/vrpn/Sources.pp index c7b3feec37..9279d46b71 100644 --- a/panda/src/vrpn/Sources.pp +++ b/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 \ diff --git a/panda/src/wcrdisplay/Sources.pp b/panda/src/wcrdisplay/Sources.pp index 733c4044d5..78625d0ee6 100644 --- a/panda/src/wcrdisplay/Sources.pp +++ b/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 diff --git a/panda/src/wdxdisplay/Sources.pp b/panda/src/wdxdisplay/Sources.pp index 099c5f2f36..d63c765f52 100644 --- a/panda/src/wdxdisplay/Sources.pp +++ b/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 diff --git a/panda/src/wdxdisplay8/Sources.pp b/panda/src/wdxdisplay8/Sources.pp index b74035a8cb..e83fcd04e1 100644 --- a/panda/src/wdxdisplay8/Sources.pp +++ b/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 diff --git a/panda/src/wgldisplay/Sources.pp b/panda/src/wgldisplay/Sources.pp index fb8787bd9d..fa6a36d76c 100644 --- a/panda/src/wgldisplay/Sources.pp +++ b/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 diff --git a/pandatool/src/gtk-stats/Sources.pp b/pandatool/src/gtk-stats/Sources.pp index 4fa1ca1714..d861acdea3 100644 --- a/pandatool/src/gtk-stats/Sources.pp +++ b/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 diff --git a/pandatool/src/gtkbase/Sources.pp b/pandatool/src/gtkbase/Sources.pp index 82939227e0..65d71cd823 100644 --- a/pandatool/src/gtkbase/Sources.pp +++ b/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 diff --git a/pandatool/src/maya/Sources.pp b/pandatool/src/maya/Sources.pp index 280a937738..1c8c45a67f 100644 --- a/pandatool/src/maya/Sources.pp +++ b/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 diff --git a/pandatool/src/mayaegg/Sources.pp b/pandatool/src/mayaegg/Sources.pp index c266d7972e..37c3e3c5b7 100644 --- a/pandatool/src/mayaegg/Sources.pp +++ b/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 diff --git a/pandatool/src/mayaprogs/Sources.pp b/pandatool/src/mayaprogs/Sources.pp index a8577e578a..76da027b39 100644 --- a/pandatool/src/mayaprogs/Sources.pp +++ b/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 diff --git a/pandatool/src/ptloader/Sources.pp b/pandatool/src/ptloader/Sources.pp index 8ba0304638..8828358972 100644 --- a/pandatool/src/ptloader/Sources.pp +++ b/pandatool/src/ptloader/Sources.pp @@ -11,14 +11,14 @@ #define UNIX_SYS_LIBS \ m - #if $[HAVE_DX] - // To link in xfile, we need to also link in the DX libraries. - #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 + // To link in xfile, we need to also link in the DX libraries. + #define USE_PACKAGES maya dx + + #if $[HAVE_DX] + // This should have come in through USE_PACKAGES dx. Fix this. + #define WIN_SYS_LIBS d3dxof.lib + #endif #define SOURCES \ config_ptloader.cxx config_ptloader.h \ diff --git a/pandatool/src/xfile/Sources.pp b/pandatool/src/xfile/Sources.pp index 2eec678b88..d18628749e 100644 --- a/pandatool/src/xfile/Sources.pp +++ b/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 diff --git a/pandatool/src/xfileprogs/Sources.pp b/pandatool/src/xfileprogs/Sources.pp index 2561601303..12c4daf6f4 100644 --- a/pandatool/src/xfileprogs/Sources.pp +++ b/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