use 5.00503;
# Broken out of MakeMaker from version 4.11
+use strict;
use vars qw($VERSION);
-$VERSION = 1.30;
+$VERSION = 6.42;
use Config;
use Cwd 'cwd';
&& ($thislib .= "_s") ){ # we must explicitly use _s version
} elsif (-f ($fullname="$thispth/lib$thislib$Config_libext")){
} elsif (-f ($fullname="$thispth/$thislib$Config_libext")){
+ } elsif (-f ($fullname="$thispth/lib$thislib.dll$Config_libext")){
} elsif (-f ($fullname="$thispth/Slib$thislib$Config_libext")){
} elsif ($^O eq 'dgux'
&& -l ($fullname="$thispth/lib$thislib$Config_libext")
next;
}
warn "'-l$thislib' found at $fullname\n" if $verbose;
- my($fullnamedir) = dirname($fullname);
- push @ld_run_path, $fullnamedir
- unless $ld_run_path_seen{$fullnamedir}++;
push @libs, $fullname unless $libs_seen{$fullname}++;
$found++;
$found_lib++;
my $is_dyna = ($fullname !~ /\Q$Config_libext\E\z/);
my $in_perl = ($libs =~ /\B-l\Q${thislib}\E\b/s);
+ # include the path to the lib once in the dynamic linker path
+ # but only if it is a dynamic lib and not in Perl itself
+ my($fullnamedir) = dirname($fullname);
+ push @ld_run_path, $fullnamedir
+ if $is_dyna && !$in_perl &&
+ !$ld_run_path_seen{$fullnamedir}++;
+
# Do not add it into the list if it is already linked in
# with the main perl executable.
# We have to special-case the NeXT, because math and ndbm
return ("", "", "", "", ($give_libs ? [] : ())) unless $potential_libs;
my $cc = $Config{cc};
- my $VC = 1 if $cc =~ /^cl/i;
- my $BC = 1 if $cc =~ /^bcc/i;
- my $GC = 1 if $cc =~ /^gcc/i;
+ my $VC = $cc =~ /^cl/i;
+ my $BC = $cc =~ /^bcc/i;
+ my $GC = $cc =~ /^gcc/i;
my $so = $Config{'so'};
my $libs = $Config{'perllibs'};
my $libpth = $Config{'libpth'};
$verbose ||= 0;
my(@crtls,$crtlstr);
- my($dbgqual) = $self->{OPTIMIZE} || $Config{'optimize'} ||
- $self->{CCFLAGS} || $Config{'ccflags'};
- @crtls = ( ($dbgqual =~ m-/Debug-i ? $Config{'dbgprefix'} : '')
+ @crtls = ( ($Config{'ldflags'} =~ m-/Debug-i ? $Config{'dbgprefix'} : '')
. 'PerlShr/Share' );
push(@crtls, grep { not /\(/ } split /\s+/, $Config{'perllibs'});
push(@crtls, grep { not /\(/ } split /\s+/, $Config{'libc'});
if ($self->{PERL_SRC}) {
my($lib,$locspec,$type);
foreach $lib (@crtls) {
- if (($locspec,$type) = $lib =~ m-^([\w$\-]+)(/\w+)?- and $locspec =~ /perl/i) {
+ if (($locspec,$type) = $lib =~ m{^([\w\$-]+)(/\w+)?} and $locspec =~ /perl/i) {
if (lc $type eq '/share') { $locspec .= $Config{'exe_ext'}; }
elsif (lc $type eq '/library') { $locspec .= $Config{'lib_ext'}; }
else { $locspec .= $Config{'obj_ext'}; }
$lib = $libmap{$lib};
}
- my(@variants,$variant,$name,$test,$cand);
+ my(@variants,$variant,$cand);
my($ctype) = '';
# If we don't have a file type, consider it a possibly abbreviated name and
push(@variants,$lib);
warn "Looking for $lib\n" if $verbose;
foreach $variant (@variants) {
+ my($fullname, $name);
+
foreach $dir (@dirs) {
my($type);
$name = "$dir$variant";
warn "\tChecking $name\n" if $verbose > 2;
- if (-f ($test = VMS::Filespec::rmsexpand($name))) {
+ $fullname = VMS::Filespec::rmsexpand($name);
+ if (defined $fullname and -f $fullname) {
# It's got its own suffix, so we'll have to figure out the type
- if ($test =~ /(?:$so|exe)$/i) { $type = 'SHR'; }
- elsif ($test =~ /(?:$lib_ext|olb)$/i) { $type = 'OLB'; }
- elsif ($test =~ /(?:$obj_ext|obj)$/i) {
+ if ($fullname =~ /(?:$so|exe)$/i) { $type = 'SHR'; }
+ elsif ($fullname =~ /(?:$lib_ext|olb)$/i) { $type = 'OLB'; }
+ elsif ($fullname =~ /(?:$obj_ext|obj)$/i) {
warn "Note (probably harmless): "
- ."Plain object file $test found in library list\n";
+ ."Plain object file $fullname found in library list\n";
$type = 'OBJ';
}
else {
warn "Note (probably harmless): "
- ."Unknown library type for $test; assuming shared\n";
+ ."Unknown library type for $fullname; assuming shared\n";
$type = 'SHR';
}
}
- elsif (-f ($test = VMS::Filespec::rmsexpand($name,$so)) or
- -f ($test = VMS::Filespec::rmsexpand($name,'.exe'))) {
+ elsif (-f ($fullname = VMS::Filespec::rmsexpand($name,$so)) or
+ -f ($fullname = VMS::Filespec::rmsexpand($name,'.exe'))) {
$type = 'SHR';
- $name = $test unless $test =~ /exe;?\d*$/i;
+ $name = $fullname unless $fullname =~ /exe;?\d*$/i;
}
- elsif (not length($ctype) and # If we've got a lib already, don't bother
- ( -f ($test = VMS::Filespec::rmsexpand($name,$lib_ext)) or
- -f ($test = VMS::Filespec::rmsexpand($name,'.olb')))) {
+ elsif (not length($ctype) and # If we've got a lib already,
+ # don't bother
+ ( -f ($fullname = VMS::Filespec::rmsexpand($name,$lib_ext)) or
+ -f ($fullname = VMS::Filespec::rmsexpand($name,'.olb')))) {
$type = 'OLB';
- $name = $test unless $test =~ /olb;?\d*$/i;
+ $name = $fullname unless $fullname =~ /olb;?\d*$/i;
}
- elsif (not length($ctype) and # If we've got a lib already, don't bother
- ( -f ($test = VMS::Filespec::rmsexpand($name,$obj_ext)) or
- -f ($test = VMS::Filespec::rmsexpand($name,'.obj')))) {
+ elsif (not length($ctype) and # If we've got a lib already,
+ # don't bother
+ ( -f ($fullname = VMS::Filespec::rmsexpand($name,$obj_ext)) or
+ -f ($fullname = VMS::Filespec::rmsexpand($name,'.obj')))) {
warn "Note (probably harmless): "
- ."Plain object file $test found in library list\n";
+ ."Plain object file $fullname found in library list\n";
$type = 'OBJ';
- $name = $test unless $test =~ /obj;?\d*$/i;
+ $name = $fullname unless $fullname =~ /obj;?\d*$/i;
}
if (defined $type) {
$ctype = $type; $cand = $name;
# This has to precede any other CRTLs, so just make it first
if ($cand eq 'VAXCCURSE') { unshift @{$found{$ctype}}, $cand; }
else { push @{$found{$ctype}}, $cand; }
- warn "\tFound as $cand (really $test), type $ctype\n" if $verbose > 1;
+ warn "\tFound as $cand (really $fullname), type $ctype\n"
+ if $verbose > 1;
push @flibs, $name unless $libs_seen{$fullname}++;
next LIB;
}