summaryrefslogtreecommitdiff
path: root/ext/DynaLoader/DynaLoader_pm.PL
diff options
context:
space:
mode:
Diffstat (limited to 'ext/DynaLoader/DynaLoader_pm.PL')
-rw-r--r--ext/DynaLoader/DynaLoader_pm.PL18
1 files changed, 11 insertions, 7 deletions
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
index 4c4155985d..3e30698f87 100644
--- a/ext/DynaLoader/DynaLoader_pm.PL
+++ b/ext/DynaLoader/DynaLoader_pm.PL
@@ -93,15 +93,19 @@ print OUT "push(\@dl_library_path, split(' ', ",
print OUT <<'EOT';
-# Add to @dl_library_path any extra directories we can gather from
-# environment variables. So far LD_LIBRARY_PATH is the only known
-# variable used for this purpose. Others may be added later.
+# Add to @dl_library_path any extra directories we can gather
+# from environment variables.
+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 $ENV{LD_LIBRARY_PATH};
-
+ if exists $ENV{LD_LIBRARY_PATH};
# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
-boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader);
+boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
+ !defined(&dl_load_file);
if ($dl_debug) {
@@ -190,7 +194,7 @@ sub bootstrap {
# it executed.
my $libref = dl_load_file($file, $module->dl_load_flags) or
- croak("Can't load '$file' for module $module: ".dl_error()."\n");
+ croak("Can't load '$file' for module $module: ".dl_error());
push(@dl_librefs,$libref); # record loaded object