summaryrefslogtreecommitdiff
path: root/ext/DynaLoader
diff options
context:
space:
mode:
authorLeon Timmermans <fawaka@gmail.com>2020-12-17 17:05:57 +0100
committerLeon Timmermans <fawaka@gmail.com>2020-12-22 23:26:30 +0100
commitd296ead16762852ec34d173616a271c856711f77 (patch)
tree947043110b091f2b6e15a6ac0a80946bddf8802d /ext/DynaLoader
parentd4f7ec970b3e468fa723d650fc87974550189f0e (diff)
downloadperl-d296ead16762852ec34d173616a271c856711f77.tar.gz
Make DynaLoader on MacOS check library existence with dlopen
A number of system libraries no longer exist as actual files, even though dlopen will pretend they do, so now we fall back to dlopen if a library file can not be found.
Diffstat (limited to 'ext/DynaLoader')
-rw-r--r--ext/DynaLoader/DynaLoader_pm.PL16
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
index f68d59aa7e..002569f98c 100644
--- a/ext/DynaLoader/DynaLoader_pm.PL
+++ b/ext/DynaLoader/DynaLoader_pm.PL
@@ -88,7 +88,7 @@ package DynaLoader;
# Tim.Bunce@ig.co.uk, August 1994
BEGIN {
- $VERSION = '1.49';
+ $VERSION = '1.50';
}
EOT
@@ -494,12 +494,20 @@ sub dl_findfile {
foreach $name (@names) {
my($file) = "$dir$dirsep$name";
print STDERR " checking in $dir for $name\n" if $dl_debug;
- $file = ($do_expand) ? dl_expandspec($file) : (-f $file && $file);
- #$file = _check_file($file);
- if ($file) {
+ if ($do_expand && ($file = dl_expandspec($file))) {
+ push @found, $file;
+ next arg; # no need to look any further
+ }
+ elsif (-f $file) {
push(@found, $file);
next arg; # no need to look any further
}
+ <<$^O-eq-darwin>>
+ elsif (dl_load_file($file, 0)) {
+ push @found, $file;
+ next arg; # no need to look any further
+ }
+ <</$^O-eq-darwin>>
}
}
}