summaryrefslogtreecommitdiff
path: root/lib/ExtUtils
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-06-01 15:44:14 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-06-01 15:44:14 +0200
commit5bdf71cc9217764029fb9a321295118de3bb8e72 (patch)
tree00243051ace759751dcf242f9cba701c00b5f215 /lib/ExtUtils
parent20f91e418dfa8bdf6cf78614bfebebc28a7613ee (diff)
downloadperl-5bdf71cc9217764029fb9a321295118de3bb8e72.tar.gz
Upgrade to ExtUtils::MakeMaker 6.52
Diffstat (limited to 'lib/ExtUtils')
-rw-r--r--lib/ExtUtils/Changes124
-rw-r--r--lib/ExtUtils/Command/MM.pm17
-rw-r--r--lib/ExtUtils/Liblist.pm2
-rw-r--r--lib/ExtUtils/Liblist/Kid.pm2
-rw-r--r--lib/ExtUtils/MM.pm2
-rw-r--r--lib/ExtUtils/MM_AIX.pm2
-rw-r--r--lib/ExtUtils/MM_Any.pm224
-rw-r--r--lib/ExtUtils/MM_BeOS.pm2
-rw-r--r--lib/ExtUtils/MM_Cygwin.pm24
-rw-r--r--lib/ExtUtils/MM_DOS.pm2
-rw-r--r--lib/ExtUtils/MM_Darwin.pm2
-rw-r--r--lib/ExtUtils/MM_MacOS.pm2
-rw-r--r--lib/ExtUtils/MM_NW5.pm2
-rw-r--r--lib/ExtUtils/MM_OS2.pm2
-rw-r--r--lib/ExtUtils/MM_QNX.pm2
-rw-r--r--lib/ExtUtils/MM_UWIN.pm2
-rw-r--r--lib/ExtUtils/MM_Unix.pm248
-rw-r--r--lib/ExtUtils/MM_VMS.pm85
-rw-r--r--lib/ExtUtils/MM_VOS.pm2
-rw-r--r--lib/ExtUtils/MM_Win32.pm41
-rw-r--r--lib/ExtUtils/MM_Win95.pm2
-rw-r--r--lib/ExtUtils/MY.pm2
-rw-r--r--lib/ExtUtils/MakeMaker.pm105
-rw-r--r--lib/ExtUtils/MakeMaker/Config.pm2
-rw-r--r--lib/ExtUtils/MakeMaker/FAQ.pod5
-rw-r--r--lib/ExtUtils/Mkbootstrap.pm2
-rw-r--r--lib/ExtUtils/Mksymlists.pm2
-rw-r--r--lib/ExtUtils/t/00compile.t6
-rw-r--r--lib/ExtUtils/t/MM_Cygwin.t32
-rw-r--r--lib/ExtUtils/t/MM_Unix.t10
-rw-r--r--lib/ExtUtils/t/arch_check.t78
-rw-r--r--lib/ExtUtils/t/basic.t26
-rw-r--r--lib/ExtUtils/t/build_man.t2
-rw-r--r--lib/ExtUtils/t/fixin.t80
-rw-r--r--lib/ExtUtils/t/metafile_data.t42
-rw-r--r--lib/ExtUtils/t/parse_version.t12
-rw-r--r--lib/ExtUtils/t/pod2man.t47
-rw-r--r--lib/ExtUtils/t/testdata/reallylongdirectoryname/arch1/Config.pm0
-rw-r--r--lib/ExtUtils/t/testdata/reallylongdirectoryname/arch2/Config.pm0
-rw-r--r--lib/ExtUtils/t/writemakefile_args.t29
-rw-r--r--lib/ExtUtils/t/xs.t10
-rw-r--r--lib/ExtUtils/testlib.pm2
42 files changed, 952 insertions, 333 deletions
diff --git a/lib/ExtUtils/Changes b/lib/ExtUtils/Changes
index c294806b91..ed008f5ab5 100644
--- a/lib/ExtUtils/Changes
+++ b/lib/ExtUtils/Changes
@@ -1,3 +1,127 @@
+6.52 Sat May 30 11:22:04 PDT 2009
+ Docs
+ * Documented CONFIGURE_REQUIRES (Alexandr Ciornii)
+ * Modnerized the docs for PREREQ_PM
+
+
+6.51_04 Sun May 24 14:04:11 PDT 2009
+ Other
+ * All work on INSTALLHTML* has been reverted pending a fix for
+ [rt.cpan.org 45600]
+
+
+6.51_03 Sat May 23 22:38:26 PDT 2009
+ Bug Fixes
+ * Building *.C files was broken in 6.37. [rt.cpan.org 45557]
+ Thanks to Rajesh Mandalemula for spotting it.
+ New Features
+ * Optional parameter CONFIGURE_REQUIRES was added, to control
+ this section in META.yml (Alexandr Ciornii)
+
+
+6.51_02 Mon Apr 13 21:19:56 PDT 2009
+ Bug Fixes
+ * Fix a minor bug with the new PERM_DIR stuff which caused EUI to think
+ PERM_DIR was an install skip file.
+ * A Win32 function call in the last alpha broke Win32 builds.
+
+
+6.51_01 Fri Apr 10 14:30:27 PDT 2009
+ New Features
+ * Module installation will not be stopped by a broken Pod::Man.
+ Man pages will just not be installed.
+ [rt.cpan.org 43546] (Jesse Vincent)
+ * vim swap files, *.swp, will now be ignored by MakeMaker.
+ * Added PERM_DIR to control permissions on directories.
+ [rt.cpan.org 3927] (Rajesh Mandalemula)
+
+ Feature Changes
+ * Modules in PREREQ_PM are no longer loaded in order to figure out
+ their version. parse_version() is used instead.
+ [rt.cpan.org 44646]
+ * PPD files generated with "make ppd" now use the new REQUIRES key
+ rather than the now deprecated DEPENDENCY.
+ [rt.cpan.org 25179] (GAAS)
+ * PPD files no longer contain the deprecated OS tag.
+ * fixin is a bit less restrictive allowing things like
+ #!perl5.8.8 and #!perl-debug [rt.cpan.org 29442]
+ * Remove the unused perm_rw() and perm_rwx() methods.
+
+ Bug Fixes
+ * On 5.10 "make ppd" would generate the wrong ARCHITECTURE saying the
+ version is 5.1 instead of 5.10.
+ * Our pod2man emulation now requires an argument to --perm_rw.
+ [rt.cpan.org 35190] (imacat)
+ * DISTVNAME was documented as a WriteMakefile() param but you'd
+ get a warning if you tried to use it. [rt.cpan.org 43217]
+ * Better support for parallel make installs.
+ [rt.cpan.org 32758] (Brendan O'Dea)
+ * parse_version() will now skip uses of $VERSION in conditions
+ [rt.cpan.org 9452] (jc@unser.net)
+ * The architecture mismatch warning could show up on Win32 due
+ to long vs short filenames being used to compare.
+ [rt.cpan.org 33532] (DAGOLDEN)
+ * maybe_command() will recognize Windows executables in
+ /cygdrive on Cygwin [rt.cpan.org 16375] (PJF)
+ * parse_version() will now look for the first use of $VERSION
+ that results in $VERSION being set.
+
+ Test Fixes
+ * basic.t will not leave a "bin" environment variable defined on VMS.
+ [rt.cpan.org 42150] (John E. Malmberg)
+ * Made the tests work ok on systems whose makes assume that files which
+ have the same mod time are out of date. This is often the case for
+ the tests which generate files and run make rapidly.
+ [rt.cpan.org 29955] (Ken Hirsch)
+ * skip test numbers were wrong on VMS in t/basic.t
+ [rt.cpan.org 43511] (John E. Malmberg)
+
+ Portability
+ * Removed a few hard coded uses of the "false" command.
+ [rt.cpan.org 44504]
+
+ VMS
+ * Fixed a few calls to catfile() that should be catdir().
+ (John E. Malmberg)
+ * Override catdir() and catfile() to expand macros. This is normally done
+ inside File::Spec::VMS but is really a MakeMaker-only thing.
+ (John E. Malmberg)
+
+ Other
+ * Remove ExtUtils::MakeMaker::bytes and vmsish which are unused and
+ seem to never have been used.
+ * Repository now on github.
+
+
+6.50 Sun Mar 22 12:28:06 PDT 2009
+ Windows
+ * Remove the special checks for compilers that need a "manifest". Instead,
+ the code will just be a no-op if there's no manifest. Or something.
+ I dunno, I'm hoping Jan and Steve know what they're doing.
+ [rt.perl.org 61492]
+
+
+6.49_01 Thu Feb 19 17:06:36 PST 2009
+ New OS Support
+ * Recognize "Haiku", a resurrection of BeOS.
+
+ New Features
+ - META.yml now includes ExtUtils::MakeMaker in build_requires by
+ default.
+
+ Test Fixes
+ - ExtUtils::Install 1.51 changed its output breaking some tests that
+ were looking for /^Writing/ [rt.cpan.org 42927]
+
+ Bug Fixes
+ - Upgrade bundled modules: ExtUtils::Install 1.52, ExtUtils::Command
+ 1.16, ExtUtils::Manifest 1.56.
+
+ Other
+ - The MakeMaker repository moved slightly. Changed the metadata to
+ reflect this. [rt.cpan.org 41571]
+
+
6.48 Mon Oct 20 11:18:13 PDT 2008
Test Fixes
* Protect against stray environment variables effecting the tests.
diff --git a/lib/ExtUtils/Command/MM.pm b/lib/ExtUtils/Command/MM.pm
index c9c43ecb17..73cfd41140 100644
--- a/lib/ExtUtils/Command/MM.pm
+++ b/lib/ExtUtils/Command/MM.pm
@@ -10,7 +10,7 @@ our @ISA = qw(Exporter);
our @EXPORT = qw(test_harness pod2man perllocal_install uninstall
warn_if_old_packlist);
-our $VERSION = '6.50';
+our $VERSION = '6.52';
my $Is_VMS = $^O eq 'VMS';
@@ -87,12 +87,21 @@ And the removal of:
If no arguments are given to pod2man it will read from @ARGV.
+If Pod::Man is unavailable, this function will warn and return undef.
+
=cut
sub pod2man {
local @ARGV = @_ ? @_ : @ARGV;
- require Pod::Man;
+ {
+ local $@;
+ if( !eval { require Pod::Man } ) {
+ warn "Pod::Man is not available: $@".
+ "Man pages will not be generated during this install.\n";
+ return undef;
+ }
+ }
require Getopt::Long;
# We will cheat and just use Getopt::Long. We fool it by putting
@@ -103,7 +112,7 @@ sub pod2man {
'section|s=s', 'release|r=s', 'center|c=s',
'date|d=s', 'fixed=s', 'fixedbold=s', 'fixeditalic=s',
'fixedbolditalic=s', 'official|o', 'quotes|q=s', 'lax|l',
- 'name|n=s', 'perm_rw:i'
+ 'name|n=s', 'perm_rw=i'
);
# If there's no files, don't bother going further.
@@ -131,7 +140,7 @@ sub pod2man {
$parser->parse_from_file($pod, $man)
or do { warn("Could not install $man\n"); next };
- if (length $options{perm_rw}) {
+ if (exists $options{perm_rw}) {
chmod(oct($options{perm_rw}), $man)
or do { warn("chmod $options{perm_rw} $man: $!\n"); next };
}
diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm
index b74306c702..691f204695 100644
--- a/lib/ExtUtils/Liblist.pm
+++ b/lib/ExtUtils/Liblist.pm
@@ -2,7 +2,7 @@ package ExtUtils::Liblist;
use strict;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
use File::Spec;
require ExtUtils::Liblist::Kid;
diff --git a/lib/ExtUtils/Liblist/Kid.pm b/lib/ExtUtils/Liblist/Kid.pm
index 113667e295..5bf9b153cd 100644
--- a/lib/ExtUtils/Liblist/Kid.pm
+++ b/lib/ExtUtils/Liblist/Kid.pm
@@ -9,7 +9,7 @@ use 5.006;
# Broken out of MakeMaker from version 4.11
use strict;
-our $VERSION = 6.50;
+our $VERSION = 6.52;
use Config;
use Cwd 'cwd';
diff --git a/lib/ExtUtils/MM.pm b/lib/ExtUtils/MM.pm
index e0ae615bbb..4d2254b9df 100644
--- a/lib/ExtUtils/MM.pm
+++ b/lib/ExtUtils/MM.pm
@@ -3,7 +3,7 @@ package ExtUtils::MM;
use strict;
use ExtUtils::MakeMaker::Config;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
require ExtUtils::Liblist;
require ExtUtils::MakeMaker;
diff --git a/lib/ExtUtils/MM_AIX.pm b/lib/ExtUtils/MM_AIX.pm
index 36a6f6281a..11673bf8ac 100644
--- a/lib/ExtUtils/MM_AIX.pm
+++ b/lib/ExtUtils/MM_AIX.pm
@@ -1,7 +1,7 @@
package ExtUtils::MM_AIX;
use strict;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
require ExtUtils::MM_Unix;
our @ISA = qw(ExtUtils::MM_Unix);
diff --git a/lib/ExtUtils/MM_Any.pm b/lib/ExtUtils/MM_Any.pm
index 0882a14402..9ee5abcc8c 100644
--- a/lib/ExtUtils/MM_Any.pm
+++ b/lib/ExtUtils/MM_Any.pm
@@ -1,10 +1,11 @@
package ExtUtils::MM_Any;
use strict;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
use Carp;
use File::Spec;
+use File::Basename;
BEGIN { our @ISA = qw(File::Spec); }
# We need $Verbose
@@ -545,7 +546,7 @@ CODE
my $make_frag = $mm->dir_target(@directories);
Generates targets to create the specified directories and set its
-permission to 0755.
+permission to PERM_DIR.
Because depending on a directory to just ensure it exists doesn't work
too well (the modified time changes too often) dir_target() creates a
@@ -565,7 +566,7 @@ sub dir_target {
$make .= sprintf <<'MAKE', ($dir) x 7;
%s$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) %s
- $(NOECHO) $(CHMOD) 755 %s
+ $(NOECHO) $(CHMOD) $(PERM_DIR) %s
$(NOECHO) $(TOUCH) %s$(DFSEP).exists
MAKE
@@ -821,6 +822,15 @@ sub metafile_data {
meta-spec
);
+ my $configure_requires;
+ if( $self->{CONFIGURE_REQUIRES} and ref($self->{CONFIGURE_REQUIRES}) eq 'HASH' ) {
+ $configure_requires = $self->{CONFIGURE_REQUIRES};
+ } else {
+ $configure_requires = {
+ 'ExtUtils::MakeMaker' => 0,
+ };
+ }
+
my %meta = (
name => $self->{DISTNAME},
version => $self->{VERSION},
@@ -828,9 +838,7 @@ sub metafile_data {
license => $self->{LICENSE} || 'unknown',
distribution_type => $self->{PM} ? 'module' : 'script',
- configure_requires => {
- 'ExtUtils::MakeMaker' => 0
- },
+ configure_requires => $configure_requires,
build_requires => {
'ExtUtils::MakeMaker' => 0
@@ -1665,7 +1673,7 @@ sub init_VERSION {
}
-=head3 init_others I<Abstract>
+=head3 init_others
$MM->init_others();
@@ -1696,12 +1704,157 @@ Defines at least these macros.
TEST_F Test for a file's existence
CP Copy a file
MV Move a file
- CHMOD Change permissions on a
- file
+ CHMOD Change permissions on a file
+ FALSE Exit with non-zero
+ TRUE Exit with zero
UMASK_NULL Nullify umask
DEV_NULL Suppress all command output
+=cut
+
+sub init_others {
+ my $self = shift;
+
+ $self->{ECHO} ||= $self->oneliner('print qq{@ARGV}', ['-l']);
+ $self->{ECHO_N} ||= $self->oneliner('print qq{@ARGV}');
+
+ $self->{TOUCH} ||= $self->oneliner('touch', ["-MExtUtils::Command"]);
+ $self->{CHMOD} ||= $self->oneliner('chmod', ["-MExtUtils::Command"]);
+ $self->{RM_F} ||= $self->oneliner('rm_f', ["-MExtUtils::Command"]);
+ $self->{RM_RF} ||= $self->oneliner('rm_rf', ["-MExtUtils::Command"]);
+ $self->{TEST_F} ||= $self->oneliner('test_f', ["-MExtUtils::Command"]);
+ $self->{FALSE} ||= $self->oneliner('exit 1');
+ $self->{TRUE} ||= $self->oneliner('exit 0');
+
+ $self->{MKPATH} ||= $self->oneliner('mkpath', ["-MExtUtils::Command"]);
+
+ $self->{CP} ||= $self->oneliner('cp', ["-MExtUtils::Command"]);
+ $self->{MV} ||= $self->oneliner('mv', ["-MExtUtils::Command"]);
+
+ $self->{MOD_INSTALL} ||=
+ $self->oneliner(<<'CODE', ['-MExtUtils::Install']);
+install([ from_to => {@ARGV}, verbose => '$(VERBINST)', uninstall_shadows => '$(UNINST)', dir_mode => '$(PERM_DIR)' ]);
+CODE
+ $self->{DOC_INSTALL} ||= $self->oneliner('perllocal_install', ["-MExtUtils::Command::MM"]);
+ $self->{UNINSTALL} ||= $self->oneliner('uninstall', ["-MExtUtils::Command::MM"]);
+ $self->{WARN_IF_OLD_PACKLIST} ||=
+ $self->oneliner('warn_if_old_packlist', ["-MExtUtils::Command::MM"]);
+ $self->{FIXIN} ||= $self->oneliner('MY->fixin(shift)', ["-MExtUtils::MY"]);
+ $self->{EQUALIZE_TIMESTAMP} ||= $self->oneliner('eqtime', ["-MExtUtils::Command"]);
+
+ $self->{UNINST} ||= 0;
+ $self->{VERBINST} ||= 0;
+
+ $self->{FIRST_MAKEFILE} ||= $self->{MAKEFILE} || 'Makefile';
+ $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE};
+ $self->{MAKEFILE_OLD} ||= $self->{MAKEFILE}.'.old';
+ $self->{MAKE_APERL_FILE} ||= $self->{MAKEFILE}.'.aperl';
+
+ # Not everybody uses -f to indicate "use this Makefile instead"
+ $self->{USEMAKEFILE} ||= '-f';
+
+ # Some makes require a wrapper around macros passed in on the command
+ # line.
+ $self->{MACROSTART} ||= '';
+ $self->{MACROEND} ||= '';
+
+ $self->{SHELL} ||= $Config{sh};
+
+ # UMASK_NULL is not used by MakeMaker but some CPAN modules
+ # make use of it.
+ $self->{UMASK_NULL} ||= "umask 0";
+
+ # Not the greatest default, but its something.
+ $self->{DEV_NULL} ||= "> /dev/null 2>&1";
+
+ $self->{NOOP} ||= '$(TRUE)';
+ $self->{NOECHO} = '@' unless defined $self->{NOECHO};
+
+ $self->{LD_RUN_PATH} = "";
+
+ # Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $self->{LIBS}
+ # Lets look at $self->{LIBS} carefully: It may be an anon array, a string or
+ # undefined. In any case we turn it into an anon array:
+
+ # May check $Config{libs} too, thus not empty.
+ $self->{LIBS} = !defined $self->{LIBS} ? [''] :
+ !ref $self->{LIBS} ? [$self->{LIBS}] :
+ $self->{LIBS} ;
+
+ foreach my $libs ( @{$self->{LIBS}} ){
+ $libs =~ s/^\s*(.*\S)\s*$/$1/; # remove leading and trailing whitespace
+ my(@libs) = $self->extliblist($libs);
+ if ($libs[0] or $libs[1] or $libs[2]){
+ # LD_RUN_PATH now computed by ExtUtils::Liblist
+ ($self->{EXTRALIBS}, $self->{BSLOADLIBS},
+ $self->{LDLOADLIBS}, $self->{LD_RUN_PATH}) = @libs;
+ last;
+ }
+ }
+
+ if ( $self->{OBJECT} ) {
+ $self->{OBJECT} =~ s!\.o(bj)?\b!\$(OBJ_EXT)!g;
+ } else {
+ # init_dirscan should have found out, if we have C files
+ $self->{OBJECT} = "";
+ $self->{OBJECT} = '$(BASEEXT)$(OBJ_EXT)' if @{$self->{C}||[]};
+ }
+ $self->{OBJECT} =~ s/\n+/ \\\n\t/g;
+
+ $self->{BOOTDEP} = (-f "$self->{BASEEXT}_BS") ? "$self->{BASEEXT}_BS" : "";
+ $self->{PERLMAINCC} ||= '$(CC)';
+ $self->{LDFROM} = '$(OBJECT)' unless $self->{LDFROM};
+
+ # Sanity check: don't define LINKTYPE = dynamic if we're skipping
+ # the 'dynamic' section of MM. We don't have this problem with
+ # 'static', since we either must use it (%Config says we can't
+ # use dynamic loading) or the caller asked for it explicitly.
+ if (!$self->{LINKTYPE}) {
+ $self->{LINKTYPE} = $self->{SKIPHASH}{'dynamic'}
+ ? 'static'
+ : ($Config{usedl} ? 'dynamic' : 'static');
+ }
+
+ return 1;
+}
+
+
+=head3 tools_other
+
+ my $make_frag = $MM->tools_other;
+
+Returns a make fragment containing definitions for the macros init_others()
+initializes.
+
+=cut
+
+sub tools_other {
+ my($self) = shift;
+ my @m;
+
+ # We set PM_FILTER as late as possible so it can see all the earlier
+ # on macro-order sensitive makes such as nmake.
+ for my $tool (qw{ SHELL CHMOD CP MV NOOP NOECHO RM_F RM_RF TEST_F TOUCH
+ UMASK_NULL DEV_NULL MKPATH EQUALIZE_TIMESTAMP
+ FALSE TRUE
+ ECHO ECHO_N
+ UNINST VERBINST
+ MOD_INSTALL DOC_INSTALL UNINSTALL
+ WARN_IF_OLD_PACKLIST
+ MACROSTART MACROEND
+ USEMAKEFILE
+ PM_FILTER
+ FIXIN
+ } )
+ {
+ next unless defined $self->{$tool};
+ push @m, "$tool = $self->{$tool}\n";
+ }
+
+ return join "", @m;
+}
+
=head3 init_DIRFILESEP I<Abstract>
@@ -1894,6 +2047,59 @@ MAKE_FRAG
}
+=head3 arch_check
+
+ my $arch_ok = $mm->arch_check(
+ $INC{"Config.pm"},
+ File::Spec->catfile($Config{archlibexp}, "Config.pm")
+ );
+
+A sanity check that what Perl thinks the architecture is and what
+Config thinks the architecture is are the same. If they're not it
+will return false and show a diagnostic message.
+
+When building Perl it will always return true, as nothing is installed
+yet.
+
+The interface is a bit odd because this is the result of a
+quick refactoring. Don't rely on it.
+
+=cut
+
+sub arch_check {
+ my $self = shift;
+ my($pconfig, $cconfig) = @_;
+
+ return 1 if $self->{PERL_SRC};
+
+ my($pvol, $pthinks) = $self->splitpath($pconfig);
+ my($cvol, $cthinks) = $self->splitpath($cconfig);
+
+ $pthinks = $self->canonpath($pthinks);
+ $cthinks = $self->canonpath($cthinks);
+
+ my $ret = 1;
+ if ($pthinks ne $cthinks) {
+ print "Have $pthinks\n";
+ print "Want $cthinks\n";
+
+ $ret = 0;
+
+ my $arch = (grep length, $self->splitdir($pthinks))[-1];
+
+ print STDOUT <<END unless $self->{UNINSTALLED_PERL};
+Your perl and your Config.pm seem to have different ideas about the
+architecture they are running on.
+Perl thinks: [$arch]
+Config says: [$Config{archname}]
+This may or may not cause problems. Please check your installation of perl
+if you have problems building this extension.
+END
+ }
+
+ return $ret;
+}
+
=head2 File::Spec wrappers
diff --git a/lib/ExtUtils/MM_BeOS.pm b/lib/ExtUtils/MM_BeOS.pm
index 4a0d25b778..2b35e32d80 100644
--- a/lib/ExtUtils/MM_BeOS.pm
+++ b/lib/ExtUtils/MM_BeOS.pm
@@ -26,7 +26,7 @@ require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-our $VERSION = '6.50';
+our $VERSION = '6.52';
=item os_flavor
diff --git a/lib/ExtUtils/MM_Cygwin.pm b/lib/ExtUtils/MM_Cygwin.pm
index 1eaf00e1fd..a0a7d40486 100644
--- a/lib/ExtUtils/MM_Cygwin.pm
+++ b/lib/ExtUtils/MM_Cygwin.pm
@@ -5,11 +5,11 @@ use strict;
use ExtUtils::MakeMaker::Config;
use File::Spec;
-require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
-our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
+require ExtUtils::MM_Win32;
+our @ISA = qw( ExtUtils::MM_Unix );
-our $VERSION = '6.50';
+our $VERSION = '6.52';
=head1 NAME
@@ -98,6 +98,24 @@ sub init_linker {
$self->{EXPORT_LIST} ||= '';
}
+=item maybe_command
+
+If our path begins with F</cygdrive/> then we use C<ExtUtils::MM_Win32>
+to determine if it may be a command. Otherwise we use the tests
+from C<ExtUtils::MM_Unix>.
+
+=cut
+
+sub maybe_command {
+ my ($self, $file) = @_;
+
+ if ($file =~ m{^/cygdrive/}i) {
+ return ExtUtils::MM_Win32->maybe_command($file);
+ }
+
+ return $self->SUPER::maybe_command($file);
+}
+
=back
=cut
diff --git a/lib/ExtUtils/MM_DOS.pm b/lib/ExtUtils/MM_DOS.pm
index 1238fe6439..e9ac41e80f 100644
--- a/lib/ExtUtils/MM_DOS.pm
+++ b/lib/ExtUtils/MM_DOS.pm
@@ -2,7 +2,7 @@ package ExtUtils::MM_DOS;
use strict;
-our $VERSION = 6.50;
+our $VERSION = 6.52;
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
diff --git a/lib/ExtUtils/MM_Darwin.pm b/lib/ExtUtils/MM_Darwin.pm
index e3d6dbf950..3489730d57 100644
--- a/lib/ExtUtils/MM_Darwin.pm
+++ b/lib/ExtUtils/MM_Darwin.pm
@@ -7,7 +7,7 @@ BEGIN {
our @ISA = qw( ExtUtils::MM_Unix );
}
-our $VERSION = '6.50';
+our $VERSION = '6.52';
=head1 NAME
diff --git a/lib/ExtUtils/MM_MacOS.pm b/lib/ExtUtils/MM_MacOS.pm
index 47a0aef9ce..fbdf0ce34f 100644
--- a/lib/ExtUtils/MM_MacOS.pm
+++ b/lib/ExtUtils/MM_MacOS.pm
@@ -2,7 +2,7 @@ package ExtUtils::MM_MacOS;
use strict;
-our $VERSION = 6.50;
+our $VERSION = 6.52;
sub new {
die <<'UNSUPPORTED';
diff --git a/lib/ExtUtils/MM_NW5.pm b/lib/ExtUtils/MM_NW5.pm
index 285a04d7c7..803b08a446 100644
--- a/lib/ExtUtils/MM_NW5.pm
+++ b/lib/ExtUtils/MM_NW5.pm
@@ -22,7 +22,7 @@ use strict;
use ExtUtils::MakeMaker::Config;
use File::Basename;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
require ExtUtils::MM_Win32;
our @ISA = qw(ExtUtils::MM_Win32);
diff --git a/lib/ExtUtils/MM_OS2.pm b/lib/ExtUtils/MM_OS2.pm
index 0a57a57594..17e71637cb 100644
--- a/lib/ExtUtils/MM_OS2.pm
+++ b/lib/ExtUtils/MM_OS2.pm
@@ -5,7 +5,7 @@ use strict;
use ExtUtils::MakeMaker qw(neatvalue);
use File::Spec;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
diff --git a/lib/ExtUtils/MM_QNX.pm b/lib/ExtUtils/MM_QNX.pm
index 653078f511..4233d93230 100644
--- a/lib/ExtUtils/MM_QNX.pm
+++ b/lib/ExtUtils/MM_QNX.pm
@@ -1,7 +1,7 @@
package ExtUtils::MM_QNX;
use strict;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
require ExtUtils::MM_Unix;
our @ISA = qw(ExtUtils::MM_Unix);
diff --git a/lib/ExtUtils/MM_UWIN.pm b/lib/ExtUtils/MM_UWIN.pm
index b1f7d7d4b2..5c84591008 100644
--- a/lib/ExtUtils/MM_UWIN.pm
+++ b/lib/ExtUtils/MM_UWIN.pm
@@ -1,7 +1,7 @@
package ExtUtils::MM_UWIN;
use strict;
-our $VERSION = 6.50;
+our $VERSION = 6.52;
require ExtUtils::MM_Unix;
our @ISA = qw(ExtUtils::MM_Unix);
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index a997b1f79c..1208ccffb0 100644
--- a/lib/ExtUtils/MM_Unix.pm
+++ b/lib/ExtUtils/MM_Unix.pm
@@ -15,7 +15,7 @@ use ExtUtils::MakeMaker qw($Verbose neatvalue);
# If we make $VERSION an our variable parse_version() breaks
use vars qw($VERSION);
-$VERSION = '6.50';
+$VERSION = '6.52';
require ExtUtils::MM_Any;
our @ISA = qw(ExtUtils::MM_Any);
@@ -160,7 +160,7 @@ sub c_o {
push @m, qq{
.C\$(OBJ_EXT):
- $command \$*.C
+ $command $flags \$*.C
} if !$Is{OS2} and !$Is{Win32} and !$Is{Dos}; #Case-specific
return join "", @m;
@@ -393,7 +393,7 @@ sub constants {
PERLRUN FULLPERLRUN ABSPERLRUN
PERLRUNINST FULLPERLRUNINST ABSPERLRUNINST
PERL_CORE
- PERM_RW PERM_RWX
+ PERM_DIR PERM_RW PERM_RWX
) )
{
@@ -1094,7 +1094,7 @@ sub fixin { # stolen from the pink Camel book, more or less
# Now look (in reverse) for interpreter in absolute PATH (unless perl).
my $interpreter;
- if ( $cmd eq "perl" ) {
+ if ( $cmd =~ m{^perl(?:\z|[^a-z])} ) {
if ( $Config{startperl} =~ m,^\#!.*/perl, ) {
$interpreter = $Config{startperl};
$interpreter =~ s,^\#!,,;
@@ -1105,7 +1105,7 @@ sub fixin { # stolen from the pink Camel book, more or less
}
else {
my (@absdirs)
- = reverse grep { $self->file_name_is_absolute } $self->path;
+ = reverse grep { $self->file_name_is_absolute($_) } $self->path;
$interpreter = '';
foreach my $dir (@absdirs) {
@@ -1291,7 +1291,7 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
if ($txt =~ /Extracting \S+ \(with variable substitutions/) {
($pl_files{$name} = $name) =~ s/[._]pl\z//i ;
}
- else {
+ else {
$pm{$name} = $self->catfile($self->{INST_LIBDIR},$name);
}
} elsif ($name =~ /\.(p[ml]|pod)\z/){
@@ -1323,7 +1323,7 @@ sub init_MANPODS {
# Set up names of manual pages to generate from pods
foreach my $man (qw(MAN1 MAN3)) {
- if ( $self->{"${man}PODS"}
+ if ( $self->{"${man}PODS"}
or $self->{"INSTALL${man}DIR"} =~ /^(none|\s*)$/
) {
$self->{"${man}PODS"} ||= {};
@@ -1331,7 +1331,7 @@ sub init_MANPODS {
else {
my $init_method = "init_${man}PODS";
$self->$init_method();
- }
+ }
}
}
@@ -1499,8 +1499,9 @@ sub init_PM {
return;
}
return if /\#/;
- return if /~$/; # emacs temp files
- return if /,v$/; # RCS files
+ return if /~$/; # emacs temp files
+ return if /,v$/; # RCS files
+ return if m{\.swp$}; # vim swap files
my $path = $File::Find::name;
my $prefix = $self->{INST_LIBDIR};
@@ -1661,14 +1662,14 @@ from the perl source tree.
# uninstalled Perl outside of Perl build tree
my $lib;
for my $dir (@INC) {
- $lib = $dir, last if -e $self->catdir($dir, "Config.pm");
+ $lib = $dir, last if -e $self->catfile($dir, "Config.pm");
}
if ($lib) {
# Win32 puts its header files in /perl/src/lib/CORE.
# Unix leaves them in /perl/src.
my $inc = $Is{Win32} ? $self->catdir($lib, "CORE" )
: dirname $lib;
- if (-e $self->catdir($inc, "perl.h")) {
+ if (-e $self->catfile($inc, "perl.h")) {
$self->{PERL_LIB} = $lib;
$self->{PERL_ARCHLIB} = $lib;
$self->{PERL_INC} = $inc;
@@ -1742,69 +1743,6 @@ TOUCH, CP, MV, CHMOD, UMASK_NULL, ECHO, ECHO_N
sub init_others { # --- Initialize Other Attributes
my($self) = shift;
- $self->{LD} ||= 'ld';
-
- # Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $self->{LIBS}
- # Lets look at $self->{LIBS} carefully: It may be an anon array, a string or
- # undefined. In any case we turn it into an anon array:
-
- # May check $Config{libs} too, thus not empty.
- $self->{LIBS} = [$self->{LIBS}] unless ref $self->{LIBS};
-
- $self->{LIBS} = [''] unless @{$self->{LIBS}} && defined $self->{LIBS}[0];
- $self->{LD_RUN_PATH} = "";
-
- foreach my $libs ( @{$self->{LIBS}} ){
- $libs =~ s/^\s*(.*\S)\s*$/$1/; # remove leading and trailing whitespace
- my(@libs) = $self->extliblist($libs);
- if ($libs[0] or $libs[1] or $libs[2]){
- # LD_RUN_PATH now computed by ExtUtils::Liblist
- ($self->{EXTRALIBS}, $self->{BSLOADLIBS},
- $self->{LDLOADLIBS}, $self->{LD_RUN_PATH}) = @libs;
- last;
- }
- }
-
- if ( $self->{OBJECT} ) {
- $self->{OBJECT} =~ s!\.o(bj)?\b!\$(OBJ_EXT)!g;
- } else {
- # init_dirscan should have found out, if we have C files
- $self->{OBJECT} = "";
- $self->{OBJECT} = '$(BASEEXT)$(OBJ_EXT)' if @{$self->{C}||[]};
- }
- $self->{OBJECT} =~ s/\n+/ \\\n\t/g;
- $self->{BOOTDEP} = (-f "$self->{BASEEXT}_BS") ? "$self->{BASEEXT}_BS" : "";
- $self->{PERLMAINCC} ||= '$(CC)';
- $self->{LDFROM} = '$(OBJECT)' unless $self->{LDFROM};
-
- # Sanity check: don't define LINKTYPE = dynamic if we're skipping
- # the 'dynamic' section of MM. We don't have this problem with
- # 'static', since we either must use it (%Config says we can't
- # use dynamic loading) or the caller asked for it explicitly.
- if (!$self->{LINKTYPE}) {
- $self->{LINKTYPE} = $self->{SKIPHASH}{'dynamic'}
- ? 'static'
- : ($Config{usedl} ? 'dynamic' : 'static');
- };
-
- $self->{NOOP} ||= '$(SHELL) -c true';
- $self->{NOECHO} = '@' unless defined $self->{NOECHO};
-
- $self->{FIRST_MAKEFILE} ||= $self->{MAKEFILE} || 'Makefile';
- $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE};
- $self->{MAKEFILE_OLD} ||= $self->{MAKEFILE}.'.old';
- $self->{MAKE_APERL_FILE} ||= $self->{MAKEFILE}.'.aperl';
-
- # Some makes require a wrapper around macros passed in on the command
- # line.
- $self->{MACROSTART} ||= '';
- $self->{MACROEND} ||= '';
-
- # Not everybody uses -f to indicate "use this Makefile instead"
- $self->{USEMAKEFILE} ||= '-f';
-
- $self->{SHELL} ||= $Config{sh} || '/bin/sh';
-
$self->{ECHO} ||= 'echo';
$self->{ECHO_N} ||= 'echo -n';
$self->{RM_F} ||= "rm -f";
@@ -1814,27 +1752,16 @@ sub init_others { # --- Initialize Other Attributes
$self->{CP} ||= "cp";
$self->{MV} ||= "mv";
$self->{CHMOD} ||= "chmod";
- $self->{MKPATH} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e mkpath';
- $self->{EQUALIZE_TIMESTAMP} ||=
- '$(ABSPERLRUN) "-MExtUtils::Command" -e eqtime';
-
- $self->{UNINST} ||= 0;
- $self->{VERBINST} ||= 0;
- $self->{MOD_INSTALL} ||=
- $self->oneliner(<<'CODE', ['-MExtUtils::Install']);
-install({@ARGV}, '$(VERBINST)', 0, '$(UNINST)');
-CODE
- $self->{DOC_INSTALL} ||=
- '$(ABSPERLRUN) "-MExtUtils::Command::MM" -e perllocal_install';
- $self->{UNINSTALL} ||=
- '$(ABSPERLRUN) "-MExtUtils::Command::MM" -e uninstall';
- $self->{WARN_IF_OLD_PACKLIST} ||=
- '$(ABSPERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist';
- $self->{FIXIN} ||=
- q{$(PERLRUN) "-MExtUtils::MY" -e "MY->fixin(shift)"};
-
- $self->{UMASK_NULL} ||= "umask 0";
- $self->{DEV_NULL} ||= "> /dev/null 2>&1";
+ $self->{FALSE} ||= 'false';
+ $self->{TRUE} ||= 'true';
+
+ $self->{LD} ||= 'ld';
+
+ $self->SUPER::init_others(@_);
+
+ # After SUPER::init_others so $Config{shell} has a
+ # chance to get set.
+ $self->{SHELL} ||= '/bin/sh';
return 1;
}
@@ -2049,6 +1976,7 @@ Called by init_main. Initializes PERL_*
sub init_PERM {
my($self) = shift;
+ $self->{PERM_DIR} = 755 unless defined $self->{PERM_DIR};
$self->{PERM_RW} = 644 unless defined $self->{PERM_RW};
$self->{PERM_RWX} = 755 unless defined $self->{PERM_RWX};
@@ -2093,16 +2021,16 @@ sub install {
my(@m);
push @m, q{
-install :: all pure_install doc_install
+install :: pure_install doc_install
$(NOECHO) $(NOOP)
-install_perl :: all pure_perl_install doc_perl_install
+install_perl :: pure_perl_install doc_perl_install
$(NOECHO) $(NOOP)
-install_site :: all pure_site_install doc_site_install
+install_site :: pure_site_install doc_site_install
$(NOECHO) $(NOOP)
-install_vendor :: all pure_vendor_install doc_vendor_install
+install_vendor :: pure_vendor_install doc_vendor_install
$(NOECHO) $(NOOP)
pure_install :: pure_$(INSTALLDIRS)_install
@@ -2117,7 +2045,7 @@ pure__install : pure_site_install
doc__install : doc_site_install
$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
-pure_perl_install ::
+pure_perl_install :: all
$(NOECHO) $(MOD_INSTALL) \
read }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
write }.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
@@ -2131,7 +2059,7 @@ pure_perl_install ::
}.$self->catdir('$(SITEARCHEXP)','auto','$(FULLEXT)').q{
-pure_site_install ::
+pure_site_install :: all
$(NOECHO) $(MOD_INSTALL) \
read }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
write }.$self->catfile('$(DESTINSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{ \
@@ -2144,7 +2072,7 @@ pure_site_install ::
$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
}.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{
-pure_vendor_install ::
+pure_vendor_install :: all
$(NOECHO) $(MOD_INSTALL) \
read }.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
write }.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{ \
@@ -2155,7 +2083,7 @@ pure_vendor_install ::
$(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \
$(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR)
-doc_perl_install ::
+doc_perl_install :: all
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
-$(NOECHO) $(DOC_INSTALL) \
@@ -2166,7 +2094,7 @@ doc_perl_install ::
EXE_FILES "$(EXE_FILES)" \
>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
-doc_site_install ::
+doc_site_install :: all
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
-$(NOECHO) $(DOC_INSTALL) \
@@ -2177,7 +2105,7 @@ doc_site_install ::
EXE_FILES "$(EXE_FILES)" \
>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
-doc_vendor_install ::
+doc_vendor_install :: all
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
-$(NOECHO) $(DOC_INSTALL) \
@@ -2597,7 +2525,7 @@ $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
$(PERLRUN) Makefile.PL %s
$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
$(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <=="
- false
+ $(FALSE)
MAKE_FRAG
@@ -2683,7 +2611,8 @@ It will return the string "undef" if it can't figure out what $VERSION
is. $VERSION should be for all to see, so C<our $VERSION> or plain $VERSION
are okay, but C<my $VERSION> is not.
-parse_version() will try to C<use version> before checking for C<$VERSION> so the following will work.
+parse_version() will try to C<use version> before checking for
+C<$VERSION> so the following will work.
$VERSION = qv(1.2.3);
@@ -2701,7 +2630,8 @@ sub parse_version {
$inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod;
next if $inpod || /^\s*#/;
chop;
- next unless /(?<!\\)([\$*])(([\w\:\']*)\bVERSION)\b.*\=/;
+ next if /^\s*(if|unless)/;
+ next unless m{(?<!\\) ([\$*]) (([\w\:\']*) \bVERSION)\b .* =}x;
my $eval = qq{
package ExtUtils::MakeMaker::_version;
no strict;
@@ -2724,7 +2654,7 @@ sub parse_version {
local $^W = 0;
$result = eval($eval); ## no critic
warn "Could not eval '$eval' in $parsefile: $@" if $@;
- last;
+ last if defined $result;
}
close $fh;
@@ -2797,7 +2727,7 @@ sub perldepend {
# We do NOT just update config.h because that is not sufficient.
# An out of date config.h is not fatal but complains loudly!
$(PERL_INC)/config.h: $(PERL_SRC)/config.sh
- -$(NOECHO) $(ECHO) "Warning: $(PERL_INC)/config.h out of date with $(PERL_SRC)/config.sh"; false
+ -$(NOECHO) $(ECHO) "Warning: $(PERL_INC)/config.h out of date with $(PERL_SRC)/config.sh"; $(FALSE)
$(PERL_ARCHLIB)/Config.pm: $(PERL_SRC)/config.sh
$(NOECHO) $(ECHO) "Warning: $(PERL_ARCHLIB)/Config.pm may be out of date with $(PERL_SRC)/config.sh"
@@ -2859,35 +2789,6 @@ $(OBJECT) : $(PERL_HDRS)
}
-=item perm_rw (o)
-
-Returns the attribute C<PERM_RW> or the string C<644>.
-Used as the string that is passed
-to the C<chmod> command to set the permissions for read/writeable files.
-MakeMaker chooses C<644> because it has turned out in the past that
-relying on the umask provokes hard-to-track bug reports.
-When the return value is used by the perl function C<chmod>, it is
-interpreted as an octal value.
-
-=cut
-
-sub perm_rw {
- return shift->{PERM_RW};
-}
-
-=item perm_rwx (o)
-
-Returns the attribute C<PERM_RWX> or the string C<755>,
-i.e. the string that is passed
-to the C<chmod> command to set the permissions for executable files.
-See also perl_rw.
-
-=cut
-
-sub perm_rwx {
- return shift->{PERM_RWX};
-}
-
=item pm_to_blib
Defines target that copies all files in the hash PM to their
@@ -2902,8 +2803,9 @@ sub pm_to_blib {
pm_to_blib : $(TO_INST_PM)
};
+ # VMS will swallow '' and PM_FILTER is often empty. So use q[]
my $pm_to_blib = $self->oneliner(<<CODE, ['-MExtUtils::Install']);
-pm_to_blib({\@ARGV}, '$autodir', '\$(PM_FILTER)')
+pm_to_blib({\@ARGV}, '$autodir', q[\$(PM_FILTER)], '\$(PERM_DIR)')
CODE
my @cmds = $self->split_command($pm_to_blib, %{$self->{PM}});
@@ -2965,8 +2867,6 @@ for a binary distribution.
sub ppd {
my($self) = @_;
- my $pack_ver = $self->_ppd_version($self->{VERSION});
-
my $abstract = $self->{ABSTRACT} || '';
$abstract =~ s/\n/\\n/sg;
$abstract =~ s/</&lt;/g;
@@ -2976,9 +2876,8 @@ sub ppd {
$author =~ s/</&lt;/g;
$author =~ s/>/&gt;/g;
- my $ppd_xml = sprintf <<'PPD_HTML', $pack_ver, $abstract, $author;
+ my $ppd_xml = sprintf <<'PPD_HTML', $self->{VERSION}, $abstract, $author;
<SOFTPKG NAME="$(DISTNAME)" VERSION="%s">
- <TITLE>$(DISTNAME)</TITLE>
<ABSTRACT>%s</ABSTRACT>
<AUTHOR>%s</AUTHOR>
PPD_HTML
@@ -2991,14 +2890,22 @@ PPD_HTML
PPD_PERLVERS
}
- foreach my $prereq (sort keys %{$self->{PREREQ_PM}}) {
- my $pre_req = $prereq;
- $pre_req =~ s/::/-/g;
- my $dep_ver = $self->_ppd_version($self->{PREREQ_PM}{$prereq});
- $ppd_xml .= sprintf <<'PPD_OUT', $pre_req, $dep_ver;
- <DEPENDENCY NAME="%s" VERSION="%s" />
-PPD_OUT
+ # Don't add "perl" to requires. perl dependencies are
+ # handles by ARCHITECTURE.
+ my %prereqs = %{$self->{PREREQ_PM}};
+ delete $prereqs{perl};
+
+ # Build up REQUIRE
+ foreach my $prereq (sort keys %prereqs) {
+ my $name = $prereq;
+ $name .= '::' unless $name =~ /::/;
+ my $version = $prereqs{$prereq}+0; # force numification
+
+ my %attrs = ( NAME => $name );
+ $attrs{VERSION} = $version if $version;
+ my $attrs = join " ", map { qq[$_="$attrs{$_}"] } keys %attrs;
+ $ppd_xml .= qq( <REQUIRE $attrs />\n);
}
my $archname = $Config{archname};
@@ -3006,10 +2913,9 @@ PPD_OUT
# archname did not change from 5.6 to 5.8, but those versions may
# not be not binary compatible so now we append the part of the
# version that changes when binary compatibility may change
- $archname .= "-". substr($Config{version},0,3);
+ $archname .= "-$Config{PERL_REVISION}.$Config{PERL_VERSION}";
}
$ppd_xml .= sprintf <<'PPD_OUT', $archname;
- <OS NAME="$(OSNAME)" />
<ARCHITECTURE NAME="%s" />
PPD_OUT
@@ -3523,40 +3429,6 @@ sub test_via_script {
}
-=item tools_other (o)
-
- my $make_frag = $MM->tools_other;
-
-Returns a make fragment containing definitions for the macros init_others()
-initializes.
-
-=cut
-
-sub tools_other {
- my($self) = shift;
- my @m;
-
- # We set PM_FILTER as late as possible so it can see all the earlier
- # on macro-order sensitive makes such as nmake.
- for my $tool (qw{ SHELL CHMOD CP MV NOOP NOECHO RM_F RM_RF TEST_F TOUCH
- UMASK_NULL DEV_NULL MKPATH EQUALIZE_TIMESTAMP
- ECHO ECHO_N
- UNINST VERBINST
- MOD_INSTALL DOC_INSTALL UNINSTALL
- WARN_IF_OLD_PACKLIST
- MACROSTART MACROEND
- USEMAKEFILE
- PM_FILTER
- FIXIN
- } )
- {
- next unless defined $self->{$tool};
- push @m, "$tool = $self->{$tool}\n";
- }
-
- return join "", @m;
-}
-
=item tool_xsubpp (o)
Determines typemaps, xsubpp version, prototype behaviour.
diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm
index b6f8486203..2b4f1a382e 100644
--- a/lib/ExtUtils/MM_VMS.pm
+++ b/lib/ExtUtils/MM_VMS.pm
@@ -15,7 +15,7 @@ BEGIN {
use File::Basename;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
@@ -372,7 +372,7 @@ sub init_DEST {
# Expand DEST variables.
foreach my $var ($self->installvars) {
my $destvar = 'DESTINSTALL'.$var;
- $self->{$destvar} = File::Spec->eliminate_macros($self->{$destvar});
+ $self->{$destvar} = $self->eliminate_macros($self->{$destvar});
}
}
@@ -450,7 +450,7 @@ sub init_others {
$self->{NOOP} = 'Continue';
$self->{NOECHO} ||= '@ ';
- $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE} || 'Descrip.MMS';
+ $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE} || 'Descrip.MMS';
$self->{FIRST_MAKEFILE} ||= $self->{MAKEFILE};
$self->{MAKE_APERL_FILE} ||= 'Makeaperl.MMS';
$self->{MAKEFILE_OLD} ||= $self->eliminate_macros('$(FIRST_MAKEFILE)_old');
@@ -469,27 +469,16 @@ sub init_others {
$self->{MACROEND} ||= ')';
$self->{USEMAKEFILE} ||= '/Descrip=';
- $self->{ECHO} ||= '$(ABSPERLRUN) -le "print qq{@ARGV}"';
- $self->{ECHO_N} ||= '$(ABSPERLRUN) -e "print qq{@ARGV}"';
- $self->{TOUCH} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e touch';
- $self->{CHMOD} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e chmod';
- $self->{RM_F} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e rm_f';
- $self->{RM_RF} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e rm_rf';
- $self->{TEST_F} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e test_f';
$self->{EQUALIZE_TIMESTAMP} ||= '$(ABSPERLRUN) -we "open F,qq{>>$ARGV[1]};close F;utime(0,(stat($ARGV[0]))[9]+1,$ARGV[1])"';
$self->{MOD_INSTALL} ||=
$self->oneliner(<<'CODE', ['-MExtUtils::Install']);
-install({split(' ',<STDIN>)}, '$(VERBINST)', 0, '$(UNINST)');
+install([ from_to => {split(' ', <STDIN>)}, verbose => '$(VERBINST)', uninstall_shadows => '$(UNINST)', dir_mode => '$(PERM_DIR)' ]);
CODE
- $self->{SHELL} ||= 'Posix';
-
$self->SUPER::init_others;
- # So we can copy files into directories with less fuss
- $self->{CP} = '$(ABSPERLRUN) "-MExtUtils::Command" -e cp';
- $self->{MV} = '$(ABSPERLRUN) "-MExtUtils::Command" -e mv';
+ $self->{SHELL} ||= 'Posix';
$self->{UMASK_NULL} = '! ';
@@ -852,7 +841,10 @@ sub init_dist {
$self->SUPER::init_dist;
- $self->{DISTVNAME} = "$self->{DISTNAME}-$self->{VERSION_SYM}";
+ $self->{DISTVNAME} = "$self->{DISTNAME}-$self->{VERSION_SYM}"
+ unless $self->{ARGS}{DISTVNAME};
+
+ return;
}
=item c_o (override)
@@ -1572,6 +1564,20 @@ map_clean :
join '', @m;
}
+
+=item arch_check (override)
+
+vmsify all arguments for consistency
+
+=cut
+
+sub arch_check {
+ my $self = shift;
+
+ return $self->SUPER::arch_check(map { vmsify($_) } @_);
+}
+
+
# --- Output postprocessing section ---
=item maketext_filter (override)
@@ -1611,10 +1617,10 @@ sub prefixify {
# Translate $(PERLPREFIX) to a real path.
$rprefix = $self->eliminate_macros($rprefix);
- $rprefix = VMS::Filespec::vmspath($rprefix) if $rprefix;
- $sprefix = VMS::Filespec::vmspath($sprefix) if $sprefix;
+ $rprefix = vmspath($rprefix) if $rprefix;
+ $sprefix = vmspath($sprefix) if $sprefix;
- $default = VMS::Filespec::vmsify($default)
+ $default = vmsify($default)
unless $default =~ /\[.*\]/;
(my $var_no_install = $var) =~ s/^install//;
@@ -1814,6 +1820,45 @@ sub init_linker {
$self->{PERL_ARCHIVE_AFTER} ||= '';
}
+
+=item catdir (override)
+
+=item catfile (override)
+
+Eliminate the macros in the output to the MMS/MMK file.
+
+(File::Spec::VMS used to do this for us, but it's being removed)
+
+=cut
+
+sub catdir {
+ my $self = shift;
+
+ # Process the macros on VMS MMS/MMK
+ my @args = map { m{\$\(} ? $self->eliminate_macros($_) : $_ } @_;
+
+ my $dir = $self->SUPER::catdir(@args);
+
+ # Fix up the directory and force it to VMS format.
+ $dir = $self->fixpath($dir, 1);
+
+ return $dir;
+}
+
+sub catfile {
+ my $self = shift;
+
+ # Process the macros on VMS MMS/MMK
+ my @args = map { m{\$\(} ? $self->eliminate_macros($_) : $_ } @_;
+
+ my $file = $self->SUPER::catfile(@args);
+
+ $file = vmsify($file);
+
+ return $file
+}
+
+
=item eliminate_macros
Expands MM[KS]/Make macros in a text string, using the contents of
diff --git a/lib/ExtUtils/MM_VOS.pm b/lib/ExtUtils/MM_VOS.pm
index aea8597308..fd4f8c4fe5 100644
--- a/lib/ExtUtils/MM_VOS.pm
+++ b/lib/ExtUtils/MM_VOS.pm
@@ -1,7 +1,7 @@
package ExtUtils::MM_VOS;
use strict;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
require ExtUtils::MM_Unix;
our @ISA = qw(ExtUtils::MM_Unix);
diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm
index 7813ddf6e8..2a15502da8 100644
--- a/lib/ExtUtils/MM_Win32.pm
+++ b/lib/ExtUtils/MM_Win32.pm
@@ -27,7 +27,7 @@ use ExtUtils::MakeMaker qw( neatvalue );
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-our $VERSION = '6.50';
+our $VERSION = '6.52';
$ENV{EMXSHELL} = 'sh'; # to run `commands`
@@ -149,26 +149,15 @@ Adjustments are made for Borland's quirks needing -L to come first.
sub init_others {
my ($self) = @_;
- # Used in favor of echo because echo won't strip quotes. :(
- $self->{ECHO} ||= $self->oneliner('print qq{@ARGV}', ['-l']);
- $self->{ECHO_N} ||= $self->oneliner('print qq{@ARGV}');
-
- $self->{TOUCH} ||= '$(ABSPERLRUN) -MExtUtils::Command -e touch';
- $self->{CHMOD} ||= '$(ABSPERLRUN) -MExtUtils::Command -e chmod';
- $self->{CP} ||= '$(ABSPERLRUN) -MExtUtils::Command -e cp';
- $self->{RM_F} ||= '$(ABSPERLRUN) -MExtUtils::Command -e rm_f';
- $self->{RM_RF} ||= '$(ABSPERLRUN) -MExtUtils::Command -e rm_rf';
- $self->{MV} ||= '$(ABSPERLRUN) -MExtUtils::Command -e mv';
$self->{NOOP} ||= 'rem';
- $self->{TEST_F} ||= '$(ABSPERLRUN) -MExtUtils::Command -e test_f';
$self->{DEV_NULL} ||= '> NUL';
$self->{FIXIN} ||= $self->{PERL_CORE} ?
"\$(PERLRUN) $self->{PERL_SRC}/win32/bin/pl2bat.pl" :
'pl2bat.bat';
- $self->{LD} ||= $Config{ld} || 'link';
- $self->{AR} ||= $Config{ar} || 'lib';
+ $self->{LD} ||= 'link';
+ $self->{AR} ||= 'lib';
$self->SUPER::init_others;
@@ -340,8 +329,8 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).
# Embed the manifest file if it exists
push(@m, q{
- if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
- if exist $@.manifest del $@.manifest});
+ if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
+ if exist $@.manifest del $@.manifest});
}
push @m, '
$(CHMOD) $(PERM_RWX) $@
@@ -416,6 +405,20 @@ sub pasthru {
}
+=item arch_check (override)
+
+Normalize all arguments for consistency of comparison.
+
+=cut
+
+sub arch_check {
+ my $self = shift;
+
+ require Win32;
+ return $self->SUPER::arch_check( map { lc Win32::GetShortPathName($_) } @_);
+}
+
+
=item oneliner
These are based on what command.com does on Win98. They may be wrong
@@ -475,12 +478,10 @@ sub escape_newlines {
dmake can handle Unix style cd'ing but nmake (at least 1.5) cannot. It
wants:
- cd dir
+ cd dir1\dir2
command
another_command
- cd ..
-
-NOTE: This only works with simple relative directories. Throw it an absolute dir or something with .. in it and things will go wrong.
+ cd ..\..
=cut
diff --git a/lib/ExtUtils/MM_Win95.pm b/lib/ExtUtils/MM_Win95.pm
index 9a9a653d05..4467ba10d7 100644
--- a/lib/ExtUtils/MM_Win95.pm
+++ b/lib/ExtUtils/MM_Win95.pm
@@ -2,7 +2,7 @@ package ExtUtils::MM_Win95;
use strict;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
require ExtUtils::MM_Win32;
our @ISA = qw(ExtUtils::MM_Win32);
diff --git a/lib/ExtUtils/MY.pm b/lib/ExtUtils/MY.pm
index 6cf3499fb8..7e80a95b8a 100644
--- a/lib/ExtUtils/MY.pm
+++ b/lib/ExtUtils/MY.pm
@@ -3,7 +3,7 @@ package ExtUtils::MY;
use strict;
require ExtUtils::MM;
-our $VERSION = 6.50;
+our $VERSION = 6.52;
our @ISA = qw(ExtUtils::MM);
{
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm
index fabc3673d2..67655ef5ee 100644
--- a/lib/ExtUtils/MakeMaker.pm
+++ b/lib/ExtUtils/MakeMaker.pm
@@ -18,7 +18,7 @@ our @Overridable;
my @Prepend_parent;
my %Recognized_Att_Keys;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
# Emulate something resembling CVS $Revision$
(our $Revision = $VERSION) =~ s{_}{};
@@ -88,6 +88,7 @@ my %Special_Sigs = (
PMLIBDIRS => 'ARRAY',
PMLIBPARENTDIRS => 'ARRAY',
PREREQ_PM => 'HASH',
+ CONFIGURE_REQUIRES => 'HASH',
SKIP => 'ARRAY',
TYPEMAPS => 'ARRAY',
XS => 'HASH',
@@ -219,7 +220,8 @@ sub full_setup {
my @attrib_help = qw/
AUTHOR ABSTRACT ABSTRACT_FROM BINARY_LOCATION
- C CAPI CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DL_FUNCS DL_VARS
+ C CAPI CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DISTVNAME
+ DL_FUNCS DL_VARS
EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE
FULLPERL FULLPERLRUN FULLPERLRUNINST
FUNCLIST H IMPORTS
@@ -240,10 +242,10 @@ sub full_setup {
INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS LICENSE
LINKTYPE MAKE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET
- META_ADD META_MERGE MIN_PERL_VERSION
+ META_ADD META_MERGE MIN_PERL_VERSION CONFIGURE_REQUIRES
MYEXTLIB NAME NEEDS_LINKING NOECHO NO_META NORECURS NO_VC OBJECT OPTIMIZE
PERL_MALLOC_OK PERL PERLMAINCC PERLRUN PERLRUNINST PERL_CORE
- PERL_SRC PERM_RW PERM_RWX
+ PERL_SRC PERM_DIR PERM_RW PERM_RWX
PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE PPM_INSTALL_EXEC
PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
SIGN SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
@@ -293,7 +295,7 @@ sub full_setup {
@Overridable = @MM_Sections;
push @Overridable, qw[
- libscan makeaperl needs_linking perm_rw perm_rwx
+ libscan makeaperl needs_linking
subdir_x test_via_harness test_via_script
init_VERSION init_dist init_INST init_INSTALL init_DEST init_dirscan
@@ -442,18 +444,22 @@ END
my(%unsatisfied) = ();
foreach my $prereq (sort keys %{$self->{PREREQ_PM}}) {
- # 5.8.0 has a bug with require Foo::Bar alone in an eval, so an
- # extra statement is a workaround.
my $file = "$prereq.pm";
$file =~ s{::}{/}g;
- eval { require $file };
-
- my $pr_version = $prereq->VERSION || 0;
+ my $path;
+ for my $dir (@INC) {
+ my $tmp = File::Spec->catfile($dir, $file);
+ if( -r $tmp ) {
+ $path = $tmp;
+ last;
+ }
+ }
+ my $pr_version = defined $path ? MM->parse_version($path) : 0;
# convert X.Y_Z alpha version #s to X.YZ for easier comparisons
$pr_version =~ s/(\d+)\.(\d+)_(\d+)/$1.$2$3/;
- if ($@) {
+ if (!defined $path) {
warn sprintf "Warning: prerequisite %s %s not found.\n",
$prereq, $self->{PREREQ_PM}{$prereq}
unless $self->{PREREQ_FATAL};
@@ -570,30 +576,10 @@ END
$self->init_linker;
$self->init_ABSTRACT;
- if (! $self->{PERL_SRC} ) {
- require VMS::Filespec if $Is_VMS;
- my($pthinks) = $self->canonpath($INC{'Config.pm'});
- my($cthinks) = $self->catfile($Config{'archlibexp'},'Config.pm');
- $pthinks = VMS::Filespec::vmsify($pthinks) if $Is_VMS;
- if ($pthinks ne $cthinks &&
- !($Is_Win32 and lc($pthinks) eq lc($cthinks))) {
- print "Have $pthinks expected $cthinks\n";
- if ($Is_Win32) {
- $pthinks =~ s![/\\]Config\.pm$!!i; $pthinks =~ s!.*[/\\]!!;
- }
- else {
- $pthinks =~ s!/Config\.pm$!!; $pthinks =~ s!.*/!!;
- }
- print STDOUT <<END unless $self->{UNINSTALLED_PERL};
-Your perl and your Config.pm seem to have different ideas about the
-architecture they are running on.
-Perl thinks: [$pthinks]
-Config says: [$Config{archname}]
-This may or may not cause problems. Please check your installation of perl
-if you have problems building this extension.
-END
- }
- }
+ $self->arch_check(
+ $INC{'Config.pm'},
+ $self->catfile($Config{'archlibexp'}, "Config.pm")
+ );
$self->init_others();
$self->init_platform();
@@ -1469,6 +1455,17 @@ CODE reference. The subroutine should return a hash reference. The
hash may contain further attributes, e.g. {LIBS =E<gt> ...}, that have to
be determined by some evaluation method.
+=item CONFIGURE_REQUIRES
+
+A hash of modules that are required to run Makefile.PL itself, but not
+to run your distribution.
+
+This will go into the C<configure_requires> field of your F<META.yml>.
+
+Defaults to C<{ "ExtUtils::MakeMaker" => 0 }>
+
+The format is the same as PREREQ_PM.
+
=item DEFINE
Something like C<"-DHAVE_UNISTD_H">
@@ -1487,8 +1484,8 @@ slash on your DESTDIR. F<~/tmp/> not F<~/tmp>.
=item DIR
-Ref to array of subdirectories containing Makefile.PLs e.g. [ 'sdbm'
-] in ext/SDBM_File
+Ref to array of subdirectories containing Makefile.PLs e.g. ['sdbm']
+in ext/SDBM_File
=item DISTNAME
@@ -1842,6 +1839,15 @@ EXE_FILES files that include POD directives. The files listed
here will be converted to man pages and installed as was requested
at Configure time.
+This hash should map POD files (or scripts containing POD) to the
+man file names under the C<blib/man1/> directory, as in the following
+example:
+
+ MAN1PODS => {
+ 'doc/command.pod' => 'blib/man1/command.1',
+ 'scripts/script.pl' => 'blib/man1/script.1',
+ }
+
=item MAN3PODS
Hashref that assigns to *.pm and *.pod files the files into which the
@@ -1850,6 +1856,8 @@ for POD directives. Files that contain POD will be the default keys of
the MAN3PODS hashref. These will then be converted to man pages during
C<make> and will be installed during C<make install>.
+Example similar to MAN1PODS.
+
=item MAP_TARGET
If it is intended, that a new perl binary be produced, this variable
@@ -2016,15 +2024,17 @@ flags so perl can see the modules you're about to install.
Directory containing the Perl source code (use of this should be
avoided, it may be undefined)
+=item PERM_DIR
+
+Desired permission for directories. Defaults to C<755>.
+
=item PERM_RW
Desired permission for read/writable files. Defaults to C<644>.
-See also L<MM_Unix/perm_rw>.
=item PERM_RWX
Desired permission for executable files. Defaults to C<755>.
-See also L<MM_Unix/perm_rwx>.
=item PL_FILES
@@ -2160,10 +2170,19 @@ use your module with an incomplete environment.
=item PREREQ_PM
-Hashref: Names of modules that need to be available to run this
-extension (e.g. Fcntl for SDBM_File) are the keys of the hash and the
-desired version is the value. If the required version number is 0, we
-only check if any version is installed already.
+A hash of modules that are needed to run your module. The keys are
+the module names ie. Test::More, and the minimum version is the
+value. If the required version number is 0 any version will do.
+
+This will go into the C<requires> field of your F<META.yml>.
+
+ PREREQ_PM => {
+ # Require Test::More at least 0.47
+ "Test::More" => "0.47",
+
+ # Require any version of Acme::Buffy
+ "Acme::Buffy" => 0,
+ }
=item PREREQ_PRINT
diff --git a/lib/ExtUtils/MakeMaker/Config.pm b/lib/ExtUtils/MakeMaker/Config.pm
index ff21b5b49a..9b60e7766a 100644
--- a/lib/ExtUtils/MakeMaker/Config.pm
+++ b/lib/ExtUtils/MakeMaker/Config.pm
@@ -2,7 +2,7 @@ package ExtUtils::MakeMaker::Config;
use strict;
-our $VERSION = '6.50';
+our $VERSION = '6.52';
use Config ();
diff --git a/lib/ExtUtils/MakeMaker/FAQ.pod b/lib/ExtUtils/MakeMaker/FAQ.pod
index e681b0178d..d33f82e53b 100644
--- a/lib/ExtUtils/MakeMaker/FAQ.pod
+++ b/lib/ExtUtils/MakeMaker/FAQ.pod
@@ -267,6 +267,11 @@ do that. Use at your own risk. Have fun blowing holes in your foot.
);
+=item Which zip should I use on Windows for '[nd]make zipdist'?
+
+We recommend InfoZIP: L<http://www.info-zip.org/Zip.html>
+
+
=back
=head2 XS
diff --git a/lib/ExtUtils/Mkbootstrap.pm b/lib/ExtUtils/Mkbootstrap.pm
index d1b64e56da..f6606cf1c2 100644
--- a/lib/ExtUtils/Mkbootstrap.pm
+++ b/lib/ExtUtils/Mkbootstrap.pm
@@ -3,7 +3,7 @@ package ExtUtils::Mkbootstrap;
# There's just too much Dynaloader incest here to turn on strict vars.
use strict 'refs';
-our $VERSION = '6.50';
+our $VERSION = '6.52';
require Exporter;
our @ISA = ('Exporter');
diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm
index 0f0841e974..e3e866e364 100644
--- a/lib/ExtUtils/Mksymlists.pm
+++ b/lib/ExtUtils/Mksymlists.pm
@@ -10,7 +10,7 @@ use Config;
our @ISA = qw(Exporter);
our @EXPORT = qw(&Mksymlists);
-our $VERSION = '6.50';
+our $VERSION = '6.52';
sub Mksymlists {
my(%spec) = @_;
diff --git a/lib/ExtUtils/t/00compile.t b/lib/ExtUtils/t/00compile.t
index fb9943ae78..7d06484739 100644
--- a/lib/ExtUtils/t/00compile.t
+++ b/lib/ExtUtils/t/00compile.t
@@ -21,12 +21,12 @@ BEGIN {
chdir File::Spec->updir;
my $manifest = File::Spec->catfile('MANIFEST');
-open(MANIFEST, $manifest) or die "Can't open $manifest: $!";
+open(my $manifest_fh, "<", $manifest) or die "Can't open $manifest: $!";
my @modules = map { m{^lib/(\S+)}; $1 }
grep { m{^lib/ExtUtils/\S*\.pm} }
- grep { !m{/t/} } <MANIFEST>;
+ grep { !m{/t/} } <$manifest_fh>;
chomp @modules;
-close MANIFEST;
+close $manifest_fh;
chdir 'lib';
plan tests => scalar @modules * 2;
diff --git a/lib/ExtUtils/t/MM_Cygwin.t b/lib/ExtUtils/t/MM_Cygwin.t
index 266c465940..7ce380c2ba 100644
--- a/lib/ExtUtils/t/MM_Cygwin.t
+++ b/lib/ExtUtils/t/MM_Cygwin.t
@@ -16,7 +16,7 @@ use Test::More;
BEGIN {
if ($^O =~ /cygwin/i) {
- plan tests => 11;
+ plan tests => 14;
} else {
plan skip_all => "This is not cygwin";
}
@@ -25,6 +25,7 @@ BEGIN {
use Config;
use File::Spec;
use ExtUtils::MM;
+use Config;
use_ok( 'ExtUtils::MM_Cygwin' );
@@ -97,7 +98,36 @@ like( $res, qr/pure_all.*foo.*foo.1/s, '... should add MAN3PODS targets' );
is( $MM->{EXPORT_LIST}, $export, 'EXPORT_LIST' );
}
+# Tests for correct handling of maybe_command in /cygdrive/*
+# and c:/*. $ENV{COMSPEC}, if it exists, should always be executable.
+
+SKIP: {
+ my $comspec = $ENV{COMSPEC};
+
+ skip("\$ENV{COMSPEC} does not exist", 3) unless $comspec;
+
+ # Convert into cygwin-flavoured '/cygdrive/c/...' path.
+ # Is there a better way than direct munging? A File::*
+ # module perhaps?
+
+ $comspec =~ s{^(\w):} {/cygdrive/\l$1}x;
+ $comspec =~ s{\\ } {/}gx;
+
+ ok(MM->maybe_command($comspec),"$comspec should be executable");
+ # /cygdrive/c should *never* be executable, it's a directory.
+
+ ok(! MM->maybe_command(q{/cygdrive/c}),
+ qq{/cygdrive/c should never be executable}
+ );
+
+ # Our copy of Perl (with a unix-path) should always be executable.
+
+ ok(MM->maybe_command($Config{perlpath}),
+ qq{$Config{perlpath} should be executable}
+ );
+
+}
package FakeOut;
diff --git a/lib/ExtUtils/t/MM_Unix.t b/lib/ExtUtils/t/MM_Unix.t
index c3a22ec80b..ed23d60bdf 100644
--- a/lib/ExtUtils/t/MM_Unix.t
+++ b/lib/ExtUtils/t/MM_Unix.t
@@ -18,7 +18,7 @@ BEGIN {
plan skip_all => 'Non-Unix platform';
}
else {
- plan tests => 109;
+ plan tests => 110;
}
}
@@ -189,11 +189,13 @@ my $self_name = $ENV{PERL_CORE} ? '../lib/ExtUtils/t/MM_Unix.t'
is ($t->perl_script($self_name),$self_name, 'we pass as a perl_script()');
###############################################################################
-# perm_rw perm_rwx
+# PERM_RW and PERM_RWX
$t->init_PERM;
-is ($t->perm_rw(),'644', 'perm_rw() is 644');
-is ($t->perm_rwx(),'755', 'perm_rwx() is 755');
+is ($t->{PERM_RW},'644', 'PERM_RW is 644');
+is ($t->{PERM_RWX},'755', 'PERM_RWX is 755');
+is ($t->{PERM_DIR},'755', 'PERM_DIR is 755');
+
###############################################################################
# post_constants, postamble, post_initialize
diff --git a/lib/ExtUtils/t/arch_check.t b/lib/ExtUtils/t/arch_check.t
new file mode 100644
index 0000000000..3d62fe2ca3
--- /dev/null
+++ b/lib/ExtUtils/t/arch_check.t
@@ -0,0 +1,78 @@
+#!/usr/bin/perl -w
+
+use strict;
+use lib 't/lib';
+
+use TieOut;
+use Test::More 'no_plan';
+
+use Config;
+use ExtUtils::MakeMaker;
+
+ok( my $stdout = tie *STDOUT, 'TieOut' );
+
+# Create a normalized MM object to test with
+my $mm = bless {}, "MM";
+$mm->{PERL_SRC} = 0;
+$mm->{UNINSTALLED_PERL} = 0;
+
+my $rel2abs = sub { $mm->rel2abs($mm->catfile(@_)) };
+
+ok $mm->arch_check(
+ $rel2abs->(qw(. t testdata reallylongdirectoryname arch1 Config.pm)),
+ $rel2abs->(qw(. t testdata reallylongdirectoryname arch1 Config.pm)),
+);
+
+
+# Different architecures.
+{
+ ok !$mm->arch_check(
+ $rel2abs->(qw(. t testdata reallylongdirectoryname arch1 Config.pm)),
+ $rel2abs->(qw(. t testdata reallylongdirectoryname arch2 Config.pm)),
+ );
+
+ like $stdout->read, qr{\Q
+Your perl and your Config.pm seem to have different ideas about the
+architecture they are running on.
+Perl thinks: [arch1]
+Config says: [$Config{archname}]
+This may or may not cause problems. Please check your installation of perl
+if you have problems building this extension.
+};
+
+}
+
+
+# Different file path separators [rt.cpan.org 46416]
+SKIP: {
+ skip "Can't load File::Spec::Win32" unless eval "require File::Spec::Win32";
+ local @File::Spec::ISA = qw(File::Spec::Win32);
+ ok $mm->arch_check(
+ "/_64/perl1004/lib/Config.pm",
+ '\\_64\\perl1004\\lib\\Config.pm',
+ );
+}
+
+
+# PERL_SRC is set, no check is done
+{
+ local $mm->{PERL_SRC} = 1;
+ ok $mm->arch_check(
+ $rel2abs->(qw(. t testdata reallylongdirectoryname arch1 Config.pm)),
+ $rel2abs->(qw(. t testdata reallylongdirectoryname arch2 Config.pm)),
+ );
+
+ is $stdout->read, '';
+}
+
+
+# UNINSTALLED_PERL is set, no message is sent
+{
+ local $mm->{UNINSTALLED_PERL} = 1;
+ ok !$mm->arch_check(
+ $rel2abs->(qw(. t testdata reallylongdirectoryname arch1 Config.pm)),
+ $rel2abs->(qw(. t testdata reallylongdirectoryname arch2 Config.pm)),
+ );
+
+ like $stdout->read, qr{^Have .*\nWant .*$};
+}
diff --git a/lib/ExtUtils/t/basic.t b/lib/ExtUtils/t/basic.t
index a0dc1579f3..afd5fae8c8 100644
--- a/lib/ExtUtils/t/basic.t
+++ b/lib/ExtUtils/t/basic.t
@@ -17,7 +17,7 @@ use strict;
use Config;
use ExtUtils::MakeMaker;
-use Test::More tests => 81;
+use Test::More tests => 79;
use MakeMaker::Test::Utils;
use MakeMaker::Test::Setup::BFD;
use File::Find;
@@ -32,7 +32,7 @@ my $perl = which_perl();
my $Is_VMS = $^O eq 'VMS';
# GNV logical interferes with testing
-$ENV{'bin'} = '[.bin]' if $Is_VMS;
+local $ENV{'bin'} = '[.bin]' if $Is_VMS;
chdir 't';
@@ -93,21 +93,21 @@ ok( open(PPD, 'Big-Dummy.ppd'), ' .ppd file generated' );
my $ppd_html;
{ local $/; $ppd_html = <PPD> }
close PPD;
-like( $ppd_html, qr{^<SOFTPKG NAME="Big-Dummy" VERSION="0,01,0,0">}m,
+like( $ppd_html, qr{^<SOFTPKG NAME="Big-Dummy" VERSION="0.01">}m,
' <SOFTPKG>' );
-like( $ppd_html, qr{^\s*<TITLE>Big-Dummy</TITLE>}m, ' <TITLE>' );
like( $ppd_html, qr{^\s*<ABSTRACT>Try "our" hot dog's</ABSTRACT>}m,
' <ABSTRACT>');
like( $ppd_html,
qr{^\s*<AUTHOR>Michael G Schwern &lt;schwern\@pobox.com&gt;</AUTHOR>}m,
' <AUTHOR>' );
like( $ppd_html, qr{^\s*<IMPLEMENTATION>}m, ' <IMPLEMENTATION>');
-like( $ppd_html, qr{^\s*<DEPENDENCY NAME="strict" VERSION="0,0,0,0" />}m,
- ' <DEPENDENCY>' );
-like( $ppd_html, qr{^\s*<OS NAME="$Config{osname}" />}m,
- ' <OS>' );
+like( $ppd_html, qr{^\s*<REQUIRE NAME="strict::" />}m, ' <REQUIRE>' );
+
my $archname = $Config{archname};
-$archname .= "-". substr($Config{version},0,3) if $] >= 5.008;
+if( $] >= 5.008 ) {
+ # XXX This is a copy of the internal logic, so it's not a great test
+ $archname .= "-$Config{PERL_REVISION}.$Config{PERL_VERSION}";
+}
like( $ppd_html, qr{^\s*<ARCHITECTURE NAME="$archname" />}m,
' <ARCHITECTURE>');
like( $ppd_html, qr{^\s*<CODEBASE HREF="" />}m, ' <CODEBASE>');
@@ -153,7 +153,7 @@ ok( $files{'perllocal.pod'},' perllocal.pod created' );
SKIP: {
- skip 'VMS install targets do not preserve $(PREFIX)', 9 if $Is_VMS;
+ skip 'VMS install targets do not preserve $(PREFIX)', 8 if $Is_VMS;
$install_out = run("$make install PREFIX=elsewhere");
is( $?, 0, 'install with PREFIX override' ) || diag $install_out;
@@ -172,7 +172,7 @@ SKIP: {
SKIP: {
- skip 'VMS install targets do not preserve $(DESTDIR)', 11 if $Is_VMS;
+ skip 'VMS install targets do not preserve $(DESTDIR)', 10 if $Is_VMS;
$install_out = run("$make install PREFIX= DESTDIR=other");
is( $?, 0, 'install with DESTDIR' ) ||
@@ -212,7 +212,7 @@ SKIP: {
SKIP: {
- skip 'VMS install targets do not preserve $(PREFIX)', 10 if $Is_VMS;
+ skip 'VMS install targets do not preserve $(PREFIX)', 9 if $Is_VMS;
$install_out = run("$make install PREFIX=elsewhere DESTDIR=other/");
is( $?, 0, 'install with PREFIX override and DESTDIR' ) ||
@@ -313,7 +313,7 @@ ok( grep(/^Writing $makefile for Big::Dummy/, @mpl_out) == 1,
# I know we'll get ignored errors from make here, that's ok.
# Send STDERR off to oblivion.
open(SAVERR, ">&STDERR") or die $!;
-open(STDERR, ">".File::Spec->devnull) or die $!;
+open(STDERR, ">",File::Spec->devnull) or die $!;
my $realclean_out = run("$make realclean");
is( $?, 0, 'realclean' ) || diag($realclean_out);
diff --git a/lib/ExtUtils/t/build_man.t b/lib/ExtUtils/t/build_man.t
index 4a544fbb53..9732c3806f 100644
--- a/lib/ExtUtils/t/build_man.t
+++ b/lib/ExtUtils/t/build_man.t
@@ -60,7 +60,7 @@ ok( my $stdout = tie *STDOUT, 'TieOut' );
INSTALLMAN3DIR => 'none'
);
- ok( !keys %{ $mm->{MAN3PODS} } );
+ is_deeply( $mm->{MAN3PODS}, {} );
}
diff --git a/lib/ExtUtils/t/fixin.t b/lib/ExtUtils/t/fixin.t
index 69c0ac722b..e0291e600f 100644
--- a/lib/ExtUtils/t/fixin.t
+++ b/lib/ExtUtils/t/fixin.t
@@ -1,5 +1,8 @@
#!/usr/bin/perl -w
+# Try to test fixin. I say "try" because what fixin will actually do
+# is highly variable from system to system.
+
BEGIN {
if( $ENV{PERL_CORE} ) {
chdir 't';
@@ -13,8 +16,9 @@ chdir 't';
use File::Spec;
-use Test::More tests => 6;
+use Test::More tests => 22;
+use Config;
use TieOut;
use MakeMaker::Test::Utils;
use MakeMaker::Test::Setup::BFD;
@@ -43,3 +47,77 @@ ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
is $\, "bar", '$\ not clobbered';
}
+
+sub test_fixin {
+ my($code, $test) = @_;
+
+ my $file = "fixin_test";
+ ok(open(my $fh, ">", $file), "write $file") or diag "Can't write $file: $!";
+ print $fh $code;
+ close $fh;
+
+ MY->fixin($file);
+
+ ok(open($fh, "<", $file), "read $file") or diag "Can't read $file: $!";
+ my @lines = <$fh>;
+ close $fh;
+
+ $test->(@lines);
+
+ 1 while unlink $file;
+ ok !-e $file, "cleaned up $file";
+}
+
+
+# A simple test of fixin
+test_fixin(<<END,
+#!/foo/bar/perl -w
+
+blah blah blah
+END
+ sub {
+ my @lines = @_;
+ unlike $lines[0], qr[/foo/bar/perl], "#! replaced";
+ like $lines[0], qr[ -w\b], "switch retained";
+
+ # In between might be that "not running under some shell" madness.
+
+ is $lines[-1], "blah blah blah\n", "Program text retained";
+ }
+);
+
+
+# [rt.cpan.org 29442]
+test_fixin(<<END,
+#!/foo/bar/perl5.8.8 -w
+
+blah blah blah
+END
+
+ sub {
+ my @lines = @_;
+ unlike $lines[0], qr[/foo/bar/perl5.8.8], "#! replaced";
+ like $lines[0], qr[ -w\b], "switch retained";
+
+ # In between might be that "not running under some shell" madness.
+
+ is $lines[-1], "blah blah blah\n", "Program text retained";
+ }
+);
+
+
+# fixin shouldn't pick this up.
+test_fixin(<<END,
+#!/foo/bar/perly -w
+
+blah blah blah
+END
+
+ sub {
+ is join("", @_), <<END;
+#!/foo/bar/perly -w
+
+blah blah blah
+END
+ }
+);
diff --git a/lib/ExtUtils/t/metafile_data.t b/lib/ExtUtils/t/metafile_data.t
index c1b16793b8..ddb986b2c6 100644
--- a/lib/ExtUtils/t/metafile_data.t
+++ b/lib/ExtUtils/t/metafile_data.t
@@ -9,7 +9,7 @@ BEGIN {
}
use strict;
-use Test::More tests => 5;
+use Test::More tests => 6;
use Data::Dumper;
@@ -233,3 +233,43 @@ my $new_mm = sub {
},
];
}
+
+# Test CONFIGURE_REQUIRES
+{
+ my $mm = $new_mm->(
+ DISTNAME => 'Foo-Bar',
+ VERSION => 1.23,
+ CONFIGURE_REQUIRES => {
+ "Fake::Module1" => 1.01,
+ },
+ PM => {
+ "Foo::Bar" => 'lib/Foo/Bar.pm',
+ },
+ );
+
+ is_deeply [$mm->metafile_data], [
+ name => 'Foo-Bar',
+ version => 1.23,
+ abstract => undef,
+ author => [],
+ license => 'unknown',
+ distribution_type => 'module',
+
+ configure_requires => {
+ 'Fake::Module1' => 1.01,
+ },
+ build_requires => {
+ 'ExtUtils::MakeMaker' => 0,
+ },
+
+ no_index => {
+ directory => [qw(t inc)],
+ },
+
+ generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+ 'meta-spec' => {
+ url => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
+ version => 1.4
+ },
+ ],'CONFIGURE_REQUIRES';
+}
diff --git a/lib/ExtUtils/t/parse_version.t b/lib/ExtUtils/t/parse_version.t
index c21da4eb4a..840fdf2360 100644
--- a/lib/ExtUtils/t/parse_version.t
+++ b/lib/ExtUtils/t/parse_version.t
@@ -29,7 +29,19 @@ my %versions = (q[$VERSION = '1.00'] => '1.00',
q[my $VERSION = '1.01'] => 'undef',
q[local $VERISON = '1.02'] => 'undef',
q[local $FOO::VERSION = '1.30'] => 'undef',
+ q[if( $Foo::VERSION >= 3.00 ) {]=> 'undef',
q[our $VERSION = '1.23';] => '1.23',
+
+ '$Something::VERSION == 1.0' => 'undef',
+ '$Something::VERSION <= 1.0' => 'undef',
+ '$Something::VERSION >= 1.0' => 'undef',
+ '$Something::VERSION != 1.0' => 'undef',
+
+ qq[\$Something::VERSION == 1.0\n\$VERSION = 2.3\n] => '2.3',
+ qq[\$Something::VERSION == 1.0\n\$VERSION = 2.3\n\$VERSION = 4.5\n] => '2.3',
+
+ '$VERSION = sprintf("%d.%03d", q$Revision: 3.74 $ =~ /(\d+)\.(\d+)/);' => '3.074',
+ '$VERSION = substr(q$Revision: 2.8 $, 10) + 2 . "";' => '4.8',
);
if( $Has_Version ) {
diff --git a/lib/ExtUtils/t/pod2man.t b/lib/ExtUtils/t/pod2man.t
new file mode 100644
index 0000000000..1632234b15
--- /dev/null
+++ b/lib/ExtUtils/t/pod2man.t
@@ -0,0 +1,47 @@
+#!/usr/bin/perl -w
+
+# Test our simulation of pod2man
+
+use strict;
+use lib 't/lib';
+
+use ExtUtils::Command::MM;
+
+use Test::More tests => 3;
+
+# The argument to perm_rw was optional.
+# [rt.cpan.org 35190]
+{
+ my $warnings;
+ local $SIG{__WARN__} = sub {
+ $warnings .= join '', @_;
+ };
+
+ pod2man("--perm_rw");
+
+ like $warnings, qr/^Option perm_rw requires an argument/;
+};
+
+
+# Simulate the failure of Pod::Man loading.
+# pod2man() should react gracefully.
+{
+ local @INC = @INC;
+ unshift @INC, sub {
+ die "Simulated Pod::Man failure\n" if $_[1] eq 'Pod/Man.pm';
+ };
+ local %INC = %INC;
+ delete $INC{"Pod/Man.pm"};
+
+ my $warnings;
+ local $SIG{__WARN__} = sub {
+ $warnings .= join '', @_;
+ };
+
+ is pod2man(), undef;
+ is $warnings, <<'END'
+Pod::Man is not available: Simulated Pod::Man failure
+Man pages will not be generated during this install.
+END
+
+}
diff --git a/lib/ExtUtils/t/testdata/reallylongdirectoryname/arch1/Config.pm b/lib/ExtUtils/t/testdata/reallylongdirectoryname/arch1/Config.pm
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/lib/ExtUtils/t/testdata/reallylongdirectoryname/arch1/Config.pm
diff --git a/lib/ExtUtils/t/testdata/reallylongdirectoryname/arch2/Config.pm b/lib/ExtUtils/t/testdata/reallylongdirectoryname/arch2/Config.pm
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/lib/ExtUtils/t/testdata/reallylongdirectoryname/arch2/Config.pm
diff --git a/lib/ExtUtils/t/writemakefile_args.t b/lib/ExtUtils/t/writemakefile_args.t
index efe104d0cd..a0774a8d6b 100644
--- a/lib/ExtUtils/t/writemakefile_args.t
+++ b/lib/ExtUtils/t/writemakefile_args.t
@@ -14,7 +14,7 @@ BEGIN {
}
use strict;
-use Test::More tests => 30;
+use Test::More tests => 35;
use TieOut;
use MakeMaker::Test::Utils;
@@ -191,4 +191,31 @@ VERIFY
isa_ok( $mm->{VERSION}, 'version' );
is( $mm->{VERSION}, $version );
}
+
+
+ # DISTNAME
+ $warnings = '';
+ eval {
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION => '1.00',
+ DISTNAME => "Hooballa",
+ );
+ };
+ is( $warnings, '' );
+ is( $mm->{DISTNAME}, "Hooballa" );
+ is( $mm->{DISTVNAME}, $Is_VMS ? "Hooballa-1_00" : "Hooballa-1.00" );
+
+
+ # DISTVNAME (rt.cpan.org 43217)
+ $warnings = '';
+ eval {
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION => 1.00,
+ DISTVNAME => "Hooballoo",
+ );
+ };
+ is( $warnings, '' );
+ is( $mm->{DISTVNAME}, 'Hooballoo' );
}
diff --git a/lib/ExtUtils/t/xs.t b/lib/ExtUtils/t/xs.t
index cab52047a7..398b84ae8f 100644
--- a/lib/ExtUtils/t/xs.t
+++ b/lib/ExtUtils/t/xs.t
@@ -11,6 +11,8 @@ BEGIN {
}
chdir 't';
+use strict;
+
use Test::More;
use MakeMaker::Test::Utils;
use MakeMaker::Test::Setup::XS;
@@ -18,10 +20,12 @@ use File::Find;
use File::Spec;
use File::Path;
+my $Skipped = 0;
if( have_compiler() ) {
plan tests => 5;
}
else {
+ $Skipped = 1;
plan skip_all => "ExtUtils::CBuilder not installed or couldn't find a compiler";
}
@@ -39,8 +43,10 @@ $| = 1;
ok( setup_xs(), 'setup' );
END {
- chdir File::Spec->updir or die;
- teardown_xs(), 'teardown' or die;
+ unless( $Skipped ) {
+ chdir File::Spec->updir or die;
+ teardown_xs(), 'teardown' or die;
+ }
}
ok( chdir('XS-Test'), "chdir'd to XS-Test" ) ||
diff --git a/lib/ExtUtils/testlib.pm b/lib/ExtUtils/testlib.pm
index 268db0b686..41eaf80c03 100644
--- a/lib/ExtUtils/testlib.pm
+++ b/lib/ExtUtils/testlib.pm
@@ -3,7 +3,7 @@ package ExtUtils::testlib;
use strict;
use warnings;
-our $VERSION = 6.50;
+our $VERSION = 6.52;
use Cwd;
use File::Spec;