summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/ExtUtils/MM_Unix.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-04-26 22:16:26 +0000
committerKarl Berry <karl@freefriends.org>2015-04-26 22:16:26 +0000
commit342e672574c4e67d510e46ab6acd0e21a7d0cf54 (patch)
tree79e04202d08c0404bbd780bd26c1e34710e539b6 /Master/tlpkg/tlperl/lib/ExtUtils/MM_Unix.pm
parentbe2706af7c57a0ef0f4d4e9f684ca4ef74922a82 (diff)
(tl)perl 5.20.2 for windows, from siep
git-svn-id: svn://tug.org/texlive/trunk@37064 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/ExtUtils/MM_Unix.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/ExtUtils/MM_Unix.pm345
1 files changed, 220 insertions, 125 deletions
diff --git a/Master/tlpkg/tlperl/lib/ExtUtils/MM_Unix.pm b/Master/tlpkg/tlperl/lib/ExtUtils/MM_Unix.pm
index 1629b273699..4140432bc8a 100644
--- a/Master/tlpkg/tlperl/lib/ExtUtils/MM_Unix.pm
+++ b/Master/tlpkg/tlperl/lib/ExtUtils/MM_Unix.pm
@@ -15,14 +15,14 @@ use ExtUtils::MakeMaker qw($Verbose neatvalue);
# If we make $VERSION an our variable parse_version() breaks
use vars qw($VERSION);
-$VERSION = '6.66';
+$VERSION = '6.98';
$VERSION = eval $VERSION; ## no critic [BuiltinFunctions::ProhibitStringyEval]
require ExtUtils::MM_Any;
our @ISA = qw(ExtUtils::MM_Any);
my %Is;
-BEGIN {
+BEGIN {
$Is{OS2} = $^O eq 'os2';
$Is{Win32} = $^O eq 'MSWin32' || $Config{osname} eq 'NetWare';
$Is{Dos} = $^O eq 'dos';
@@ -37,6 +37,7 @@ BEGIN {
$Is{BSD} = ($^O =~ /^(?:free|net|open)bsd$/ or
grep( $^O eq $_, qw(bsdos interix dragonfly) )
);
+ $Is{Android} = $^O =~ /android/;
}
BEGIN {
@@ -129,10 +130,10 @@ sub c_o {
my($self) = shift;
return '' unless $self->needs_linking();
my(@m);
-
+
my $command = '$(CCCMD)';
my $flags = '$(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE)';
-
+
if (my $cpp = $Config{cpprun}) {
my $cpp_cmd = $self->const_cccmd;
$cpp_cmd =~ s/^CCCMD\s*=\s*\$\(CC\)/$cpp/;
@@ -372,7 +373,7 @@ sub constants {
for my $macro (qw(
AR_STATIC_ARGS DIRFILESEP DFSEP
- NAME NAME_SYM
+ NAME NAME_SYM
VERSION VERSION_MACRO VERSION_SYM DEFINE_VERSION
XS_VERSION XS_VERSION_MACRO XS_DEFINE_VERSION
INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB
@@ -385,18 +386,18 @@ sub constants {
"DESTINSTALL".$_)
} $self->installvars),
qw(
- PERL_LIB
+ PERL_LIB
PERL_ARCHLIB
LIBPERL_A MYEXTLIB
- FIRST_MAKEFILE MAKEFILE_OLD MAKE_APERL_FILE
- PERLMAINCC PERL_SRC PERL_INC
+ FIRST_MAKEFILE MAKEFILE_OLD MAKE_APERL_FILE
+ PERLMAINCC PERL_SRC PERL_INC
PERL FULLPERL ABSPERL
PERLRUN FULLPERLRUN ABSPERLRUN
PERLRUNINST FULLPERLRUNINST ABSPERLRUNINST
PERL_CORE
PERM_DIR PERM_RW PERM_RWX
- ) )
+ ) )
{
next unless defined $self->{$macro};
@@ -423,7 +424,7 @@ MM_REVISION = $self->{MM_REVISION}
MAKE
FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT
LDFROM LINKTYPE BOOTDEP
- / )
+ / )
{
next unless defined $self->{$macro};
push @m, "$macro = $self->{$macro}\n";
@@ -443,7 +444,7 @@ MAN3PODS = ".$self->wraplist(sort keys %{$self->{MAN3PODS}})."
push @m, q{
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h
-};
+} if -e File::Spec->catfile( $self->{PERL_INC}, 'config.h' );
push @m, qq{
@@ -471,7 +472,7 @@ PERL_ARCHIVE_AFTER = $self->{PERL_ARCHIVE_AFTER}
TO_INST_PM = ".$self->wraplist(sort keys %{$self->{PM}})."
-PM_TO_BLIB = ".$self->wraplist(%{$self->{PM}})."
+PM_TO_BLIB = ".$self->wraplist(map { ($_ => $self->{PM}->{$_}) } sort keys %{$self->{PM}})."
";
join('',@m);
@@ -533,18 +534,18 @@ Defines a lot of macros for distribution support.
COMPRESS compression command to gzip --best
use for tarfiles
- SUFFIX suffix to put on .gz
+ SUFFIX suffix to put on .gz
compressed files
SHAR shar command to use shar
PREOP extra commands to run before
- making the archive
+ making the archive
POSTOP extra commands to run after
making the archive
TO_UNIX a command to convert linefeeds
- to Unix style in your archive
+ to Unix style in your archive
CI command to checkin your ci -u
sources to version control
@@ -583,7 +584,6 @@ sub init_dist {
($self->{DISTNAME} = $self->{NAME}) =~ s{::}{-}g unless $self->{DISTNAME};
$self->{DISTVNAME} ||= $self->{DISTNAME}.'-'.$self->{VERSION};
-
}
=item dist (o)
@@ -601,7 +601,10 @@ sub dist {
my($self, %attribs) = @_;
my $make = '';
- foreach my $key (qw(
+ if ( $attribs{SUFFIX} && $attribs{SUFFIX} !~ m!^\.! ) {
+ $attribs{SUFFIX} = '.' . $attribs{SUFFIX};
+ }
+ foreach my $key (qw(
TAR TARFLAGS ZIP ZIPFLAGS COMPRESS SUFFIX SHAR
PREOP POSTOP TO_UNIX
CI RCS_LABEL DIST_CP DIST_DEFAULT
@@ -638,7 +641,7 @@ manifest :
$(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest
veryclean : realclean
- $(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old
+ $(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old
MAKE_FRAG
@@ -674,7 +677,7 @@ sub dist_core {
my($self) = shift;
my $make_frag = '';
- foreach my $target (qw(dist tardist uutardist tarfile zipdist zipfile
+ foreach my $target (qw(dist tardist uutardist tarfile zipdist zipfile
shdist))
{
my $method = $target.'_target';
@@ -768,6 +771,7 @@ $(DISTVNAME).tar$(SUFFIX) : distdir
$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(COMPRESS) $(DISTVNAME).tar
+ $(NOECHO) $(ECHO) 'Created $(DISTVNAME).tar$(SUFFIX)'
$(POSTOP)
MAKE_FRAG
}
@@ -790,6 +794,7 @@ $(DISTVNAME).zip : distdir
$(PREOP)
$(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
+ $(NOECHO) $(ECHO) 'Created $(DISTVNAME).zip'
$(POSTOP)
MAKE_FRAG
}
@@ -808,6 +813,7 @@ sub uutardist_target {
return <<'MAKE_FRAG';
uutardist : $(DISTVNAME).tar$(SUFFIX)
uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu
+ $(NOECHO) $(ECHO) 'Created $(DISTVNAME).tar$(SUFFIX)_uu'
MAKE_FRAG
}
@@ -828,6 +834,7 @@ shdist : distdir
$(PREOP)
$(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
$(RM_RF) $(DISTVNAME)
+ $(NOECHO) $(ECHO) 'Created $(DISTVNAME).shar'
$(POSTOP)
MAKE_FRAG
}
@@ -860,7 +867,7 @@ BOOTSTRAP =
my $target = $Is{VMS} ? '$(MMS$TARGET)' : '$@';
- return sprintf <<'MAKE_FRAG', ($target) x 5;
+ return sprintf <<'MAKE_FRAG', ($target) x 2;
BOOTSTRAP = $(BASEEXT).bs
# As Mkbootstrap might not write a file (if none is required)
@@ -873,11 +880,6 @@ $(BOOTSTRAP) : $(FIRST_MAKEFILE) $(BOOTDEP) $(INST_ARCHAUTODIR)$(DFSEP).exists
-e "Mkbootstrap('$(BASEEXT)','$(BSLOADLIBS)');"
$(NOECHO) $(TOUCH) %s
$(CHMOD) $(PERM_RW) %s
-
-$(INST_BOOT) : $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).exists
- $(NOECHO) $(RM_RF) %s
- - $(CP) $(BOOTSTRAP) %s
- $(CHMOD) $(PERM_RW) %s
MAKE_FRAG
}
@@ -909,7 +911,7 @@ OTHERLDFLAGS = '.$ld_opt.$otherldflags.'
INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
INST_DYNAMIC_FIX = '.$ld_fix.'
-$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
+$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
');
if ($armaybe ne ':'){
$ldfrom = 'tmp$(LIB_EXT)';
@@ -919,7 +921,7 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).
$ldfrom = "-all $ldfrom -none" if $Is{OSF};
# The IRIX linker doesn't use LD_RUN_PATH
- my $ldrun = $Is{IRIX} && $self->{LD_RUN_PATH} ?
+ my $ldrun = $Is{IRIX} && $self->{LD_RUN_PATH} ?
qq{-rpath "$self->{LD_RUN_PATH}"} : '';
# For example in AIX the shared objects/libraries from previous builds
@@ -932,7 +934,7 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).
my $libs = '$(LDLOADLIBS)';
- if (($Is{NetBSD} || $Is{Interix}) && $Config{'useshrplib'} eq 'true') {
+ if (($Is{NetBSD} || $Is{Interix} || $Is{Android}) && $Config{'useshrplib'} eq 'true') {
# Use nothing on static perl platforms, and to the flags needed
# to link against the shared libperl library on shared perl
# platforms. We peek at lddlflags to see if we need -Wl,-R
@@ -941,6 +943,10 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).
$libs .= ' -L$(PERL_INC) -Wl,-R$(INSTALLARCHLIB)/CORE -Wl,-R$(PERL_ARCHLIB)/CORE -lperl';
} elsif ($Config{'lddlflags'} =~ /-R/) {
$libs .= ' -L$(PERL_INC) -R$(INSTALLARCHLIB)/CORE -R$(PERL_ARCHLIB)/CORE -lperl';
+ } elsif ( $Is{Android} ) {
+ # The Android linker will not recognize symbols from
+ # libperl unless the module explicitly depends on it.
+ $libs .= ' -L$(PERL_INC) -lperl';
}
}
@@ -957,6 +963,8 @@ MAKE
push @m, <<'MAKE';
$(CHMOD) $(PERM_RWX) $@
+ $(NOECHO) $(RM_RF) $(BOOTSTRAP)
+ - $(CP_NONEMPTY) $(BOOTSTRAP) $(INST_BOOT) $(PERM_RW)
MAKE
return join('',@m);
@@ -1025,7 +1033,7 @@ WARNING
my ($abs, $val);
if ($self->file_name_is_absolute($name)) { # /foo/bar
$abs = $name;
- } elsif ($self->canonpath($name) eq
+ } elsif ($self->canonpath($name) eq
$self->canonpath(basename($name))) { # foo
$abs = $self->catfile($dir, $name);
} else { # foo/bar
@@ -1036,8 +1044,6 @@ WARNING
print "Executing $abs\n" if ($trace >= 2);
my $version_check = qq{$abs -le "require $ver; print qq{VER_OK}"};
- $version_check = "$Config{run} $version_check"
- if defined $Config{run} and length $Config{run};
# To avoid using the unportable 2>&1 to suppress STDERR,
# we close it before running the command.
@@ -1087,7 +1093,7 @@ sub fixin { # stolen from the pink Camel book, more or less
open( my $fixin, '<', $file ) or croak "Can't process '$file': $!";
local $/ = "\n";
chomp( my $line = <$fixin> );
- next unless $line =~ s/^\s*\#!\s*//; # Not a shbang file.
+ next unless $line =~ s/^\s*\#!\s*//; # Not a shebang file.
my $shb = $self->_fixin_replace_shebang( $file, $line );
next unless defined $shb;
@@ -1162,7 +1168,7 @@ sub _fixin_replace_shebang {
my (@absdirs)
= reverse grep { $self->file_name_is_absolute($_) } $self->path;
$interpreter = '';
-
+
foreach my $dir (@absdirs) {
if ( $self->maybe_command($cmd) ) {
warn "Ignoring $interpreter in $file\n"
@@ -1173,7 +1179,7 @@ sub _fixin_replace_shebang {
}
# Figure out how to invoke interpreter on this machine.
-
+
my ($does_shbang) = $Config{'sharpbang'} =~ /^\s*\#\!/;
my ($shb) = "";
if ($interpreter) {
@@ -1263,7 +1269,7 @@ Called by init_main.
sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
my($self) = @_;
- my(%dir, %xs, %c, %h, %pl_files, %pm);
+ my(%dir, %xs, %c, %o, %h, %pl_files, %pm);
my %ignore = map {( $_ => 1 )} qw(Makefile.PL Build.PL test.pl t);
@@ -1271,10 +1277,21 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
$Is{VMS} ? $ignore{"$self->{DISTVNAME}.dir"} = 1
: $ignore{$self->{DISTVNAME}} = 1;
+ my $distprefix = $Is{VMS} ? qr/^\Q$self->{DISTNAME}\E-v?[\d\.]+\.dir$/i
+ : qr/^\Q$self->{DISTNAME}\E-v?[\d\.]+$/;
+
@ignore{map lc, keys %ignore} = values %ignore if $Is{VMS};
+ if ( defined $self->{XS} and !defined $self->{C} ) {
+ my @c_files = grep { m/\.c(pp|xx)?\z/i } values %{$self->{XS}};
+ my @o_files = grep { m/(?:.(?:o(?:bj)?)|\$\(OBJ_EXT\))\z/i } values %{$self->{XS}};
+ %c = map { $_ => 1 } @c_files;
+ %o = map { $_ => 1 } @o_files;
+ }
+
foreach my $name ($self->lsdir($Curdir)){
next if $name =~ /\#/;
+ next if $name =~ $distprefix && -d $name;
$name = lc($name) if $Is{VMS};
next if $name eq $Curdir or $name eq $Updir or $ignore{$name};
next unless $self->libscan($name);
@@ -1301,7 +1318,7 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
($pl_files{$name} = $name) =~ s/[._]pl\z//i ;
}
else {
- $pm{$name} = $self->catfile($self->{INST_LIBDIR},$name);
+ $pm{$name} = $self->catfile($self->{INST_LIBDIR},$name);
}
} elsif ($name =~ /\.(p[ml]|pod)\z/){
$pm{$name} = $self->catfile($self->{INST_LIBDIR},$name);
@@ -1316,7 +1333,8 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
$self->{PM} ||= \%pm;
my @o_files = @{$self->{C}};
- $self->{O_FILES} = [grep s/\.c(pp|xx|c)?\z/$self->{OBJ_EXT}/i, @o_files];
+ %o = (%o, map { $_ => 1 } grep s/\.c(pp|xx|c)?\z/$self->{OBJ_EXT}/i, @o_files);
+ $self->{O_FILES} = [sort keys %o];
}
@@ -1380,7 +1398,7 @@ sub init_MAN1PODS {
next unless $self->_has_pod($name);
$self->{MAN1PODS}->{$name} =
- $self->catfile("\$(INST_MAN1DIR)",
+ $self->catfile("\$(INST_MAN1DIR)",
basename($name).".\$(MAN1EXT)");
}
}
@@ -1412,7 +1430,7 @@ sub init_MAN3PODS {
my $parentlibs_re = join '|', @{$self->{PMLIBPARENTDIRS}};
# Remove "Configure.pm" and similar, if it's not the only pod listed
- # To force inclusion, just name it "Configure.pod", or override
+ # To force inclusion, just name it "Configure.pod", or override
# MAN3PODS
foreach my $name (keys %manifypods) {
if ($self->{PERL_CORE} and $name =~ /(config|setup).*\.pm/is) {
@@ -1517,7 +1535,7 @@ sub init_PM {
my $striplibpath;
my $parentlibs_re = join '|', @{$self->{PMLIBPARENTDIRS}};
- $prefix = $self->{INST_LIB}
+ $prefix = $self->{INST_LIB}
if ($striplibpath = $path) =~ s{^(\W*)($parentlibs_re)\W}
{$1}i;
@@ -1543,7 +1561,7 @@ sub init_DIRFILESEP {
$self->{DIRFILESEP} = '/';
}
-
+
=item init_main
@@ -1579,6 +1597,8 @@ sub init_main {
# Some systems have restrictions on files names for DLL's etc.
# mod2fname returns appropriate file base name (typically truncated)
# It may also edit @modparts if required.
+ # We require DynaLoader to make sure that mod2fname is loaded
+ eval { require DynaLoader };
if (defined &DynaLoader::mod2fname) {
$modfname = &DynaLoader::mod2fname(\@modparts);
}
@@ -1620,18 +1640,9 @@ sub init_main {
if ($self->{PERL_SRC}){
$self->{PERL_LIB} ||= $self->catdir("$self->{PERL_SRC}","lib");
- if (defined $Cross::platform) {
- $self->{PERL_ARCHLIB} =
- $self->catdir("$self->{PERL_SRC}","xlib",$Cross::platform);
- $self->{PERL_INC} =
- $self->catdir("$self->{PERL_SRC}","xlib",$Cross::platform,
- $Is{Win32}?("CORE"):());
- }
- else {
- $self->{PERL_ARCHLIB} = $self->{PERL_LIB};
- $self->{PERL_INC} = ($Is{Win32}) ?
- $self->catdir($self->{PERL_LIB},"CORE") : $self->{PERL_SRC};
- }
+ $self->{PERL_ARCHLIB} = $self->{PERL_LIB};
+ $self->{PERL_INC} = ($Is{Win32}) ?
+ $self->catdir($self->{PERL_LIB},"CORE") : $self->{PERL_SRC};
# catch a situation that has occurred a few times in the past:
unless (
@@ -1688,7 +1699,18 @@ from the perl source tree.
EOP
}
}
- }
+ }
+ }
+
+ if ($Is{Android}) {
+ # Android fun times!
+ # ../../perl -I../../lib -MFile::Glob -e1 works
+ # ../../../perl -I../../../lib -MFile::Glob -e1 fails to find
+ # the .so for File::Glob.
+ # This always affects core perl, but may also affect an installed
+ # perl built with -Duserelocatableinc.
+ $self->{PERL_LIB} = File::Spec->rel2abs($self->{PERL_LIB});
+ $self->{PERL_ARCHLIB} = File::Spec->rel2abs($self->{PERL_ARCHLIB});
}
# We get SITELIBEXP and SITEARCHEXP directly via
@@ -1755,6 +1777,7 @@ sub init_tools {
$self->{RM_RF} ||= "rm -rf";
$self->{TOUCH} ||= "touch";
$self->{TEST_F} ||= "test -f";
+ $self->{TEST_S} ||= "test -s";
$self->{CP} ||= "cp";
$self->{MV} ||= "mv";
$self->{CHMOD} ||= "chmod";
@@ -1806,7 +1829,7 @@ sub init_lib2arch {
# architecture. If not we take it as a sign that it should be the
# same as the requested installation directory. Otherwise we take
# the found one.
- for my $libpair ({l=>"privlib", a=>"archlib"},
+ for my $libpair ({l=>"privlib", a=>"archlib"},
{l=>"sitelib", a=>"sitearch"},
{l=>"vendorlib", a=>"vendorarch"},
)
@@ -1820,7 +1843,7 @@ sub init_lib2arch {
$self->prefixify($Arch,$ilib,$self->{$Lib});
unless (-d $self->{$Arch}) {
- print "Directory $self->{$Arch} not found\n"
+ print "Directory $self->{$Arch} not found\n"
if $Verbose;
$self->{$Arch} = $self->{$Lib};
}
@@ -1854,15 +1877,15 @@ sub init_PERL {
my($self) = shift;
my @defpath = ();
- foreach my $component ($self->{PERL_SRC}, $self->path(),
- $Config{binexp})
+ foreach my $component ($self->{PERL_SRC}, $self->path(),
+ $Config{binexp})
{
push @defpath, $component if defined $component;
}
# Build up a set of file names (not command names).
my $thisperl = $self->canonpath($^X);
- $thisperl .= $Config{exe_ext} unless
+ $thisperl .= $Config{exe_ext} unless
# VMS might have a file version # at the end
$Is{VMS} ? $thisperl =~ m/$Config{exe_ext}(;\d+)?$/i
: $thisperl =~ m/$Config{exe_ext}$/i;
@@ -1872,9 +1895,9 @@ sub init_PERL {
my @perls = ($thisperl);
push @perls, map { "$_$Config{exe_ext}" }
- ('perl', 'perl5', "perl$Config{version}");
+ ("perl$Config{version}", 'perl5', 'perl');
- # miniperl has priority over all but the cannonical perl when in the
+ # miniperl has priority over all but the canonical perl when in the
# core. Otherwise its a last resort.
my $miniperl = "miniperl$Config{exe_ext}";
if( $self->{PERL_CORE} ) {
@@ -1891,13 +1914,13 @@ sub init_PERL {
# When built for debugging, VMS doesn't create perl.exe but ndbgperl.exe.
my $perl_name = 'perl';
- $perl_name = 'ndbgperl' if $Is{VMS} &&
+ $perl_name = 'ndbgperl' if $Is{VMS} &&
defined $Config{usevmsdebug} && $Config{usevmsdebug} eq 'define';
# XXX This logic is flawed. If "miniperl" is anywhere in the path
# it will get confused. It should be fixed to work only on the filename.
# Define 'FULLPERL' to be a non-miniperl (used in test: target)
- ($self->{FULLPERL} = $self->{PERL}) =~ s/miniperl/$perl_name/i
+ ($self->{FULLPERL} = $self->{PERL}) =~ s/\Q$miniperl\E$/$perl_name$Config{exe_ext}/i
unless $self->{FULLPERL};
# Little hack to get around VMS's find_perl putting "MCR" in front
@@ -1928,10 +1951,10 @@ sub init_PERL {
$self->{$run} = "\$($perl)";
# Make sure perl can find itself before it's installed.
- $self->{$run} .= q{ "-I$(PERL_LIB)" "-I$(PERL_ARCHLIB)"}
+ $self->{$run} .= q{ "-I$(PERL_LIB)" "-I$(PERL_ARCHLIB)"}
if $self->{UNINSTALLED_PERL} || $self->{PERL_CORE};
- $self->{$perl.'RUNINST'} =
+ $self->{$perl.'RUNINST'} =
sprintf q{$(%sRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"}, $perl;
}
@@ -2003,18 +2026,18 @@ sub init_xs {
my $self = shift;
if ($self->has_link_code()) {
- $self->{INST_STATIC} =
+ $self->{INST_STATIC} =
$self->catfile('$(INST_ARCHAUTODIR)', '$(BASEEXT)$(LIB_EXT)');
- $self->{INST_DYNAMIC} =
+ $self->{INST_DYNAMIC} =
$self->catfile('$(INST_ARCHAUTODIR)', '$(DLBASE).$(DLEXT)');
- $self->{INST_BOOT} =
+ $self->{INST_BOOT} =
$self->catfile('$(INST_ARCHAUTODIR)', '$(BASEEXT).bs');
} else {
$self->{INST_STATIC} = '';
$self->{INST_DYNAMIC} = '';
$self->{INST_BOOT} = '';
}
-}
+}
=item install (o)
@@ -2053,9 +2076,15 @@ doc__install : doc_site_install
pure_perl_install :: all
$(NOECHO) $(MOD_INSTALL) \
- read }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
+};
+
+ push @m,
+q{ read }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
write }.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
- $(INST_LIB) $(DESTINSTALLPRIVLIB) \
+} unless $self->{NO_PACKLIST};
+
+ push @m,
+q{ $(INST_LIB) $(DESTINSTALLPRIVLIB) \
$(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \
$(INST_BIN) $(DESTINSTALLBIN) \
$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
@@ -2067,9 +2096,14 @@ pure_perl_install :: all
pure_site_install :: all
$(NOECHO) $(MOD_INSTALL) \
- read }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
+};
+ push @m,
+q{ read }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
write }.$self->catfile('$(DESTINSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{ \
- $(INST_LIB) $(DESTINSTALLSITELIB) \
+} unless $self->{NO_PACKLIST};
+
+ push @m,
+q{ $(INST_LIB) $(DESTINSTALLSITELIB) \
$(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \
$(INST_BIN) $(DESTINSTALLSITEBIN) \
$(INST_SCRIPT) $(DESTINSTALLSITESCRIPT) \
@@ -2080,15 +2114,35 @@ pure_site_install :: all
pure_vendor_install :: all
$(NOECHO) $(MOD_INSTALL) \
- read }.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
+};
+ push @m,
+q{ read }.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
write }.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{ \
- $(INST_LIB) $(DESTINSTALLVENDORLIB) \
+} unless $self->{NO_PACKLIST};
+
+ push @m,
+q{ $(INST_LIB) $(DESTINSTALLVENDORLIB) \
$(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \
$(INST_BIN) $(DESTINSTALLVENDORBIN) \
$(INST_SCRIPT) $(DESTINSTALLVENDORSCRIPT) \
$(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \
$(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR)
+};
+
+ push @m, q{
+doc_perl_install :: all
+ $(NOECHO) $(NOOP)
+
+doc_site_install :: all
+ $(NOECHO) $(NOOP)
+
+doc_vendor_install :: all
+ $(NOECHO) $(NOOP)
+
+} if $self->{NO_PERLLOCAL};
+
+ push @m, q{
doc_perl_install :: all
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
@@ -2122,7 +2176,7 @@ doc_vendor_install :: all
EXE_FILES "$(EXE_FILES)" \
>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
-};
+} unless $self->{NO_PERLLOCAL};
push @m, q{
uninstall :: uninstall_from_$(INSTALLDIRS)dirs
@@ -2332,7 +2386,7 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib
# Skip perl's libraries.
return if m/^libperl/ or m/^perl\Q$self->{LIB_EXT}\E$/;
- # Skip purified versions of libraries
+ # Skip purified versions of libraries
# (e.g., DynaLoader_pure_p1_c0_032.a)
return if m/_pure_\w+_\w+_\w+\.\w+$/ and -f "$File::Find::dir/.pure";
@@ -2367,7 +2421,7 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib
# don't include the installed version of this extension. I
# leave this line here, although it is not necessary anymore:
# I patched minimod.PL instead, so that Miniperl.pm won't
- # enclude duplicates
+ # include duplicates
# Once the patch to minimod.PL is in the distribution, I can
# drop it
@@ -2518,8 +2572,12 @@ $(OBJECT) : $(FIRST_MAKEFILE)
my $newer_than_target = $Is{VMS} ? '$(MMS$SOURCE_LIST)' : '$?';
my $mpl_args = join " ", map qq["$_"], @ARGV;
-
- $m .= sprintf <<'MAKE_FRAG', $newer_than_target, $mpl_args;
+ my $cross = '';
+ if (defined $::Cross::platform) {
+ # Inherited from win32/buildext.pl
+ $cross = "-MCross=$::Cross::platform ";
+ }
+ $m .= sprintf <<'MAKE_FRAG', $newer_than_target, $cross, $mpl_args;
# We take a very conservative approach here, but it's worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
@@ -2528,7 +2586,7 @@ $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
-$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
-$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD)
- $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL)
- $(PERLRUN) Makefile.PL %s
+ $(PERLRUN) %sMakefile.PL %s
$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
$(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <=="
$(FALSE)
@@ -2563,7 +2621,7 @@ sub needs_linking {
my($self) = shift;
my $caller = (caller(0))[3];
- confess("needs_linking called too early") if
+ confess("needs_linking called too early") if
$caller =~ /^ExtUtils::MakeMaker::/;
return $self->{NEEDS_LINKING} if defined $self->{NEEDS_LINKING};
if ($self->has_link_code or $self->{MAKEAPERL}){
@@ -2599,9 +2657,15 @@ sub parse_abstract {
$inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod;
next if !$inpod;
chop;
- next unless /^($package(?:\.pm)? \s+ -+ \s+)(.*)/x;
- $result = $2;
- last;
+ if ( /^($package(?:\.pm)? \s+ -+ \s+)(.*)/x ) {
+ $result = $2;
+ next;
+ }
+ next unless $result;
+ if ( $result && ( /^\s*$/ || /^\=/ ) ) {
+ last;
+ }
+ $result = join ' ', $result, $_;
}
close $fh;
@@ -2645,29 +2709,8 @@ sub parse_version {
local $^W = 0;
$result = $1;
}
- elsif ( m{(?<!\\) ([\$*]) (([\w\:\']*) \bVERSION)\b .* =}x ) {
- my $eval = qq{
- package ExtUtils::MakeMaker::_version;
- no strict;
- BEGIN { eval {
- # Ensure any version() routine which might have leaked
- # into this package has been deleted. Interferes with
- # version->import()
- undef *version;
- require version;
- "version"->import;
- } }
-
- local $1$2;
- \$$2=undef;
- do {
- $_
- };
- \$$2;
- };
- local $^W = 0;
- $result = eval($eval); ## no critic
- warn "Could not eval '$eval' in $parsefile: $@" if $@;
+ elsif ( m{(?<!\\) ([\$*]) (([\w\:\']*) \bVERSION)\b .* (?<![<>=!])\=[^=]}x ) {
+ $result = $self->get_version($parsefile, $1, $2);
}
else {
next;
@@ -2676,10 +2719,44 @@ sub parse_version {
}
close $fh;
+ if ( defined $result && $result !~ /^v?[\d_\.]+$/ ) {
+ require version;
+ my $normal = eval { version->parse( $result ) };
+ $result = $normal if defined $normal;
+ }
$result = "undef" unless defined $result;
return $result;
}
+sub get_version
+{
+ my ($self, $parsefile, $sigil, $name) = @_;
+ my $eval = qq{
+ package ExtUtils::MakeMaker::_version;
+ no strict;
+ BEGIN { eval {
+ # Ensure any version() routine which might have leaked
+ # into this package has been deleted. Interferes with
+ # version->import()
+ undef *version;
+ require version;
+ "version"->import;
+ } }
+
+ local $sigil$name;
+ \$$name=undef;
+ do {
+ $_
+ };
+ \$$name;
+ };
+ $eval = $1 if $eval =~ m{^(.+)}s;
+ local $^W = 0;
+ my $result = eval($eval); ## no critic
+ warn "Could not eval '$eval' in $parsefile: $@" if $@;
+ $result;
+}
+
=item pasthru (o)
@@ -2698,7 +2775,7 @@ sub pasthru {
foreach my $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE
PREFIX INSTALL_BASE)
- )
+ )
{
next unless defined $self->{$key};
push @pasthru, "$key=\"\$($key)\"";
@@ -2785,7 +2862,8 @@ pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM)
pm_to_blib({\@ARGV}, '$autodir', q[\$(PM_FILTER)], '\$(PERM_DIR)')
CODE
- my @cmds = $self->split_command($pm_to_blib, %{$self->{PM}});
+ my @cmds = $self->split_command($pm_to_blib,
+ map { ($_, $self->{PM}->{$_}) } sort keys %{$self->{PM}});
$r .= join '', map { "\t\$(NOECHO) $_\n" } @cmds;
$r .= qq{\t\$(NOECHO) \$(TOUCH) pm_to_blib\n};
@@ -2907,11 +2985,22 @@ PPD_OUT
$self->{PPM_INSTALL_EXEC}, $self->{PPM_INSTALL_SCRIPT};
}
else {
- $ppd_xml .= sprintf qq{ <INSTALL>%s</INSTALL>\n},
+ $ppd_xml .= sprintf qq{ <INSTALL>%s</INSTALL>\n},
$self->{PPM_INSTALL_SCRIPT};
}
}
+ if ($self->{PPM_UNINSTALL_SCRIPT}) {
+ if ($self->{PPM_UNINSTALL_EXEC}) {
+ $ppd_xml .= sprintf qq{ <UNINSTALL EXEC="%s">%s</UNINSTALL>\n},
+ $self->{PPM_UNINSTALL_EXEC}, $self->{PPM_UNINSTALL_SCRIPT};
+ }
+ else {
+ $ppd_xml .= sprintf qq{ <UNINSTALL>%s</UNINSTALL>\n},
+ $self->{PPM_UNINSTALL_SCRIPT};
+ }
+ }
+
my ($bin_location) = $self->{BINARY_LOCATION} || '';
$bin_location =~ s/\\/\\\\/g;
@@ -2936,7 +3025,7 @@ PPD_OUT
$MM->prefixify($var, $prefix, $new_prefix, $default);
Using either $MM->{uc $var} || $Config{lc $var}, it will attempt to
-replace it's $prefix with a $new_prefix.
+replace it's $prefix with a $new_prefix.
Should the $prefix fail to match I<AND> a PREFIX was given as an
argument to WriteMakefile() it will set it to the $new_prefix +
@@ -2960,7 +3049,7 @@ simply use '/home/foo/man/man1'.
sub prefixify {
my($self,$var,$sprefix,$rprefix,$default) = @_;
- my $path = $self->{uc $var} ||
+ my $path = $self->{uc $var} ||
$Config_Override{lc $var} || $Config{lc $var} || '';
$rprefix .= '/' if $sprefix =~ m|/$|;
@@ -2969,7 +3058,7 @@ sub prefixify {
warn " from $sprefix to $rprefix\n" if $Verbose >= 2;
if( $self->{ARGS}{PREFIX} &&
- $path !~ s{^\Q$sprefix\E\b}{$rprefix}s )
+ $path !~ s{^\Q$sprefix\E\b}{$rprefix}s )
{
warn " cannot prefix, using default.\n" if $Verbose >= 2;
@@ -3103,7 +3192,7 @@ sub oneliner {
$switches = join ' ', @$switches;
- return qq{\$(ABSPERLRUN) $switches -e $cmd --};
+ return qq{\$(ABSPERLRUN) $switches -e $cmd --};
}
@@ -3201,10 +3290,10 @@ END
$(CP) $(MYEXTLIB) $@
MAKE_FRAG
- my $ar;
+ my $ar;
if (exists $self->{FULL_AR} && -x $self->{FULL_AR}) {
# Prefer the absolute pathed ar if available so that PATH
- # doesn't confuse us. Perl itself is built with the full_ar.
+ # doesn't confuse us. Perl itself is built with the full_ar.
$ar = 'FULL_AR';
} else {
$ar = 'AR';
@@ -3274,7 +3363,7 @@ Helper subroutine for subdirs
sub subdir_x {
my($self, $subdir) = @_;
- my $subdir_cmd = $self->cd($subdir,
+ my $subdir_cmd = $self->cd($subdir,
'$(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all $(PASTHRU)'
);
return sprintf <<'EOT', $subdir_cmd;
@@ -3325,7 +3414,10 @@ sub test {
my($self, %attribs) = @_;
my $tests = $attribs{TESTS} || '';
- if (!$tests && -d 't') {
+ if (!$tests && -d 't' && defined $attribs{RECURSIVE_TEST_FILES}) {
+ $tests = $self->find_tests_recursive;
+ }
+ elsif (!$tests && -d 't') {
$tests = $self->find_tests;
}
# note: 'test.pl' name is also hardcoded in init_dirscan()
@@ -3361,14 +3453,14 @@ END
push(@m, "\n");
push(@m, "test_dynamic :: pure_all\n");
- push(@m, $self->test_via_harness('$(FULLPERLRUN)', '$(TEST_FILES)'))
+ push(@m, $self->test_via_harness('$(FULLPERLRUN)', '$(TEST_FILES)'))
if $tests;
- push(@m, $self->test_via_script('$(FULLPERLRUN)', '$(TEST_FILE)'))
+ push(@m, $self->test_via_script('$(FULLPERLRUN)', '$(TEST_FILE)'))
if -f "test.pl";
push(@m, "\n");
push(@m, "testdb_dynamic :: pure_all\n");
- push(@m, $self->test_via_script('$(FULLPERLRUN) $(TESTDB_SW)',
+ push(@m, $self->test_via_script('$(FULLPERLRUN) $(TESTDB_SW)',
'$(TEST_FILE)'));
push(@m, "\n");
@@ -3430,12 +3522,15 @@ sub tool_xsubpp {
# Make sure we pick up the new xsubpp if we're building perl.
unshift @xsubpp_dirs, $self->{PERL_LIB} if $self->{PERL_CORE};
+ my $foundxsubpp = 0;
foreach my $dir (@xsubpp_dirs) {
$xsdir = $self->catdir($dir, 'ExtUtils');
if( -r $self->catfile($xsdir, "xsubpp") ) {
+ $foundxsubpp = 1;
last;
}
}
+ die "ExtUtils::MM_Unix::tool_xsubpp : Can't find xsubpp" if !$foundxsubpp;
my $tmdir = File::Spec->catdir($self->{PERL_LIB},"ExtUtils");
my(@tmdeps) = $self->catfile($tmdir,'typemap');
@@ -3456,10 +3551,10 @@ sub tool_xsubpp {
}
if ($Is{VMS} &&
- $Config{'ldflags'} &&
+ $Config{'ldflags'} &&
$Config{'ldflags'} =~ m!/Debug!i &&
(!exists($self->{XSOPT}) || $self->{XSOPT} !~ /linenumbers/)
- )
+ )
{
unshift(@tmargs,'-nolinenumbers');
}
@@ -3474,7 +3569,7 @@ XSUBPPRUN = \$(PERLRUN) \$(XSUBPP)
XSPROTOARG = $self->{XSPROTOARG}
XSUBPPDEPS = @tmdeps \$(XSUBPP)
XSUBPPARGS = @tmargs
-XSUBPP_EXTRA_ARGS =
+XSUBPP_EXTRA_ARGS =
};
};