summaryrefslogtreecommitdiff
path: root/lib/ExtUtils
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExtUtils')
-rw-r--r--lib/ExtUtils/Install.pm34
-rw-r--r--lib/ExtUtils/Liblist.pm51
-rw-r--r--lib/ExtUtils/MM_Unix.pm17
-rwxr-xr-xlib/ExtUtils/xsubpp4
4 files changed, 44 insertions, 62 deletions
diff --git a/lib/ExtUtils/Install.pm b/lib/ExtUtils/Install.pm
index ff5dbf1517..4400858e89 100644
--- a/lib/ExtUtils/Install.pm
+++ b/lib/ExtUtils/Install.pm
@@ -34,6 +34,7 @@ sub install {
use File::Copy qw(copy);
use File::Find qw(find);
use File::Path qw(mkpath);
+ use File::Compare qw(compare);
my(%hash) = %$hash;
my(%pack, %write, $dir, $warn_permissions);
@@ -96,7 +97,7 @@ sub install {
my $diff = 0;
if ( -f $targetfile && -s _ == $size) {
# We have a good chance, we can skip this one
- $diff = my_cmp($_,$targetfile);
+ $diff = compare($_,$targetfile);
} else {
print "$_ differs\n" if $verbose>1;
$diff++;
@@ -166,32 +167,6 @@ sub install_default {
},1,0,0);
}
-sub my_cmp {
- my($one,$two) = @_;
- local(*F,*T);
- my $diff = 0;
- open T, $two or return 1;
- open F, $one or Carp::croak("Couldn't open $one: $!");
- my($fr, $tr, $fbuf, $tbuf, $size);
- $size = 1024;
- # print "Reading $one\n";
- while ( $fr = read(F,$fbuf,$size)) {
- unless (
- $tr = read(T,$tbuf,$size) and
- $tbuf eq $fbuf
- ){
- # print "diff ";
- $diff++;
- last;
- }
- # print "$fr/$tr ";
- }
- # print "\n";
- close F;
- close T;
- $diff;
-}
-
sub uninstall {
my($fil,$verbose,$nonono) = @_;
die "no packlist file found: $fil" unless -f $fil;
@@ -226,7 +201,7 @@ sub inc_uninstall {
my $diff = 0;
if ( -f $targetfile && -s _ == -s $file) {
# We have a good chance, we can skip this one
- $diff = my_cmp($file,$targetfile);
+ $diff = compare($file,$targetfile);
} else {
print "#$file and $targetfile differ\n" if $verbose>1;
$diff++;
@@ -253,6 +228,7 @@ sub pm_to_blib {
use File::Basename qw(dirname);
use File::Copy qw(copy);
use File::Path qw(mkpath);
+ use File::Compare qw(compare);
use AutoSplit;
# my $my_req = $self->catfile(qw(auto ExtUtils Install forceunlink.al));
# require $my_req; # Hairy, but for the first
@@ -272,7 +248,7 @@ sub pm_to_blib {
mkpath($autodir,0,0755);
foreach (keys %$fromto) {
next if -f $fromto->{$_} && -M $fromto->{$_} < -M $_;
- unless (my_cmp($_,$fromto->{$_})){
+ unless (compare($_,$fromto->{$_})){
print "Skip $fromto->{$_} (unchanged)\n";
next;
}
diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm
index fed25ae13b..d821e83729 100644
--- a/lib/ExtUtils/Liblist.pm
+++ b/lib/ExtUtils/Liblist.pm
@@ -24,7 +24,7 @@ sub _unix_os2_ext {
$potential_libs .= $Config{libs};
}
return ("", "", "", "") unless $potential_libs;
- print STDOUT "Potential libraries are '$potential_libs':\n" if $verbose;
+ warn "Potential libraries are '$potential_libs':\n" if $verbose;
my($so) = $Config{'so'};
my($libs) = $Config{'libs'};
@@ -34,7 +34,6 @@ sub _unix_os2_ext {
# compute $extralibs, $bsloadlibs and $ldloadlibs from
# $potential_libs
# this is a rewrite of Andy Dougherty's extliblist in perl
- # its home is in <distribution>/ext/util
my(@searchpath); # from "-L/path" entries in $potential_libs
my(@libpath) = split " ", $Config{'libpth'};
@@ -49,12 +48,12 @@ sub _unix_os2_ext {
if ($thislib =~ s/^(-[LR])//){ # save path flag type
my($ptype) = $1;
unless (-d $thislib){
- print STDOUT "$ptype$thislib ignored, directory does not exist\n"
+ warn "$ptype$thislib ignored, directory does not exist\n"
if $verbose;
next;
}
unless ($self->file_name_is_absolute($thislib)) {
- print STDOUT "Warning: $ptype$thislib changed to $ptype$pwd/$thislib\n";
+ warn "Warning: $ptype$thislib changed to $ptype$pwd/$thislib\n";
$thislib = $self->catdir($pwd,$thislib);
}
push(@searchpath, $thislib);
@@ -65,7 +64,7 @@ sub _unix_os2_ext {
# Handle possible library arguments.
unless ($thislib =~ s/^-l//){
- print STDOUT "Unrecognized argument in LIBS ignored: '$thislib'\n";
+ warn "Unrecognized argument in LIBS ignored: '$thislib'\n";
next;
}
@@ -125,10 +124,10 @@ sub _unix_os2_ext {
#
# , the compilation tools expand the environment variables.)
} else {
- print STDOUT "$thislib not found in $thispth\n" if $verbose;
+ warn "$thislib not found in $thispth\n" if $verbose;
next;
}
- print STDOUT "'-l$thislib' found at $fullname\n" if $verbose;
+ warn "'-l$thislib' found at $fullname\n" if $verbose;
my($fullnamedir) = dirname($fullname);
push @ld_run_path, $fullnamedir unless $ld_run_path_seen{$fullnamedir}++;
$found++;
@@ -174,7 +173,7 @@ sub _unix_os2_ext {
}
last; # found one here so don't bother looking further
}
- print STDOUT "Note (probably harmless): "
+ warn "Note (probably harmless): "
."No library found for -l$thislib\n"
unless $found_lib>0;
}
@@ -202,7 +201,7 @@ sub _win32_ext {
$potential_libs .= " " if $potential_libs;
$potential_libs .= $libs;
}
- print STDOUT "Potential libraries are '$potential_libs':\n" if $verbose;
+ warn "Potential libraries are '$potential_libs':\n" if $verbose;
# compute $extralibs from $potential_libs
@@ -218,13 +217,13 @@ sub _win32_ext {
# Handle possible linker path arguments.
if ($thislib =~ s/^-L// and not -d $thislib) {
- print STDOUT "-L$thislib ignored, directory does not exist\n"
+ warn "-L$thislib ignored, directory does not exist\n"
if $verbose;
next;
}
elsif (-d $thislib) {
unless ($self->file_name_is_absolute($thislib)) {
- print STDOUT "Warning: -L$thislib changed to -L$pwd/$thislib\n";
+ warn "Warning: -L$thislib changed to -L$pwd/$thislib\n";
$thislib = $self->catdir($pwd,$thislib);
}
push(@searchpath, $thislib);
@@ -238,22 +237,22 @@ sub _win32_ext {
my($found_lib)=0;
foreach $thispth (@searchpath, @libpath){
unless (-f ($fullname="$thispth\\$thislib")) {
- print STDOUT "$thislib not found in $thispth\n" if $verbose;
+ warn "$thislib not found in $thispth\n" if $verbose;
next;
}
- print STDOUT "'$thislib' found at $fullname\n" if $verbose;
+ warn "'$thislib' found at $fullname\n" if $verbose;
$found++;
$found_lib++;
push(@extralibs, $fullname);
last;
}
- print STDOUT "Note (probably harmless): "
+ warn "Note (probably harmless): "
."No library found for '$thislib'\n"
unless $found_lib>0;
}
return ('','','','') unless $found;
$lib = join(' ',@extralibs);
- print "Result: $lib\n" if $verbose;
+ warn "Result: $lib\n" if $verbose;
wantarray ? ($lib, '', $lib, '') : $lib;
}
@@ -275,7 +274,7 @@ sub _vms_ext {
'Xmu' => 'DECW$XMULIBSHR');
if ($Config{'vms_cc_type'} ne 'decc') { $libmap{'curses'} = 'VAXCCURSE'; }
- print STDOUT "Potential libraries are '$potential_libs'\n" if $verbose;
+ warn "Potential libraries are '$potential_libs'\n" if $verbose;
# First, sort out directories and library names in the input
foreach $lib (split ' ',$potential_libs) {
@@ -292,11 +291,11 @@ sub _vms_ext {
# path in a logical name.)
foreach $dir (@dirs) {
unless (-d $dir) {
- print STDOUT "Skipping nonexistent Directory $dir\n" if $verbose > 1;
+ warn "Skipping nonexistent Directory $dir\n" if $verbose > 1;
$dir = '';
next;
}
- print STDOUT "Resolving directory $dir\n" if $verbose;
+ warn "Resolving directory $dir\n" if $verbose;
if ($self->file_name_is_absolute($dir)) { $dir = $self->fixpath($dir,1); }
else { $dir = $self->catdir($cwd,$dir); }
}
@@ -321,24 +320,24 @@ sub _vms_ext {
push(@variants,"lib$lib") if $lib !~ /[:>\]]/;
}
push(@variants,$lib);
- print STDOUT "Looking for $lib\n" if $verbose;
+ warn "Looking for $lib\n" if $verbose;
foreach $variant (@variants) {
foreach $dir (@dirs) {
my($type);
$name = "$dir$variant";
- print "\tChecking $name\n" if $verbose > 2;
+ warn "\tChecking $name\n" if $verbose > 2;
if (-f ($test = VMS::Filespec::rmsexpand($name))) {
# It's got its own suffix, so we'll have to figure out the type
if ($test =~ /(?:$so|exe)$/i) { $type = 'sh'; }
elsif ($test =~ /(?:$lib_ext|olb)$/i) { $type = 'olb'; }
elsif ($test =~ /(?:$obj_ext|obj)$/i) {
- print STDOUT "Note (probably harmless): "
+ warn "Note (probably harmless): "
."Plain object file $test found in library list\n";
$type = 'obj';
}
else {
- print STDOUT "Note (probably harmless): "
+ warn "Note (probably harmless): "
."Unknown library type for $test; assuming shared\n";
$type = 'sh';
}
@@ -357,7 +356,7 @@ sub _vms_ext {
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')))) {
- print STDOUT "Note (probably harmless): "
+ warn "Note (probably harmless): "
."Plain object file $test found in library list\n";
$type = 'obj';
$name = $test unless $test =~ /obj;?\d*$/i;
@@ -370,11 +369,11 @@ sub _vms_ext {
if ($ctype) {
eval '$' . $ctype . "{'$cand'}++";
die "Error recording library: $@" if $@;
- print STDOUT "\tFound as $cand (really $test), type $ctype\n" if $verbose > 1;
+ warn "\tFound as $cand (really $test), type $ctype\n" if $verbose > 1;
next LIB;
}
}
- print STDOUT "Note (probably harmless): "
+ warn "Note (probably harmless): "
."No library found for $lib\n";
}
@@ -387,7 +386,7 @@ sub _vms_ext {
push(@libs, map { "$_/Library" } sort keys %olb);
push(@libs, map { "$_/Share" } sort keys %sh);
$lib = join(' ',@libs);
- print "Result: $lib\n" if $verbose;
+ warn "Result: $lib\n" if $verbose;
wantarray ? ($lib, '', $lib, '') : $lib;
}
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index 85b0c1bbe5..4f7a9e8137 100644
--- a/lib/ExtUtils/MM_Unix.pm
+++ b/lib/ExtUtils/MM_Unix.pm
@@ -1127,7 +1127,12 @@ sub fixin { # stolen from the pink Camel book, more or less
# Now look (in reverse) for interpreter in absolute PATH (unless perl).
if ($cmd eq "perl") {
- $interpreter = $Config{perlpath};
+ if ($Config{startperl} =~ m,^\#!.*/perl,) {
+ $interpreter = $Config{startperl};
+ $interpreter =~ s,^\#!,,;
+ } else {
+ $interpreter = $Config{perlpath};
+ }
} else {
my(@absdirs) = reverse grep {$self->file_name_is_absolute} $self->path;
$interpreter = '';
@@ -2935,11 +2940,13 @@ sub test {
if (!$tests && -d 't') {
$tests = $Is_Win32 ? join(' ', <t\\*.t>) : 't/*.t';
}
+ # note: 'test.pl' name is also hardcoded in init_dirscan()
my(@m);
push(@m,"
TEST_VERBOSE=0
TEST_TYPE=test_\$(LINKTYPE)
TEST_FILE = test.pl
+TEST_FILES = $tests
TESTDB_SW = -d
testdb :: testdb_\$(LINKTYPE)
@@ -2953,8 +2960,8 @@ test :: \$(TEST_TYPE)
push(@m, "\n");
push(@m, "test_dynamic :: pure_all\n");
- push(@m, $self->test_via_harness('$(FULLPERL)', $tests)) if $tests;
- push(@m, $self->test_via_script('$(FULLPERL)', 'test.pl')) if -f "test.pl";
+ push(@m, $self->test_via_harness('$(FULLPERL)', '$(TEST_FILES)')) if $tests;
+ push(@m, $self->test_via_script('$(FULLPERL)', '$(TEST_FILE)')) if -f "test.pl";
push(@m, "\n");
push(@m, "testdb_dynamic :: pure_all\n");
@@ -2966,8 +2973,8 @@ test :: \$(TEST_TYPE)
if ($self->needs_linking()) {
push(@m, "test_static :: pure_all \$(MAP_TARGET)\n");
- push(@m, $self->test_via_harness('./$(MAP_TARGET)', $tests)) if $tests;
- push(@m, $self->test_via_script('./$(MAP_TARGET)', 'test.pl')) if -f "test.pl";
+ push(@m, $self->test_via_harness('./$(MAP_TARGET)', '$(TEST_FILES)')) if $tests;
+ push(@m, $self->test_via_script('./$(MAP_TARGET)', '$(TEST_FILE)')) if -f "test.pl";
push(@m, "\n");
push(@m, "testdb_static :: pure_all \$(MAP_TARGET)\n");
push(@m, $self->test_via_script('./$(MAP_TARGET) $(TESTDB_SW)', '$(TEST_FILE)'));
diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp
index ac1378dce2..04de166ad6 100755
--- a/lib/ExtUtils/xsubpp
+++ b/lib/ExtUtils/xsubpp
@@ -87,7 +87,7 @@ sub Q ;
# Global Constants
-$XSUBPP_version = "1.9504";
+$XSUBPP_version = "1.9505";
my ($Is_VMS, $SymSet);
if ($^O eq 'VMS') {
@@ -294,7 +294,7 @@ sub print_section {
do { $_ = shift(@line) } while !/\S/ && @line;
print("#line ", $line_no[@line_no - @line -1], " \"$filename\"\n")
- if $WantLineNumbers && !/^\s*#\s*line\b/;
+ if $WantLineNumbers && !/^\s*#\s*line\b/ && !/^#if XSubPPtmp/;
for (; defined($_) && !/^$BLOCK_re/o; $_ = shift(@line)) {
print "$_\n";
}