From e6197cabf1bf43625f8aa8a80559d7b5bf95f2cf Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sat, 21 Oct 2000 23:23:19 +0100 Subject: [PATCH] PATCH $Config::Config{ldlibpthname} in ext/DynaLoader/DynaLoader_pm.PL Message-ID: <20001021222319.B45586@plum.flirble.org> p4raw-id: //depot/perl@7399 --- ext/DynaLoader/DynaLoader_pm.PL | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index b7b45d8..0d4e8cd 100644 --- a/ext/DynaLoader/DynaLoader_pm.PL +++ b/ext/DynaLoader/DynaLoader_pm.PL @@ -100,17 +100,35 @@ if ($Is_MacOS) { push(@dl_library_path, split(/,/, $ENV{LD_LIBRARY_PATH})) if exists $ENV{LD_LIBRARY_PATH}; } else { - push(@dl_library_path, split(/:/, $ENV{$Config::Config{ldlibpthname}})) - if exists $Config::Config{ldlibpthname} && - $Config::Config{ldlibpthname} ne '' && - exists $ENV{$Config::Config{ldlibpthname}} ;; - push(@dl_library_path, split(/:/, $ENV{$Config::Config{ldlibpthname}})) - if exists $Config::Config{ldlibpthname} && - $Config::Config{ldlibpthname} ne '' && - exists $ENV{$Config::Config{ldlibpthname}} ;; +# push(@dl_library_path, split(/:/, $ENV{$Config::Config{ldlibpthname}})) +# if exists $Config::Config{ldlibpthname} && +# $Config::Config{ldlibpthname} ne '' && +# exists $ENV{$Config::Config{ldlibpthname}} ;; +# push(@dl_library_path, split(/:/, $ENV{$Config::Config{ldlibpthname}})) +# if exists $Config::Config{ldlibpthname} && +# $Config::Config{ldlibpthname} ne '' && +# exists $ENV{$Config::Config{ldlibpthname}} ;; # E.g. HP-UX supports both its native SHLIB_PATH *and* LD_LIBRARY_PATH. -push(@dl_library_path, split(/:/, $ENV{LD_LIBRARY_PATH})) - if exists $ENV{LD_LIBRARY_PATH}; +# push(@dl_library_path, split(/:/, $ENV{LD_LIBRARY_PATH})) +# if exists $ENV{LD_LIBRARY_PATH}; +EOT + +# Make a list of paths to print. +# HP-UX supports both its native SHLIB_PATH *and* LD_LIBRARY_PATH, +# but for other OSes no point pushing 'LD_LIBRARY_PATH' twice. +my @ldlibpthname = 'LD_LIBRARY_PATH'; +if (exists $Config::Config{ldlibpthname} + and length $Config::Config{ldlibpthname} + and $Config::Config{ldlibpthname} ne 'LD_LIBRARY_PATH') { + unshift @ldlibpthname, $Config::Config{ldlibpthname}; +} + +foreach (@ldlibpthname) { + print OUT " push(\@dl_library_path, split(/:/, \$ENV{", to_string($_), + "}))\n\tif exists \$ENV{", to_string($_), "};\n"; +} + +print OUT <<'EOT'; } # No prizes for guessing why we don't say 'bootstrap DynaLoader;' here. -- 2.7.4