diff --git a/dtool/Config.pp b/dtool/Config.pp index f5105ba5a0..34077241c0 100644 --- a/dtool/Config.pp +++ b/dtool/Config.pp @@ -328,8 +328,8 @@ // 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 + #defer CC cc -n32 -mips3 + #defer CXX CC -n32 -mips3 // Turn off a few annoying warning messages. // 1174 - function 'blah' was declared but never used diff --git a/dtool/pptempl/Depends.pp b/dtool/pptempl/Depends.pp index 98b0608001..3843a2b8a7 100644 --- a/dtool/pptempl/Depends.pp +++ b/dtool/pptempl/Depends.pp @@ -8,9 +8,6 @@ #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 @@ -31,12 +28,13 @@ 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]] + // Allow the user to define additional EXTRA_DEPENDS targets in each + // Sources.pp. + #define DEPEND_DIRS \ + $[sort $[EXTRA_DEPENDS] $[all_libs $[DIRNAME],$[get_depend_libs]]] #set DEPENDABLE_HEADERS $[sort $[DEPENDABLE_HEADERS]] #endif diff --git a/dtool/pptempl/Global.msvc.pp b/dtool/pptempl/Global.msvc.pp index 78d2d7c07a..4f7c0bc8e2 100644 --- a/dtool/pptempl/Global.msvc.pp +++ b/dtool/pptempl/Global.msvc.pp @@ -46,10 +46,10 @@ #defer CXX cl // Define this if we want to make .sbr files. -#define BROWSEINFO_FLAG -Fr +#defer BROWSEINFO_FLAG -Fr$[target:%.obj=%.sbr] -#defer CFLAGS_OPT1 -MDd -GZ -Zi $[BROWSEINFO_FLAG] -Fd$[target:$[so_dir]/%.obj=%] -D_DEBUG -#defer CFLAGS_OPT2 -MDd -Zi -Fd$[target:%.obj=%] -D_DEBUG -O2 -Ob1 -Ogity -G6 +#defer CFLAGS_OPT1 -MDd -GZ -Zi $[BROWSEINFO_FLAG] -Fd$[target:%.obj=%.pdb] -D_DEBUG +#defer CFLAGS_OPT2 -MDd -Zi -Fd$[target:%.obj=%.pdb] -D_DEBUG -O2 -Ob1 -Ogity -G6 #defer CFLAGS_OPT3 -MD -DOPTIMIZE -O2 -Ob1 -Ogity -G6 -Gi- #defer CFLAGS_OPT4 -MD -DOPTIMIZE -DNDEBUG -O2 -Ob1 -Ogity -G6 -Gi- @@ -59,11 +59,11 @@ #defer LFLAGS_OPT4 -fixed:no #defer extra_cflags -nologo -W3 -EHsc -Zm250 -D_WINDOWS -DWIN32 -D_WINDLL -DSTRICT -DPENV_WIN32 -DWIN32_VC -#defer extra_so_lflags -DLL +#defer extra_so_lflags -DLL -NOLOGO #defer extra_bin_lflags = -NOLOGO -#defer COMPILE_C cd $[so_dir]; $[CC] -c -o $[target:$[so_dir]/%=%] $[decygwin %,-I"%",$[ipath]] $[flags] $[extra_cflags] ../$[source] +#defer COMPILE_C $[CC] -c -Fo$[target] $[decygwin %,-I"%",$[ipath]] $[flags] $[extra_cflags] $[source] #defer COMPILE_C++ $[COMPILE_C] -#defer SHARED_LIB_C cd $[so_dir]; cl $[LFLAGS_OPT$[OPTIMIZE]] $[extra_so_lflags] $[decygwin %,-L"%",$[lpath]] $[patsubst %.lib,%.lib,%,lib%.lib,$[libs]] $[sources] -OUT:$[target:$[so_dir]/%=%] +#defer SHARED_LIB_C link $[LFLAGS_OPT$[OPTIMIZE]] $[extra_so_lflags] $[decygwin %,-LIBPATH:"%",$[lpath]] $[patsubst %.lib,%.lib,%,lib%.lib,$[libs]] $[sources] -OUT:$[target] #defer SHARED_LIB_C++ $[SHARED_LIB_C] diff --git a/dtool/pptempl/Global.pp b/dtool/pptempl/Global.pp index fe89ae3002..f0f342a5cc 100644 --- a/dtool/pptempl/Global.pp +++ b/dtool/pptempl/Global.pp @@ -393,6 +393,71 @@ #end get_ld +// This function 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. +#defun get_depend_libs + #define 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)] + + $[depend_libs] +#end get_depend_libs + + // Define a few directories that will be useful. #define so_dir $[ODIR_SHARED] diff --git a/dtool/pptempl/Template.msvc.pp b/dtool/pptempl/Template.msvc.pp index 6022fb37a9..7e0bc1535c 100644 --- a/dtool/pptempl/Template.msvc.pp +++ b/dtool/pptempl/Template.msvc.pp @@ -54,7 +54,7 @@ // $[bin_targets] the list of binaries. $[test_bin_targets] is the // list of binaries that are to be built only when specifically asked // for. -#define lib_targets $[patsubst %,$[so_dir]/lib%.dll,$[TARGET(metalib_target noinst_lib_target) $[real_lib_targets]]] +#define lib_targets $[patsubst %,$[so_dir]/lib%.dll,$[TARGET(metalib_target noinst_lib_target)] $[real_lib_targets]] #define static_lib_targets $[TARGET(static_lib_target):%=$[st_dir]/lib%.lib] #define bin_targets $[TARGET(bin_target noinst_bin_target sed_bin_target):%=$[st_dir]/%] #define test_bin_targets $[TARGET(test_bin_target):%=$[st_dir]/%]