Mail Archives: cygwin/2009/11/04/22:40:01
Corinna Vinschen wrote:
> But what about perl? It uses the .dll suffix for modules on Cygwin.
perl uses dl_dlopen.xs on cygwin AFAICT, which basically passes its
arguments unchanged to the system dlopen.
> Does it call dlopen("foo.dll") or dlopen("foo")?
Looking at DynaLoader_pm.PL (this is self-modifying code, used to
generate the actual DynaLoader.pm, so it's a little odd):
($dl_dlext, $dl_so, $dlsrc) = @Config::Config{qw(dlext so dlsrc)};
sub dl_findfile {
...
# Only files should get this far...
my(@names, $name); # what filenames to look for
if (m:-l: ) { # convert -lname to appropriate library name
s/-l//;
push(@names,"lib$_.$dl_so");
push(@names,"lib$_.a");
} else { # Umm, a bare name. Try various alternatives:
# these should be ordered with the most likely first
push(@names,"$_.$dl_dlext") unless m/\.$dl_dlext$/o;
push(@names,"$_.$dl_so") unless m/\.$dl_so$/o;
push(@names,"lib$_.$dl_so") unless m:/:;
push(@names,"$_.a") if !m/\.a$/ and $dlsrc eq "dl_dld.xs";
push(@names, $_);
}
...
On cygwin:
use Config; print join("\n",@Config::Config{qw(dlext so dlsrc)});
dll
dll
dl_dlopen.xs
So it looks like perl itself accepts either a "bare" library name, or a
properly .dll-decorated one (or even "-lfoo"!) -- but will eventually
try the .dll extension if "bare" fails.
--
Chuck
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -