From f44857f8eefb27329ebecd00df9eaf7e68e4d88b Mon Sep 17 00:00:00 2001 From: David Rose Date: Sat, 18 Apr 2009 00:50:05 +0000 Subject: [PATCH] more static link issues --- dtool/pptempl/Global.pp | 3 ++- dtool/pptempl/Template.unix.pp | 10 +++++++++- dtool/src/interrogate/Sources.pp | 2 +- dtool/src/test_interrogate/Sources.pp | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dtool/pptempl/Global.pp b/dtool/pptempl/Global.pp index 512c887395..7e21a30870 100644 --- a/dtool/pptempl/Global.pp +++ b/dtool/pptempl/Global.pp @@ -457,7 +457,8 @@ // within this tree) that we must link a particular target with. It // is the transitive closure of our dependent libs: the libraries we // depend on, plus the libraries *those* libraries depend on, and so on. -#defer complete_local_libs $[unique $[closure all_libs,$[active_libs]]] +#defer nonunique_complete_local_libs $[closure all_libs,$[active_libs]] +#defer complete_local_libs $[unique $[nonunique_complete_local_libs]] // And $[complete_ipath] is the list of directories (from within this // tree) we should add to our -I list. It's basically just one for diff --git a/dtool/pptempl/Template.unix.pp b/dtool/pptempl/Template.unix.pp index fc53f70990..62db932899 100644 --- a/dtool/pptempl/Template.unix.pp +++ b/dtool/pptempl/Template.unix.pp @@ -110,7 +110,15 @@ #defer lpath $[sort $[complete_lpath]] $[other_trees_lib] $[install_lib_dir] $[get_lpath] // And $[libs] is the set of libraries we will link with. -#defer libs $[unique $[actual_local_libs:%=%$[dllext]] $[patsubst %:m,,%:c %,%$[dllext],$[OTHER_LIBS]] $[get_libs]] +#defer nonunique_libs $[nonunique_complete_local_libs:%=%$[dllext]] $[patsubst %:m,,%:c %,%$[dllext],$[OTHER_LIBS]] $[get_libs] + +// Don't use $[unique] here, since some libraries actually do need to be +// named multiple times (when linking static). +#if $[LINK_ALL_STATIC] + #defer libs $[nonunique_libs] +#else + #defer libs $[unique $[nonunique_libs]] +#endif // And $[frameworks] is the set of OSX-style frameworks we will link with. #defer frameworks $[unique $[get_frameworks]] diff --git a/dtool/src/interrogate/Sources.pp b/dtool/src/interrogate/Sources.pp index ebc0c0a9b3..07510a6275 100644 --- a/dtool/src/interrogate/Sources.pp +++ b/dtool/src/interrogate/Sources.pp @@ -1,6 +1,6 @@ #define BUILD_DIRECTORY $[HAVE_INTERROGATE] -#define LOCAL_LIBS cppParser pystub interrogatedb dconfig dtoolutil dtoolbase +#define LOCAL_LIBS cppParser interrogatedb dconfig dtoolutil dtoolbase pystub #define USE_PACKAGES openssl #begin bin_target diff --git a/dtool/src/test_interrogate/Sources.pp b/dtool/src/test_interrogate/Sources.pp index c1ae67d95c..1db502b1ef 100644 --- a/dtool/src/test_interrogate/Sources.pp +++ b/dtool/src/test_interrogate/Sources.pp @@ -1,4 +1,4 @@ -#define LOCAL_LIBS pystub interrogatedb dconfig dtoolutil dtoolbase +#define LOCAL_LIBS interrogatedb dconfig dtoolutil dtoolbase pystub #define USE_PACKAGES openssl #begin bin_target