diff options
author | Leon Timmermans <fawaka@gmail.com> | 2021-01-06 17:43:15 +0000 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2021-01-06 17:43:38 +0000 |
commit | 4493dfd4aef2b89c0516020ea0914ae02dfff863 (patch) | |
tree | 6cdca2f2fd682d7925f6cc4fc4f0187893e2e395 | |
parent | 95369ab82a0e3669e1631262db9025407341acac (diff) | |
download | perl-4493dfd4aef2b89c0516020ea0914ae02dfff863.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.
(cherry picked from commit d296ead16762852ec34d173616a271c856711f77)
(with a manual tweak to the $VERSION since maint is behind blead)
-rw-r--r-- | ext/DynaLoader/DynaLoader_pm.PL | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index 5c14cccc8d..49d449976a 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.47'; + $VERSION = '1.47_01'; } EOT @@ -502,12 +502,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>> } } } |