From 4493dfd4aef2b89c0516020ea0914ae02dfff863 Mon Sep 17 00:00:00 2001 From: Leon Timmermans Date: Wed, 6 Jan 2021 17:43:15 +0000 Subject: 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) --- ext/DynaLoader/DynaLoader_pm.PL | 16 ++++++++++++---- 1 file 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 + } + <> } } } -- cgit v1.2.1