summaryrefslogtreecommitdiff
path: root/ext/DynaLoader
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-03-17 11:01:55 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-03-17 11:01:55 +0000
commitd404d5bf6551eaa2e4c373a4e64d842d9d7ff9cc (patch)
tree27de85b952df11b5ce7ffb490fc4f522396bb4c0 /ext/DynaLoader
parent28578fc3ab74c533ed42d816d7c7ab5737c78521 (diff)
downloadperl-d404d5bf6551eaa2e4c373a4e64d842d9d7ff9cc.tar.gz
Convert to use $^O and Config's $dl_so instead of hard-wired .o
Diffstat (limited to 'ext/DynaLoader')
-rw-r--r--ext/DynaLoader/DynaLoader.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/DynaLoader/DynaLoader.pm b/ext/DynaLoader/DynaLoader.pm
index 0e639f91bf..282d364372 100644
--- a/ext/DynaLoader/DynaLoader.pm
+++ b/ext/DynaLoader/DynaLoader.pm
@@ -27,14 +27,14 @@ sub import { } # override import inherited from AutoLoader
# enable debug/trace messages from DynaLoader perl code
$dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
-($dl_dlext, $dlsrc, $osname)
- = @Config::Config{'dlext', 'dlsrc', 'osname'};
+($dl_dlext, $dlsrc)
+ = @Config::Config{'dlext', 'dlsrc'};
# Some systems need special handling to expand file specifications
# (VMS support by Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>)
# See dl_expandspec() for more details. Should be harmless but
# inefficient to define on systems that don't need it.
-$do_expand = $Is_VMS = $osname eq 'VMS';
+$do_expand = $Is_VMS = $^O eq 'VMS';
@dl_require_symbols = (); # names of symbols we need
@dl_resolve_using = (); # names of files to link with
@@ -125,7 +125,7 @@ sub bootstrap {
my $bs = $file;
$bs =~ s/(\.\w+)?$/\.bs/; # look for .bs 'beside' the library
if (-s $bs) { # only read file if it's not empty
- print STDERR "BS: $bs ($osname, $dlsrc)\n" if $dl_debug;
+ print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug;
eval { do $bs; };
warn "$bs: $@\n" if $@;
}
@@ -173,6 +173,7 @@ sub dl_findfile {
my (@args) = @_;
my (@dirs, $dir); # which directories to search
my (@found); # full paths to real files we have found
+ my $dl_ext= $Config::Config{'dlext'}; # suffix for perl extensions
my $dl_so = $Config::Config{'so'}; # suffix for shared libraries
print STDERR "dl_findfile(@args)\n" if $dl_debug;
@@ -211,9 +212,9 @@ sub dl_findfile {
push(@names,"lib$_.a");
} else { # Umm, a bare name. Try various alternatives:
# these should be ordered with the most likely first
+ push(@names,"$_.$dl_ext") unless m/\.$dl_ext$/o;
push(@names,"$_.$dl_so") unless m/\.$dl_so$/o;
push(@names,"lib$_.$dl_so") unless m:/:;
- push(@names,"$_.o") unless m/\.(o|$dl_so)$/o;
push(@names,"$_.a") if !m/\.a$/ and $dlsrc eq "dl_dld.xs";
push(@names, $_);
}
@@ -258,7 +259,7 @@ sub dl_expandspec {
my $file = $spec; # default output to input
- if ($osname eq 'VMS') { # dl_expandspec should be defined in dl_vms.xs
+ if ($Is_VMS) { # dl_expandspec should be defined in dl_vms.xs
Carp::croak("dl_expandspec: should be defined in XS file!\n");
} else {
return undef unless -f $file;