summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/lib/ExtUtils
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2009-10-12 18:24:18 +0000
committermillert <millert@openbsd.org>2009-10-12 18:24:18 +0000
commitdf042708019d82f10a844f81545b8510eb33a43b (patch)
treef1aa8a2977492c1084da8a9a42ad99fe382fba66 /gnu/usr.bin/perl/lib/ExtUtils
parentto support virtual domains properly, smtpd needed to have the domain stored (diff)
downloadwireguard-openbsd-df042708019d82f10a844f81545b8510eb33a43b.tar.xz
wireguard-openbsd-df042708019d82f10a844f81545b8510eb33a43b.zip
Merge in perl 5.10.1
Diffstat (limited to 'gnu/usr.bin/perl/lib/ExtUtils')
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/Command.pm35
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/Embed.pm4
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/Install.pm467
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/Liblist.pm5
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/MM_Any.pm639
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/MM_OS2.pm14
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm584
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/MM_VMS.pm286
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/MM_Win32.pm90
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/MakeMaker.pm463
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/FAQ.pod28
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/bytes.pm41
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/vmsish.pm42
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/Manifest.pm147
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/Mkbootstrap.pm31
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/Mksymlists.pm115
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/t/bytes.t30
-rwxr-xr-xgnu/usr.bin/perl/lib/ExtUtils/t/parse_version.t14
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/t/vmsish.t17
-rw-r--r--gnu/usr.bin/perl/lib/ExtUtils/testlib.pm6
20 files changed, 1949 insertions, 1109 deletions
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/Command.pm b/gnu/usr.bin/perl/lib/ExtUtils/Command.pm
index 8c9a8d0b5b3..b5632ff06d6 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/Command.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/Command.pm
@@ -12,9 +12,34 @@ use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
@ISA = qw(Exporter);
@EXPORT = qw(cp rm_f rm_rf mv cat eqtime mkpath touch test_f test_d chmod
dos2unix);
-$VERSION = '1.13';
+$VERSION = '1.16';
+
+my $Is_VMS = $^O eq 'VMS';
+my $Is_VMS_mode = $Is_VMS;
+my $Is_VMS_noefs = $Is_VMS;
+my $Is_Win32 = $^O eq 'MSWin32';
+
+if( $Is_VMS ) {
+ my $vms_unix_rpt;
+ my $vms_efs;
+ my $vms_case;
+
+ if (eval { local $SIG{__DIE__}; require VMS::Feature; }) {
+ $vms_unix_rpt = VMS::Feature::current("filename_unix_report");
+ $vms_efs = VMS::Feature::current("efs_charset");
+ $vms_case = VMS::Feature::current("efs_case_preserve");
+ } else {
+ my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
+ my $efs_charset = $ENV{'DECC$EFS_CHARSET'} || '';
+ my $efs_case = $ENV{'DECC$EFS_CASE_PRESERVE'} || '';
+ $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i;
+ $vms_efs = $efs_charset =~ /^[ET1]/i;
+ $vms_case = $efs_case =~ /^[ET1]/i;
+ }
+ $Is_VMS_mode = 0 if $vms_unix_rpt;
+ $Is_VMS_noefs = 0 if ($vms_efs);
+}
-my $Is_VMS = $^O eq 'VMS';
=head1 NAME
@@ -210,6 +235,10 @@ sub cp {
my $nok = 0;
foreach my $src (@src) {
$nok ||= !copy($src,$dst);
+
+ # Win32 does not update the mod time of a copied file, just the
+ # created time which make does not look at.
+ utime(time, time, $dst) if $Is_Win32;
}
return $nok;
}
@@ -227,7 +256,7 @@ sub chmod {
my $mode = shift(@ARGV);
expand_wildcards();
- if( $Is_VMS ) {
+ if( $Is_VMS_mode && $Is_VMS_noefs) {
foreach my $idx (0..$#ARGV) {
my $path = $ARGV[$idx];
next unless -d $path;
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/Embed.pm b/gnu/usr.bin/perl/lib/ExtUtils/Embed.pm
index dc6d5e75d6f..24ae9092f52 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/Embed.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/Embed.pm
@@ -19,7 +19,7 @@ use vars qw(@ISA @EXPORT $VERSION
use strict;
# This is not a dual-life module, so no need for development version numbers
-$VERSION = '1.27';
+$VERSION = '1.28';
@ISA = qw(Exporter);
@EXPORT = qw(&xsinit &ldopts
@@ -281,7 +281,7 @@ sub canon {
s:^(lib|ext)/(auto/)?::;
s:/\w+\.\w+$::;
}
- grep(s:/:$as:, @ext) if ($as ne '/');
+ map(s:/:$as:, @ext) if ($as ne '/');
@ext;
}
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/Install.pm b/gnu/usr.bin/perl/lib/ExtUtils/Install.pm
index d60bc6cb815..c886c69bf2e 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/Install.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/Install.pm
@@ -1,10 +1,7 @@
package ExtUtils::Install;
-use 5.00503;
use strict;
use vars qw(@ISA @EXPORT $VERSION $MUST_REBOOT %Config);
-$VERSION = '1.44';
-$VERSION = eval $VERSION;
use AutoSplit;
use Carp ();
@@ -23,6 +20,8 @@ use File::Spec;
@ISA = ('Exporter');
@EXPORT = ('install','uninstall','pm_to_blib', 'install_default');
+=pod
+
=head1 NAME
ExtUtils::Install - install files from here to there
@@ -37,6 +36,17 @@ ExtUtils::Install - install files from here to there
pm_to_blib({ 'lib/Foo/Bar.pm' => 'blib/lib/Foo/Bar.pm' });
+=head1 VERSION
+
+1.54
+
+=cut
+
+$VERSION = '1.54'; # <---- dont forget to update the POD section just above this line!
+$VERSION = eval $VERSION;
+
+=pod
+
=head1 DESCRIPTION
Handles the installing and uninstalling of perl modules, scripts, man
@@ -82,11 +92,34 @@ Dies with a special message.
=cut
my $Is_VMS = $^O eq 'VMS';
+my $Is_VMS_noefs = $Is_VMS;
my $Is_MacPerl = $^O eq 'MacOS';
my $Is_Win32 = $^O eq 'MSWin32';
my $Is_cygwin = $^O eq 'cygwin';
my $CanMoveAtBoot = ($Is_Win32 || $Is_cygwin);
+ if( $Is_VMS ) {
+ my $vms_unix_rpt;
+ my $vms_efs;
+ my $vms_case;
+
+ if (eval { local $SIG{__DIE__}; require VMS::Feature; }) {
+ $vms_unix_rpt = VMS::Feature::current("filename_unix_report");
+ $vms_efs = VMS::Feature::current("efs_charset");
+ $vms_case = VMS::Feature::current("efs_case_preserve");
+ } else {
+ my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
+ my $efs_charset = $ENV{'DECC$EFS_CHARSET'} || '';
+ my $efs_case = $ENV{'DECC$EFS_CASE_PRESERVE'} || '';
+ $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i;
+ $vms_efs = $efs_charset =~ /^[ET1]/i;
+ $vms_case = $efs_case =~ /^[ET1]/i;
+ }
+ $Is_VMS_noefs = 0 if ($vms_efs);
+ }
+
+
+
# *note* CanMoveAtBoot is only incidentally the same condition as below
# this needs not hold true in the future.
my $Has_Win32API_File = ($Is_Win32 || $Is_cygwin)
@@ -125,10 +158,11 @@ sub _chmod($$;$) {
my ( $mode, $item, $verbose )=@_;
$verbose ||= 0;
if (chmod $mode, $item) {
- print "chmod($mode, $item)\n" if $verbose > 1;
+ printf "chmod(0%o, %s)\n",$mode, $item if $verbose > 1;
} else {
my $err="$!";
- _warnonce "WARNING: Failed chmod($mode, $item): $err\n"
+ _warnonce sprintf "WARNING: Failed chmod(0%o, %s): %s\n",
+ $mode, $item, $err
if -e $item;
}
}
@@ -238,8 +272,9 @@ sub _unlink_or_rename { #XXX OS-SPECIFIC
my ( $file, $tryhard, $installing )= @_;
_chmod( 0666, $file );
- unlink $file
- and return $file;
+ my $unlink_count = 0;
+ while (unlink $file) { $unlink_count++; }
+ return $file if $unlink_count > 0;
my $error="$!";
_choke("Cannot unlink '$file': $!")
@@ -272,58 +307,10 @@ sub _unlink_or_rename { #XXX OS-SPECIFIC
}
+=pod
=head2 Functions
-=over 4
-
-=item B<install>
-
- install(\%from_to);
- install(\%from_to, $verbose, $dont_execute, $uninstall_shadows, $skip);
-
-Copies each directory tree of %from_to to its corresponding value
-preserving timestamps and permissions.
-
-There are two keys with a special meaning in the hash: "read" and
-"write". These contain packlist files. After the copying is done,
-install() will write the list of target files to $from_to{write}. If
-$from_to{read} is given the contents of this file will be merged into
-the written file. The read and the written file may be identical, but
-on AFS it is quite likely that people are installing to a different
-directory than the one where the files later appear.
-
-If $verbose is true, will print out each file removed. Default is
-false. This is "make install VERBINST=1". $verbose values going
-up to 5 show increasingly more diagnostics output.
-
-If $dont_execute is true it will only print what it was going to do
-without actually doing it. Default is false.
-
-If $uninstall_shadows is true any differing versions throughout @INC
-will be uninstalled. This is "make install UNINST=1"
-
-As of 1.37_02 install() supports the use of a list of patterns to filter
-out files that shouldn't be installed. If $skip is omitted or undefined
-then install will try to read the list from INSTALL.SKIP in the CWD.
-This file is a list of regular expressions and is just like the
-MANIFEST.SKIP file used by L<ExtUtils::Manifest>.
-
-A default site INSTALL.SKIP may be provided by setting then environment
-variable EU_INSTALL_SITE_SKIPFILE, this will only be used when there
-isn't a distribution specific INSTALL.SKIP. If the environment variable
-EU_INSTALL_IGNORE_SKIP is true then no install file filtering will be
-performed.
-
-If $skip is undefined then the skip file will be autodetected and used if it
-is found. If $skip is a reference to an array then it is assumed
-the array contains the list of patterns, if $skip is a true non reference it is
-assumed to be the filename holding the list of patterns, any other value of
-$skip is taken to mean that no install filtering should occur.
-
-
-=cut
-
=begin _private
=item _get_install_skip
@@ -383,19 +370,21 @@ sub _get_install_skip {
return $skip
}
+=pod
+
=item _have_write_access
Abstract a -w check that tries to use POSIX::access() if possible.
=cut
-
{
my $has_posix;
sub _have_write_access {
my $dir=shift;
- if (!defined $has_posix) {
- $has_posix=eval "local $^W; require POSIX; 1" || 0;
+ unless (defined $has_posix) {
+ $has_posix= (!$Is_cygwin && !$Is_Win32
+ && eval 'local $^W; require POSIX; 1') || 0;
}
if ($has_posix) {
return POSIX::access($dir, POSIX::W_OK());
@@ -405,6 +394,7 @@ Abstract a -w check that tries to use POSIX::access() if possible.
}
}
+=pod
=item _can_write_dir(C<$dir>)
@@ -431,12 +421,24 @@ sub _can_write_dir {
return
unless defined $dir and length $dir;
- my ($vol, $dirs, $file) = File::Spec->splitpath(File::Spec->rel2abs($dir),1);
+ my ($vol, $dirs, $file) = File::Spec->splitpath($dir,1);
my @dirs = File::Spec->splitdir($dirs);
+ unshift @dirs, File::Spec->curdir
+ unless File::Spec->file_name_is_absolute($dir);
+
my $path='';
my @make;
while (@dirs) {
- $dir = File::Spec->catdir($vol,@dirs);
+ if ($Is_VMS_noefs) {
+ # There is a bug in catdir that is fixed when the EFS character
+ # set is enabled, which requires this VMS specific code.
+ $dir = File::Spec->catdir($vol,@dirs);
+ }
+ else {
+ $dir = File::Spec->catdir(@dirs);
+ $dir = File::Spec->catpath($vol,$dir,'')
+ if defined $vol and length $vol;
+ }
next if ( $dir eq $path );
if ( ! -e $dir ) {
unshift @make,$dir;
@@ -453,29 +455,31 @@ sub _can_write_dir {
return 0;
}
-=item _mkpath($dir,$show,$mode,$verbose,$fake)
+=pod
+
+=item _mkpath($dir,$show,$mode,$verbose,$dry_run)
Wrapper around File::Path::mkpath() to handle errors.
If $verbose is true and >1 then additional diagnostics will be produced, also
this will force $show to true.
-If $fake is true then the directory will not be created but a check will be
+If $dry_run is true then the directory will not be created but a check will be
made to see whether it would be possible to write to the directory, or that
it would be possible to create the directory.
-If $fake is not true dies if the directory can not be created or is not
+If $dry_run is not true dies if the directory can not be created or is not
writable.
=cut
sub _mkpath {
- my ($dir,$show,$mode,$verbose,$fake)=@_;
+ my ($dir,$show,$mode,$verbose,$dry_run)=@_;
if ( $verbose && $verbose > 1 && ! -d $dir) {
$show= 1;
printf "mkpath(%s,%d,%#o)\n", $dir, $show, $mode;
}
- if (!$fake) {
+ if (!$dry_run) {
if ( ! eval { File::Path::mkpath($dir,$show,$mode); 1 } ) {
_choke("Can't create '$dir'","$@");
}
@@ -488,23 +492,26 @@ sub _mkpath {
$root ? "Do not have write permissions on '$root'"
: "Unknown Error"
);
- if ($fake) {
+ if ($dry_run) {
_warnonce @msg;
} else {
_choke @msg;
}
- } elsif ($show and $fake) {
+ } elsif ($show and $dry_run) {
print "$_\n" for @make;
}
+
}
-=item _copy($from,$to,$verbose,$fake)
+=pod
+
+=item _copy($from,$to,$verbose,$dry_run)
Wrapper around File::Copy::copy to handle errors.
If $verbose is true and >1 then additional dignostics will be emitted.
-If $fake is true then the copy will not actually occur.
+If $dry_run is true then the copy will not actually occur.
Dies if the copy fails.
@@ -512,16 +519,18 @@ Dies if the copy fails.
sub _copy {
- my ( $from, $to, $verbose, $nonono)=@_;
+ my ( $from, $to, $verbose, $dry_run)=@_;
if ($verbose && $verbose>1) {
printf "copy(%s,%s)\n", $from, $to;
}
- if (!$nonono) {
+ if (!$dry_run) {
File::Copy::copy($from,$to)
or Carp::croak( _estr "ERROR: Cannot copy '$from' to '$to': $!" );
}
}
+=pod
+
=item _chdir($from)
Wrapper around chdir to catch errors.
@@ -543,16 +552,149 @@ sub _chdir {
return $ret;
}
+=pod
+
=end _private
+=over 4
+
+=item B<install>
+
+ # deprecated forms
+ install(\%from_to);
+ install(\%from_to, $verbose, $dry_run, $uninstall_shadows,
+ $skip, $always_copy, \%result);
+
+ # recommended form as of 1.47
+ install([
+ from_to => \%from_to,
+ verbose => 1,
+ dry_run => 0,
+ uninstall_shadows => 1,
+ skip => undef,
+ always_copy => 1,
+ result => \%install_results,
+ ]);
+
+
+Copies each directory tree of %from_to to its corresponding value
+preserving timestamps and permissions.
+
+There are two keys with a special meaning in the hash: "read" and
+"write". These contain packlist files. After the copying is done,
+install() will write the list of target files to $from_to{write}. If
+$from_to{read} is given the contents of this file will be merged into
+the written file. The read and the written file may be identical, but
+on AFS it is quite likely that people are installing to a different
+directory than the one where the files later appear.
+
+If $verbose is true, will print out each file removed. Default is
+false. This is "make install VERBINST=1". $verbose values going
+up to 5 show increasingly more diagnostics output.
+
+If $dry_run is true it will only print what it was going to do
+without actually doing it. Default is false.
+
+If $uninstall_shadows is true any differing versions throughout @INC
+will be uninstalled. This is "make install UNINST=1"
+
+As of 1.37_02 install() supports the use of a list of patterns to filter out
+files that shouldn't be installed. If $skip is omitted or undefined then
+install will try to read the list from INSTALL.SKIP in the CWD. This file is
+a list of regular expressions and is just like the MANIFEST.SKIP file used
+by L<ExtUtils::Manifest>.
+
+A default site INSTALL.SKIP may be provided by setting then environment
+variable EU_INSTALL_SITE_SKIPFILE, this will only be used when there isn't a
+distribution specific INSTALL.SKIP. If the environment variable
+EU_INSTALL_IGNORE_SKIP is true then no install file filtering will be
+performed.
+
+If $skip is undefined then the skip file will be autodetected and used if it
+is found. If $skip is a reference to an array then it is assumed the array
+contains the list of patterns, if $skip is a true non reference it is
+assumed to be the filename holding the list of patterns, any other value of
+$skip is taken to mean that no install filtering should occur.
+
+B<Changes As of Version 1.47>
+
+As of version 1.47 the following additions were made to the install interface.
+Note that the new argument style and use of the %result hash is recommended.
+
+The $always_copy parameter which when true causes files to be updated
+regardles as to whether they have changed, if it is defined but false then
+copies are made only if the files have changed, if it is undefined then the
+value of the environment variable EU_INSTALL_ALWAYS_COPY is used as default.
+
+The %result hash will be populated with the various keys/subhashes reflecting
+the install. Currently these keys and their structure are:
+
+ install => { $target => $source },
+ install_fail => { $target => $source },
+ install_unchanged => { $target => $source },
+
+ install_filtered => { $source => $pattern },
+
+ uninstall => { $uninstalled => $source },
+ uninstall_fail => { $uninstalled => $source },
+
+where C<$source> is the filespec of the file being installed. C<$target> is where
+it is being installed to, and C<$uninstalled> is any shadow file that is in C<@INC>
+or C<$ENV{PERL5LIB}> or other standard locations, and C<$pattern> is the pattern that
+caused a source file to be skipped. In future more keys will be added, such as to
+show created directories, however this requires changes in other modules and must
+therefore wait.
+
+These keys will be populated before any exceptions are thrown should there be an
+error.
+
+Note that all updates of the %result are additive, the hash will not be
+cleared before use, thus allowing status results of many installs to be easily
+aggregated.
+
+B<NEW ARGUMENT STYLE>
+
+If there is only one argument and it is a reference to an array then
+the array is assumed to contain a list of key-value pairs specifying
+the options. In this case the option "from_to" is mandatory. This style
+means that you dont have to supply a cryptic list of arguments and can
+use a self documenting argument list that is easier to understand.
+
+This is now the recommended interface to install().
+
+B<RETURN>
+
+If all actions were successful install will return a hashref of the results
+as described above for the $result parameter. If any action is a failure
+then install will die, therefore it is recommended to pass in the $result
+parameter instead of using the return value. If the result parameter is
+provided then the returned hashref will be the passed in hashref.
+
=cut
sub install { #XXX OS-SPECIFIC
- my($from_to,$verbose,$nonono,$inc_uninstall,$skip) = @_;
+ my($from_to,$verbose,$dry_run,$uninstall_shadows,$skip,$always_copy,$result) = @_;
+ if (@_==1 and eval { 1+@$from_to }) {
+ my %opts = @$from_to;
+ $from_to = $opts{from_to}
+ or Carp::confess("from_to is a mandatory parameter");
+ $verbose = $opts{verbose};
+ $dry_run = $opts{dry_run};
+ $uninstall_shadows = $opts{uninstall_shadows};
+ $skip = $opts{skip};
+ $always_copy = $opts{always_copy};
+ $result = $opts{result};
+ }
+
+ $result ||= {};
$verbose ||= 0;
- $nonono ||= 0;
+ $dry_run ||= 0;
$skip= _get_install_skip($skip,$verbose);
+ $always_copy = $ENV{EU_INSTALL_ALWAYS_COPY}
+ || $ENV{EU_ALWAYS_COPY}
+ || 0
+ unless defined $always_copy;
my(%from_to) = %$from_to;
my(%pack, $dir, %warned);
@@ -568,7 +710,7 @@ sub install { #XXX OS-SPECIFIC
my $cwd = cwd();
my @found_files;
my %check_dirs;
-
+
MOD_INSTALL: foreach my $source (sort keys %from_to) {
#copy the tree to the target directory without altering
#timestamp and permission and remember for the .packlist
@@ -614,70 +756,83 @@ sub install { #XXX OS-SPECIFIC
if ( $sourcefile=~/$pat/ ) {
print "Skipping $targetfile (filtered)\n"
if $verbose>1;
+ $result->{install_filtered}{$sourcefile} = $pat;
return;
}
}
# we have to do this for back compat with old File::Finds
# and because the target is relative
- my $save_cwd = _chdir($cwd);
+ my $save_cwd = _chdir($cwd);
my $diff = 0;
- if ( -f $targetfile && -s _ == $size) {
- # We have a good chance, we can skip this one
- $diff = compare($sourcefile, $targetfile);
- } else {
+ # XXX: I wonder how useful this logic is actually -- demerphq
+ if ( $always_copy or !-f $targetfile or -s $targetfile != $size) {
$diff++;
+ } else {
+ # we might not need to copy this file
+ $diff = compare($sourcefile, $targetfile);
}
- $check_dirs{$targetdir}++
+ $check_dirs{$targetdir}++
unless -w $targetfile;
-
+
push @found_files,
[ $diff, $File::Find::dir, $origfile,
$mode, $size, $atime, $mtime,
$targetdir, $targetfile, $sourcedir, $sourcefile,
-
- ];
+
+ ];
#restore the original directory we were in when File::Find
#called us so that it doesnt get horribly confused.
- _chdir($save_cwd);
- }, $current_directory );
+ _chdir($save_cwd);
+ }, $current_directory );
_chdir($cwd);
- }
-
+ }
foreach my $targetdir (sort keys %check_dirs) {
- _mkpath( $targetdir, 0, 0755, $verbose, $nonono );
+ _mkpath( $targetdir, 0, 0755, $verbose, $dry_run );
}
foreach my $found (@found_files) {
my ($diff, $ffd, $origfile, $mode, $size, $atime, $mtime,
$targetdir, $targetfile, $sourcedir, $sourcefile)= @$found;
-
+
my $realtarget= $targetfile;
if ($diff) {
- if (-f $targetfile) {
- print "_unlink_or_rename($targetfile)\n" if $verbose>1;
- $targetfile= _unlink_or_rename( $targetfile, 'tryhard', 'install' )
- unless $nonono;
- } elsif ( ! -d $targetdir ) {
- _mkpath( $targetdir, 0, 0755, $verbose, $nonono );
- }
- print "Installing $targetfile\n";
- _copy( $sourcefile, $targetfile, $verbose, $nonono, );
- #XXX OS-SPECIFIC
- print "utime($atime,$mtime,$targetfile)\n" if $verbose>1;
- utime($atime,$mtime + $Is_VMS,$targetfile) unless $nonono>1;
+ eval {
+ if (-f $targetfile) {
+ print "_unlink_or_rename($targetfile)\n" if $verbose>1;
+ $targetfile= _unlink_or_rename( $targetfile, 'tryhard', 'install' )
+ unless $dry_run;
+ } elsif ( ! -d $targetdir ) {
+ _mkpath( $targetdir, 0, 0755, $verbose, $dry_run );
+ }
+ print "Installing $targetfile\n";
+
+ _copy( $sourcefile, $targetfile, $verbose, $dry_run, );
- $mode = 0444 | ( $mode & 0111 ? 0111 : 0 );
- $mode = $mode | 0222
- if $realtarget ne $targetfile;
- _chmod( $mode, $targetfile, $verbose );
+ #XXX OS-SPECIFIC
+ print "utime($atime,$mtime,$targetfile)\n" if $verbose>1;
+ utime($atime,$mtime + $Is_VMS,$targetfile) unless $dry_run>1;
+
+
+ $mode = 0444 | ( $mode & 0111 ? 0111 : 0 );
+ $mode = $mode | 0222
+ if $realtarget ne $targetfile;
+ _chmod( $mode, $targetfile, $verbose );
+ $result->{install}{$targetfile} = $sourcefile;
+ 1
+ } or do {
+ $result->{install_fail}{$targetfile} = $sourcefile;
+ die $@;
+ };
} else {
+ $result->{install_unchanged}{$targetfile} = $sourcefile;
print "Skipping $targetfile (unchanged)\n" if $verbose;
}
- if ( $inc_uninstall ) {
+ if ( $uninstall_shadows ) {
inc_uninstall($sourcefile,$ffd, $verbose,
- $nonono,
- $realtarget ne $targetfile ? $realtarget : "");
+ $dry_run,
+ $realtarget ne $targetfile ? $realtarget : "",
+ $result);
}
# Record the full pathname.
@@ -686,12 +841,13 @@ sub install { #XXX OS-SPECIFIC
if ($pack{'write'}) {
$dir = install_rooted_dir(dirname($pack{'write'}));
- _mkpath( $dir, 0, 0755, $verbose, $nonono );
- print "Writing $pack{'write'}\n";
- $packlist->write(install_rooted_file($pack{'write'})) unless $nonono;
+ _mkpath( $dir, 0, 0755, $verbose, $dry_run );
+ print "Writing $pack{'write'}\n" if $verbose;
+ $packlist->write(install_rooted_file($pack{'write'})) unless $dry_run;
}
_do_cleanup($verbose);
+ return $result;
}
=begin _private
@@ -767,7 +923,7 @@ reboot. A wrapper for _unlink_or_rename().
sub forceunlink {
my ( $file, $tryhard )= @_; #XXX OS-SPECIFIC
- _unlink_or_rename( $file, $tryhard );
+ _unlink_or_rename( $file, $tryhard, not("installing") );
}
=begin _undocumented
@@ -794,6 +950,7 @@ sub directory_not_empty ($) {
return $files;
}
+=pod
=item B<install_default> I<DISCOURAGED>
@@ -826,6 +983,13 @@ sub install_default {
my $INST_SCRIPT = File::Spec->catdir($Curdir,'blib','script');
my $INST_MAN1DIR = File::Spec->catdir($Curdir,'blib','man1');
my $INST_MAN3DIR = File::Spec->catdir($Curdir,'blib','man3');
+
+ my @INST_HTML;
+ if($Config{installhtmldir}) {
+ my $INST_HTMLDIR = File::Spec->catdir($Curdir,'blib','html');
+ @INST_HTML = ($INST_HTMLDIR => $Config{installhtmldir});
+ }
+
install({
read => "$Config{sitearchexp}/auto/$FULLEXT/.packlist",
write => "$Config{installsitearch}/auto/$FULLEXT/.packlist",
@@ -837,6 +1001,7 @@ sub install_default {
$INST_SCRIPT => $Config{installscript},
$INST_MAN1DIR => $Config{installman1dir},
$INST_MAN3DIR => $Config{installman3dir},
+ @INST_HTML,
},1,0,0);
}
@@ -857,9 +1022,9 @@ without actually doing it. Default is false.
=cut
sub uninstall {
- my($fil,$verbose,$nonono) = @_;
+ my($fil,$verbose,$dry_run) = @_;
$verbose ||= 0;
- $nonono ||= 0;
+ $dry_run ||= 0;
die _estr "ERROR: no packlist file found: '$fil'"
unless -f $fil;
@@ -869,27 +1034,34 @@ sub uninstall {
foreach (sort(keys(%$packlist))) {
chomp;
print "unlink $_\n" if $verbose;
- forceunlink($_,'tryhard') unless $nonono;
+ forceunlink($_,'tryhard') unless $dry_run;
}
print "unlink $fil\n" if $verbose;
- forceunlink($fil, 'tryhard') unless $nonono;
+ forceunlink($fil, 'tryhard') unless $dry_run;
_do_cleanup($verbose);
}
=begin _undocumented
-=item inc_uninstall($filepath,$libdir,$verbose,$nonono,$ignore)
+=item inc_uninstall($filepath,$libdir,$verbose,$dry_run,$ignore,$results)
Remove shadowed files. If $ignore is true then it is assumed to hold
a filename to ignore. This is used to prevent spurious warnings from
occuring when doing an install at reboot.
+We now only die when failing to remove a file that has precedence over
+our own, when our install has precedence we only warn.
+
+$results is assumed to contain a hashref which will have the keys
+'uninstall' and 'uninstall_fail' populated with keys for the files
+removed and values of the source files they would shadow.
+
=end _undocumented
=cut
sub inc_uninstall {
- my($filepath,$libdir,$verbose,$nonono,$ignore) = @_;
+ my($filepath,$libdir,$verbose,$dry_run,$ignore,$results) = @_;
my($dir);
$ignore||="";
my $file = (File::Spec->splitpath($filepath))[2];
@@ -898,11 +1070,17 @@ sub inc_uninstall {
my @PERL_ENV_LIB = split $Config{path_sep}, defined $ENV{'PERL5LIB'}
? $ENV{'PERL5LIB'} : $ENV{'PERLLIB'} || '';
- foreach $dir (@INC, @PERL_ENV_LIB, @Config{qw(archlibexp
- privlibexp
- sitearchexp
- sitelibexp)}) {
- my $canonpath = File::Spec->canonpath($dir);
+ my @dirs=( @PERL_ENV_LIB,
+ @INC,
+ @Config{qw(archlibexp
+ privlibexp
+ sitearchexp
+ sitelibexp)});
+
+ #warn join "\n","---",@dirs,"---";
+ my $seen_ours;
+ foreach $dir ( @dirs ) {
+ my $canonpath = $Is_VMS ? $dir : File::Spec->canonpath($dir);
next if $canonpath eq $Curdir;
next if $seen_dir{$canonpath}++;
my $targetfile = File::Spec->catfile($canonpath,$libdir,$file);
@@ -920,8 +1098,12 @@ sub inc_uninstall {
}
print "#$file and $targetfile differ\n" if $diff && $verbose > 1;
- next if !$diff or $targetfile eq $ignore;
- if ($nonono) {
+ if (!$diff or $targetfile eq $ignore) {
+ $seen_ours = 1;
+ next;
+ }
+ if ($dry_run) {
+ $results->{uninstall}{$targetfile} = $filepath;
if ($verbose) {
$Inc_uninstall_warn_handler ||= ExtUtils::Install::Warn->new();
$libdir =~ s|^\./||s ; # That's just cosmetics, no need to port. It looks prettier.
@@ -933,7 +1115,21 @@ sub inc_uninstall {
# if not verbose, we just say nothing
} else {
print "Unlinking $targetfile (shadowing?)\n" if $verbose;
- forceunlink($targetfile,'tryhard');
+ eval {
+ die "Fake die for testing"
+ if $ExtUtils::Install::Testing and
+ ucase(File::Spec->canonpath($ExtUtils::Install::Testing)) eq ucase($targetfile);
+ forceunlink($targetfile,'tryhard');
+ $results->{uninstall}{$targetfile} = $filepath;
+ 1;
+ } or do {
+ $results->{fail_uninstall}{$targetfile} = $filepath;
+ if ($seen_ours) {
+ warn "Failed to remove probably harmless shadow file '$targetfile'\n";
+ } else {
+ die "$@\n";
+ }
+ };
}
}
}
@@ -962,6 +1158,7 @@ sub run_filter {
close CMD or die "Filter command '$cmd' failed for $src";
}
+=pod
=item B<pm_to_blib>
@@ -1068,7 +1265,8 @@ sub DESTROY {
}
$plural = $i>1 ? "all those files" : "this file";
my $inst = (_invokant() eq 'ExtUtils::MakeMaker')
- ? ( $Config::Config{make} || 'make' ).' install UNINST=1'
+ ? ( $Config::Config{make} || 'make' ).' install'
+ . ( $Is_VMS ? '/MACRO="UNINST"=1' : ' UNINST=1' )
: './Build install uninst=1';
print "## Running '$inst' will unlink $plural for you.\n";
}
@@ -1103,6 +1301,7 @@ sub _invokant {
return $builder;
}
+=pod
=back
@@ -1123,13 +1322,23 @@ Will prevent the automatic use of INSTALL.SKIP as the install skip file.
If there is no INSTALL.SKIP file in the make directory then this value
can be used to provide a default.
+=item B<EU_INSTALL_ALWAYS_COPY>
+
+If this environment variable is true then normal install processes will
+always overwrite older identical files during the install process.
+
+Note that the alias EU_ALWAYS_COPY will be supported if EU_INSTALL_ALWAYS_COPY
+is not defined until at least the 1.50 release. Please ensure you use the
+correct EU_INSTALL_ALWAYS_COPY.
+
=back
=head1 AUTHOR
Original author lost in the mists of time. Probably the same as Makemaker.
-Production release currently maintained by demerphq C<yves at cpan.org>
+Production release currently maintained by demerphq C<yves at cpan.org>,
+extensive changes by Michael G. Schwern.
Send bug reports via http://rt.cpan.org/. Please send your
generated Makefile along with your report.
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/Liblist.pm b/gnu/usr.bin/perl/lib/ExtUtils/Liblist.pm
index 2991149fc7c..fb9977b761d 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/Liblist.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/Liblist.pm
@@ -2,12 +2,11 @@ package ExtUtils::Liblist;
use strict;
-use vars qw($VERSION @ISA);
-$VERSION = '6.42';
+our $VERSION = '6.55_02';
use File::Spec;
require ExtUtils::Liblist::Kid;
-@ISA = qw(ExtUtils::Liblist::Kid File::Spec);
+our @ISA = qw(ExtUtils::Liblist::Kid File::Spec);
# Backwards compatibility with old interface.
sub ext {
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/MM_Any.pm b/gnu/usr.bin/perl/lib/ExtUtils/MM_Any.pm
index 3b6ff53ac19..a7afe2069cf 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/MM_Any.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/MM_Any.pm
@@ -1,12 +1,12 @@
package ExtUtils::MM_Any;
use strict;
-use vars qw($VERSION @ISA);
-$VERSION = '6.42';
+our $VERSION = '6.55_02';
use Carp;
use File::Spec;
-BEGIN { @ISA = qw(File::Spec); }
+use File::Basename;
+BEGIN { our @ISA = qw(File::Spec); }
# We need $Verbose
use ExtUtils::MakeMaker qw($Verbose);
@@ -74,7 +74,7 @@ Windows, VMS, OS/2, etc...) and the rest are sub families.
Some examples:
Cygwin98 ('Unix', 'Cygwin', 'Cygwin9x')
- Windows NT ('Win32', 'WinNT')
+ Windows ('Win32')
Win98 ('Win32', 'Win9x')
Linux ('Unix', 'Linux')
MacOS X ('Unix', 'Darwin', 'MacOS', 'MacOS X')
@@ -109,6 +109,22 @@ sub os_flavor_is {
}
+=head3 can_load_xs
+
+ my $can_load_xs = $self->can_load_xs;
+
+Returns true if we have the ability to load XS.
+
+This is important because miniperl, used to build XS modules in the
+core, can not load XS.
+
+=cut
+
+sub can_load_xs {
+ return defined &DynaLoader::boot_DynaLoader ? 1 : 0;
+}
+
+
=head3 split_command
my @cmds = $MM->split_command($cmd, @args);
@@ -145,8 +161,8 @@ sub split_command {
# newline.
chomp $cmd;
- # set aside 20% for macro expansion.
- my $len_left = int($self->max_exec_len * 0.80);
+ # set aside 30% for macro expansion.
+ my $len_left = int($self->max_exec_len * 0.70);
$len_left -= length $self->_expand_macros($cmd);
do {
@@ -546,7 +562,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
@@ -566,7 +582,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
@@ -701,9 +717,8 @@ END
my @man_cmds;
foreach my $section (qw(1 3)) {
my $pods = $self->{"MAN${section}PODS"};
- my $s = $section eq '3' ? '3p' : $section;
push @man_cmds, $self->split_command(<<CMD, %$pods);
- \$(NOECHO) \$(POD2MAN) --section=$s --perm_rw=\$(PERM_RW)
+ \$(NOECHO) \$(POD2MAN) --section=$section --perm_rw=\$(PERM_RW)
CMD
}
@@ -734,55 +749,310 @@ metafile :
$(NOECHO) $(NOOP)
MAKE_FRAG
- my $prereq_pm = '';
- foreach my $mod ( sort { lc $a cmp lc $b } keys %{$self->{PREREQ_PM}} ) {
- my $ver = $self->{PREREQ_PM}{$mod};
- $prereq_pm .= sprintf "\n %-30s %s", "$mod:", $ver;
+ my @metadata = $self->metafile_data(
+ $self->{META_ADD} || {},
+ $self->{META_MERGE} || {},
+ );
+ my $meta = $self->metafile_file(@metadata);
+ my @write_meta = $self->echo($meta, 'META_new.yml');
+
+ return sprintf <<'MAKE_FRAG', join("\n\t", @write_meta);
+metafile : create_distdir
+ $(NOECHO) $(ECHO) Generating META.yml
+ %s
+ -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
+MAKE_FRAG
+
+}
+
+
+=begin private
+
+=head3 _sort_pairs
+
+ my @pairs = _sort_pairs($sort_sub, \%hash);
+
+Sorts the pairs of a hash based on keys ordered according
+to C<$sort_sub>.
+
+=end private
+
+=cut
+
+sub _sort_pairs {
+ my $sort = shift;
+ my $pairs = shift;
+ return map { $_ => $pairs->{$_} }
+ sort $sort
+ keys %$pairs;
+}
+
+
+# Taken from Module::Build::Base
+sub _hash_merge {
+ my ($self, $h, $k, $v) = @_;
+ if (ref $h->{$k} eq 'ARRAY') {
+ push @{$h->{$k}}, ref $v ? @$v : $v;
+ } elsif (ref $h->{$k} eq 'HASH') {
+ $self->_hash_merge($h->{$k}, $_, $v->{$_}) foreach keys %$v;
+ } else {
+ $h->{$k} = $v;
}
+}
- my $author_value = defined $self->{AUTHOR}
- ? "\n - $self->{AUTHOR}"
- : undef;
- # Use a list to preserve order.
- my @meta_to_mm = (
+=head3 metafile_data
+
+ my @metadata_pairs = $mm->metafile_data(\%meta_add, \%meta_merge);
+
+Returns the data which MakeMaker turns into the META.yml file.
+
+Values of %meta_add will overwrite any existing metadata in those
+keys. %meta_merge will be merged with them.
+
+=cut
+
+sub metafile_data {
+ my $self = shift;
+ my($meta_add, $meta_merge) = @_;
+
+ # The order in which standard meta keys should be written.
+ my @meta_order = qw(
+ name
+ version
+ abstract
+ author
+ license
+ distribution_type
+
+ configure_requires
+ build_requires
+ requires
+
+ resources
+
+ provides
+ no_index
+
+ generated_by
+ meta-spec
+ );
+
+ # Check the original args so we can tell between the user setting it
+ # to an empty hash and it just being initialized.
+ my $configure_requires;
+ if( $self->{ARGS}{CONFIGURE_REQUIRES} ) {
+ $configure_requires = $self->{CONFIGURE_REQUIRES};
+ } else {
+ $configure_requires = {
+ 'ExtUtils::MakeMaker' => 0,
+ };
+ }
+ my $build_requires;
+ if( $self->{ARGS}{BUILD_REQUIRES} ) {
+ $build_requires = $self->{BUILD_REQUIRES};
+ } else {
+ $build_requires = {
+ 'ExtUtils::MakeMaker' => 0,
+ };
+ }
+
+ my %meta = (
name => $self->{DISTNAME},
version => $self->{VERSION},
abstract => $self->{ABSTRACT},
- license => $self->{LICENSE},
- author => $author_value,
- generated_by =>
- "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+ license => $self->{LICENSE} || 'unknown',
distribution_type => $self->{PM} ? 'module' : 'script',
+
+ configure_requires => $configure_requires,
+
+ build_requires => $build_requires,
+
+ 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
+ },
);
- my $meta = "--- #YAML:1.0\n";
+ # The author key is required and it takes a list.
+ $meta{author} = defined $self->{AUTHOR} ? [$self->{AUTHOR}] : [];
- while( @meta_to_mm ) {
- my($key, $val) = splice @meta_to_mm, 0, 2;
+ $meta{requires} = $self->{PREREQ_PM} if defined $self->{PREREQ_PM};
+ $meta{requires}{perl} = $self->{MIN_PERL_VERSION} if $self->{MIN_PERL_VERSION};
- $val = '~' unless defined $val;
+ while( my($key, $val) = each %$meta_add ) {
+ $meta{$key} = $val;
+ }
+
+ while( my($key, $val) = each %$meta_merge ) {
+ $self->_hash_merge(\%meta, $key, $val);
+ }
+
+ my @meta_pairs;
+
+ # Put the standard keys first in the proper order.
+ for my $key (@meta_order) {
+ next unless exists $meta{$key};
+
+ push @meta_pairs, $key, delete $meta{$key};
+ }
+
+ # Then tack everything else onto the end, alpha sorted.
+ for my $key (sort {lc $a cmp lc $b} keys %meta) {
+ push @meta_pairs, $key, $meta{$key};
+ }
+
+ return @meta_pairs
+}
+
+=begin private
- $meta .= sprintf "%-20s %s\n", "$key:", $val;
+=head3 _dump_hash
+
+ $yaml = _dump_hash(\%options, %hash);
+
+Implements a fake YAML dumper for a hash given
+as a list of pairs. No quoting/escaping is done. Keys
+are supposed to be strings. Values are undef, strings,
+hash refs or array refs of strings.
+
+Supported options are:
+
+ delta => STR - indentation delta
+ use_header => BOOL - whether to include a YAML header
+ indent => STR - a string of spaces
+ default: ''
+
+ max_key_length => INT - maximum key length used to align
+ keys and values of the same hash
+ default: 20
+ key_sort => CODE - a sort sub
+ It may be undef, which means no sorting by keys
+ default: sub { lc $a cmp lc $b }
+
+ customs => HASH - special options for certain keys
+ (whose values are hashes themselves)
+ may contain: max_key_length, key_sort, customs
+
+=end private
+
+=cut
+
+sub _dump_hash {
+ croak "first argument should be a hash ref" unless ref $_[0] eq 'HASH';
+ my $options = shift;
+ my %hash = @_;
+
+ # Use a list to preserve order.
+ my @pairs;
+
+ my $k_sort
+ = exists $options->{key_sort} ? $options->{key_sort}
+ : sub { lc $a cmp lc $b };
+ if ($k_sort) {
+ croak "'key_sort' should be a coderef" unless ref $k_sort eq 'CODE';
+ @pairs = _sort_pairs($k_sort, \%hash);
+ } else { # list of pairs, no sorting
+ @pairs = @_;
+ }
+
+ my $yaml = $options->{use_header} ? "--- #YAML:1.0\n" : '';
+ my $indent = $options->{indent} || '';
+ my $k_length = min(
+ ($options->{max_key_length} || 20),
+ max(map { length($_) + 1 } grep { !ref $hash{$_} } keys %hash)
+ );
+ my $customs = $options->{customs} || {};
+
+ # printf format for key
+ my $k_format = "%-${k_length}s";
+
+ while( @pairs ) {
+ my($key, $val) = splice @pairs, 0, 2;
+ $val = '~' unless defined $val;
+ if(ref $val eq 'HASH') {
+ if ( keys %$val ) {
+ my %k_options = ( # options for recursive call
+ delta => $options->{delta},
+ use_header => 0,
+ indent => $indent . $options->{delta},
+ );
+ if (exists $customs->{$key}) {
+ my %k_custom = %{$customs->{$key}};
+ foreach my $k qw(key_sort max_key_length customs) {
+ $k_options{$k} = $k_custom{$k} if exists $k_custom{$k};
+ }
+ }
+ $yaml .= $indent . "$key:\n"
+ . _dump_hash(\%k_options, %$val);
+ }
+ else {
+ $yaml .= $indent . "$key: {}\n";
+ }
+ }
+ elsif (ref $val eq 'ARRAY') {
+ if( @$val ) {
+ $yaml .= $indent . "$key:\n";
+
+ for (@$val) {
+ croak "only nested arrays of non-refs are supported" if ref $_;
+ $yaml .= $indent . $options->{delta} . "- $_\n";
+ }
+ }
+ else {
+ $yaml .= $indent . "$key: []\n";
+ }
+ }
+ elsif( ref $val and !blessed($val) ) {
+ croak "only nested hashes, arrays and objects are supported";
+ }
+ else { # if it's an object, just stringify it
+ $yaml .= $indent . sprintf "$k_format %s\n", "$key:", $val;
+ }
};
- $meta .= <<"YAML";
-requires: $prereq_pm
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
-YAML
+ return $yaml;
- $meta .= $self->{EXTRA_META} if $self->{EXTRA_META};
+}
- my @write_meta = $self->echo($meta, 'META_new.yml');
+sub blessed {
+ return eval { $_[0]->isa("UNIVERSAL"); };
+}
- return sprintf <<'MAKE_FRAG', join("\n\t", @write_meta);
-metafile : create_distdir
- $(NOECHO) $(ECHO) Generating META.yml
- %s
- -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
-MAKE_FRAG
+sub max {
+ return (sort { $b <=> $a } @_)[0];
+}
+
+sub min {
+ return (sort { $a <=> $b } @_)[0];
+}
+
+=head3 metafile_file
+
+ my $meta_yml = $mm->metafile_file(@metadata_pairs);
+
+Turns the @metadata_pairs into YAML.
+
+This method does not implement a complete YAML dumper, being limited
+to dump a hash with values which are strings, undef's or nested hashes
+and arrays of strings. No quoting/escaping is done.
+
+=cut
+
+sub metafile_file {
+ my $self = shift;
+
+ my %dump_options = (
+ use_header => 1,
+ delta => ' ' x 4,
+ key_sort => undef,
+ );
+ return _dump_hash(\%dump_options, @_);
}
@@ -1427,7 +1697,7 @@ sub init_VERSION {
}
-=head3 init_others I<Abstract>
+=head3 init_others
$MM->init_others();
@@ -1458,12 +1728,163 @@ 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} = "";
+
+ $self->{LIBS} = $self->_fix_libs($self->{LIBS});
+
+ # Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $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;
+}
+
+
+# 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
+sub _fix_libs {
+ my($self, $libs) = @_;
+
+ return !defined $libs ? [''] :
+ !ref $libs ? [$libs] :
+ !defined $libs->[0] ? [''] :
+ $libs ;
+}
+
+
+=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>
@@ -1656,6 +2077,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
@@ -1770,6 +2244,81 @@ sub platform_constants {
return '';
}
+=begin private
+
+=head3 _PREREQ_PRINT
+
+ $self->_PREREQ_PRINT;
+
+Implements PREREQ_PRINT.
+
+Refactored out of MakeMaker->new().
+
+=end private
+
+=cut
+
+sub _PREREQ_PRINT {
+ my $self = shift;
+
+ require Data::Dumper;
+ my @what = ('PREREQ_PM');
+ push @what, 'MIN_PERL_VERSION' if $self->{MIN_PERL_VERSION};
+ push @what, 'BUILD_REQUIRES' if $self->{BUILD_REQUIRES};
+ print Data::Dumper->Dump([@{$self}{@what}], \@what);
+ exit 0;
+}
+
+
+=begin private
+
+=head3 _PRINT_PREREQ
+
+ $mm->_PRINT_PREREQ;
+
+Implements PRINT_PREREQ, a slightly different version of PREREQ_PRINT
+added by Redhat to, I think, support generating RPMs from Perl modules.
+
+Refactored out of MakeMaker->new().
+
+=end private
+
+=cut
+
+sub _PRINT_PREREQ {
+ my $self = shift;
+
+ my $prereqs= $self->_all_prereqs;
+ my @prereq = map { [$_, $prereqs->{$_}] } keys %$prereqs;
+
+ if ( $self->{MIN_PERL_VERSION} ) {
+ push @prereq, ['perl' => $self->{MIN_PERL_VERSION}];
+ }
+
+ print join(" ", map { "perl($_->[0])>=$_->[1] " }
+ sort { $a->[0] cmp $b->[0] } @prereq), "\n";
+ exit 0;
+}
+
+
+=begin private
+
+=head3 _all_prereqs
+
+ my $prereqs = $self->_all_prereqs;
+
+Returns a hash ref of both PREREQ_PM and BUILD_REQUIRES.
+
+=end private
+
+=cut
+
+sub _all_prereqs {
+ my $self = shift;
+
+ return { %{$self->{PREREQ_PM}}, %{$self->{BUILD_REQUIRES}} };
+}
+
=head1 AUTHOR
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/MM_OS2.pm b/gnu/usr.bin/perl/lib/ExtUtils/MM_OS2.pm
index 7d14ac701d4..73c1819f07e 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/MM_OS2.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/MM_OS2.pm
@@ -1,16 +1,15 @@
package ExtUtils::MM_OS2;
use strict;
-use vars qw($VERSION @ISA);
use ExtUtils::MakeMaker qw(neatvalue);
use File::Spec;
-$VERSION = '6.42';
+our $VERSION = '6.55_02';
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
-@ISA = qw(ExtUtils::MM_Any ExtUtils::MM_Unix);
+our @ISA = qw(ExtUtils::MM_Any ExtUtils::MM_Unix);
=pod
@@ -75,13 +74,12 @@ $self->{BASEEXT}.def: Makefile.PL
if ($self->{IMPORTS} && %{$self->{IMPORTS}}) {
# Make import files (needed for static build)
-d 'tmp_imp' or mkdir 'tmp_imp', 0777 or die "Can't mkdir tmp_imp";
- open IMP, '>tmpimp.imp' or die "Can't open tmpimp.imp";
- my ($name, $exp);
- while (($name, $exp)= each %{$self->{IMPORTS}}) {
+ open my $imp, '>', 'tmpimp.imp' or die "Can't open tmpimp.imp";
+ while (my($name, $exp) = each %{$self->{IMPORTS}}) {
my ($lib, $id) = ($exp =~ /(.*)\.(.*)/) or die "Malformed IMPORT `$exp'";
- print IMP "$name $lib $id ?\n";
+ print $imp "$name $lib $id ?\n";
}
- close IMP or die "Can't close tmpimp.imp";
+ close $imp or die "Can't close tmpimp.imp";
# print "emximp -o tmpimp$Config::Config{lib_ext} tmpimp.imp\n";
system "emximp -o tmpimp$Config::Config{lib_ext} tmpimp.imp"
and die "Cannot make import library: $!, \$?=$?";
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm b/gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm
index 691a890eb36..ad28b22b823 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm
@@ -1,6 +1,6 @@
package ExtUtils::MM_Unix;
-require 5.005_03; # Maybe further back, dunno
+require 5.006;
use strict;
@@ -9,39 +9,37 @@ use ExtUtils::MakeMaker::Config;
use File::Basename qw(basename dirname);
use DirHandle;
-use vars qw($VERSION @ISA
- $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos
- $Is_OSF $Is_IRIX $Is_NetBSD $Is_BSD
- $Is_SunOS4 $Is_Solaris $Is_SunOS $Is_Interix
- %Config_Override
- );
+our %Config_Override;
use ExtUtils::MakeMaker qw($Verbose neatvalue);
-$VERSION = '6.42';
+# If we make $VERSION an our variable parse_version() breaks
+use vars qw($VERSION);
+$VERSION = '6.55_02';
require ExtUtils::MM_Any;
-@ISA = qw(ExtUtils::MM_Any);
+our @ISA = qw(ExtUtils::MM_Any);
+my %Is;
BEGIN {
- $Is_OS2 = $^O eq 'os2';
- $Is_Win32 = $^O eq 'MSWin32' || $Config{osname} eq 'NetWare';
- $Is_Dos = $^O eq 'dos';
- $Is_VMS = $^O eq 'VMS';
- $Is_OSF = $^O eq 'dec_osf';
- $Is_IRIX = $^O eq 'irix';
- $Is_NetBSD = $^O eq 'netbsd';
- $Is_Interix = $^O eq 'interix';
- $Is_SunOS4 = $^O eq 'sunos';
- $Is_Solaris = $^O eq 'solaris';
- $Is_SunOS = $Is_SunOS4 || $Is_Solaris;
- $Is_BSD = ($^O =~ /^(?:free|net|open)bsd$/ or
+ $Is{OS2} = $^O eq 'os2';
+ $Is{Win32} = $^O eq 'MSWin32' || $Config{osname} eq 'NetWare';
+ $Is{Dos} = $^O eq 'dos';
+ $Is{VMS} = $^O eq 'VMS';
+ $Is{OSF} = $^O eq 'dec_osf';
+ $Is{IRIX} = $^O eq 'irix';
+ $Is{NetBSD} = $^O eq 'netbsd';
+ $Is{Interix} = $^O eq 'interix';
+ $Is{SunOS4} = $^O eq 'sunos';
+ $Is{Solaris} = $^O eq 'solaris';
+ $Is{SunOS} = $Is{SunOS4} || $Is{Solaris};
+ $Is{BSD} = ($^O =~ /^(?:free|net|open)bsd$/ or
grep( $^O eq $_, qw(bsdos interix dragonfly) )
);
}
BEGIN {
- if( $Is_VMS ) {
+ if( $Is{VMS} ) {
# For things like vmsify()
require VMS::Filespec;
VMS::Filespec->import;
@@ -162,8 +160,8 @@ sub c_o {
push @m, qq{
.C\$(OBJ_EXT):
- $command \$*.C
-} if !$Is_OS2 and !$Is_Win32 and !$Is_Dos; #Case-specific
+ $command $flags \$*.C
+} if !$Is{OS2} and !$Is{Win32} and !$Is{Dos}; #Case-specific
return join "", @m;
}
@@ -231,8 +229,7 @@ sub cflags {
echo perltype=\$perltype
echo optdebug=\$optdebug
`;
- my($line);
- foreach $line (@o){
+ foreach my $line (@o){
chomp $line;
if ($line =~ /(.*?)=\s*(.*)\s*$/){
$cflags{$1} = $2;
@@ -292,7 +289,7 @@ sub const_cccmd {
return '' unless $self->needs_linking();
return $self->{CONST_CCCMD} =
q{CCCMD = $(CC) -c $(PASTHRU_INC) $(INC) \\
- $(CCFLAGS) $(OPTIMIZE) $(COPTS) \\
+ $(CCFLAGS) $(OPTIMIZE) \\
$(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \\
$(XS_DEFINE_VERSION)};
}
@@ -308,16 +305,19 @@ sub const_config {
# --- Constants Sections ---
my($self) = shift;
- my(@m,$m);
- push(@m,"\n# These definitions are from config.sh (via $INC{'Config.pm'})\n");
- push(@m,"\n# They may have been overridden via Makefile.PL or on the command line\n");
+ my @m = <<"END";
+
+# These definitions are from config.sh (via $INC{'Config.pm'}).
+# They may have been overridden via Makefile.PL or on the command line.
+END
+
my(%once_only);
- foreach $m (@{$self->{CONFIG}}){
- # SITE*EXP macros are defined in &constants; avoid duplicates here
- next if $once_only{$m};
- $self->{uc $m} = quote_paren($self->{uc $m});
- push @m, uc($m) , ' = ' , $self->{uc $m}, "\n";
- $once_only{$m} = 1;
+ foreach my $key (@{$self->{CONFIG}}){
+ # SITE*EXP macros are defined in &constants; avoid duplicates here
+ next if $once_only{$key};
+ $self->{uc $key} = quote_paren($self->{uc $key});
+ push @m, uc($key) , ' = ' , $self->{uc $key}, "\n";
+ $once_only{$key} = 1;
}
join('', @m);
}
@@ -338,19 +338,18 @@ sub const_loadlibs {
# See ExtUtils::Liblist for details
#
};
- my($tmp);
- for $tmp (qw/
- EXTRALIBS LDLOADLIBS BSLOADLIBS
- /) {
- next unless defined $self->{$tmp};
- push @m, "$tmp = $self->{$tmp}\n";
+ for my $tmp (qw/
+ EXTRALIBS LDLOADLIBS BSLOADLIBS
+ /) {
+ next unless defined $self->{$tmp};
+ push @m, "$tmp = $self->{$tmp}\n";
}
# don't set LD_RUN_PATH if empty
- for $tmp (qw/
- LD_RUN_PATH
- /) {
- next unless $self->{$tmp};
- push @m, "$tmp = $self->{$tmp}\n";
+ for my $tmp (qw/
+ LD_RUN_PATH
+ /) {
+ next unless $self->{$tmp};
+ push @m, "$tmp = $self->{$tmp}\n";
}
return join "", @m;
}
@@ -394,7 +393,7 @@ sub constants {
PERLRUN FULLPERLRUN ABSPERLRUN
PERLRUNINST FULLPERLRUNINST ABSPERLRUNINST
PERL_CORE
- PERM_RW PERM_RWX
+ PERM_DIR PERM_RW PERM_RWX
) )
{
@@ -858,7 +857,7 @@ sub dynamic_bs {
BOOTSTRAP =
' unless $self->has_link_code();
- my $target = $Is_VMS ? '$(MMS$TARGET)' : '$@';
+ my $target = $Is{VMS} ? '$(MMS$TARGET)' : '$@';
return sprintf <<'MAKE_FRAG', ($target) x 5;
BOOTSTRAP = $(BASEEXT).bs
@@ -897,10 +896,10 @@ sub dynamic_lib {
my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
my($armaybe) = $attribs{ARMAYBE} || $self->{ARMAYBE} || ":";
my($ldfrom) = '$(LDFROM)';
- $armaybe = 'ar' if ($Is_OSF and $armaybe eq ':');
+ $armaybe = 'ar' if ($Is{OSF} and $armaybe eq ':');
my(@m);
- my $ld_opt = $Is_OS2 ? '$(OPTIMIZE) ' : ''; # Useful on other systems too?
- my $ld_fix = $Is_OS2 ? '|| ( $(RM_F) $@ && sh -c false )' : '';
+ my $ld_opt = $Is{OS2} ? '$(OPTIMIZE) ' : ''; # Useful on other systems too?
+ my $ld_fix = $Is{OS2} ? '|| ( $(RM_F) $@ && sh -c false )' : '';
push(@m,'
# This section creates the dynamically loadable $(INST_DYNAMIC)
# from $(OBJECT) and possibly $(MYEXTLIB).
@@ -916,10 +915,10 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).
push(@m,' $(ARMAYBE) cr '.$ldfrom.' $(OBJECT)'."\n");
push(@m,' $(RANLIB) '."$ldfrom\n");
}
- $ldfrom = "-all $ldfrom -none" if $Is_OSF;
+ $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 +931,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}) && $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
@@ -994,7 +993,7 @@ Finds the executables PERL and FULLPERL
sub find_perl {
my($self, $ver, $names, $dirs, $trace) = @_;
- my($name, $dir);
+
if ($trace >= 2){
print "Looking for perl $ver by these names:
@$names
@@ -1005,8 +1004,10 @@ in these dirs:
my $stderr_duped = 0;
local *STDERR_COPY;
- unless ($Is_BSD) {
- if( open(STDERR_COPY, '>&STDERR') ) {
+
+ unless ($Is{BSD}) {
+ # >& and lexical filehandles together give 5.6.2 indigestion
+ if( open(STDERR_COPY, '>&STDERR') ) { ## no critic
$stderr_duped = 1;
}
else {
@@ -1017,8 +1018,8 @@ WARNING
}
}
- foreach $name (@$names){
- foreach $dir (@$dirs){
+ foreach my $name (@$names){
+ foreach my $dir (@$dirs){
next unless defined $dir; # $self->{PERL_SRC} may be undefined
my ($abs, $val);
if ($self->file_name_is_absolute($name)) { # /foo/bar
@@ -1043,12 +1044,15 @@ WARNING
# ( http://www.freebsd.org/cgi/query-pr.cgi?pr=51535 )
# we cannot use the fancier more portable way in here
# but instead need to use the traditional 2>&1 construct.
- if ($Is_BSD) {
+ if ($Is{BSD}) {
$val = `$version_check 2>&1`;
} else {
close STDERR if $stderr_duped;
$val = `$version_check`;
- open STDERR, '>&STDERR_COPY' if $stderr_duped;
+
+ # 5.6.2's 3-arg open doesn't work with >&
+ open STDERR, ">&STDERR_COPY" ## no critic
+ if $stderr_duped;
}
if ($val =~ /^VER_OK/m) {
@@ -1080,11 +1084,9 @@ sub fixin { # stolen from the pink Camel book, more or less
my $file_new = "$file.new";
my $file_bak = "$file.bak";
- local (*FIXIN);
- local (*FIXOUT);
- open( FIXIN, $file ) or croak "Can't process '$file': $!";
+ open( my $fixin, '<', $file ) or croak "Can't process '$file': $!";
local $/ = "\n";
- chomp( my $line = <FIXIN> );
+ chomp( my $line = <$fixin> );
next unless $line =~ s/^\s*\#!\s*//; # Not a shbang file.
# Now figure out the interpreter name.
my ( $cmd, $arg ) = split ' ', $line, 2;
@@ -1092,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,^\#!,,;
@@ -1103,10 +1105,10 @@ 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 = '';
- my ($dir);
- foreach $dir (@absdirs) {
+
+ foreach my $dir (@absdirs) {
if ( $self->maybe_command($cmd) ) {
warn "Ignoring $interpreter in $file\n"
if $Verbose && $interpreter;
@@ -1131,7 +1133,7 @@ sub fixin { # stolen from the pink Camel book, more or less
$shb .= qq{
eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}'
if 0; # not running under some shell
-} unless $Is_Win32; # this won't work on win32, so don't
+} unless $Is{Win32}; # this won't work on win32, so don't
}
else {
warn "Can't find $cmd in PATH, $file unchanged"
@@ -1139,17 +1141,17 @@ eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}'
next;
}
- unless ( open( FIXOUT, ">$file_new" ) ) {
+ open( my $fixout, ">", "$file_new" ) or do {
warn "Can't create new $file: $!\n";
next;
- }
+ };
# Print out the new #! line (or equivalent).
local $\;
local $/;
- print FIXOUT $shb, <FIXIN>;
- close FIXIN;
- close FIXOUT;
+ print $fixout $shb, <$fixin>;
+ close $fixin;
+ close $fixout;
chmod 0666, $file_bak;
unlink $file_bak;
@@ -1168,7 +1170,6 @@ eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}'
unlink $file_bak;
}
continue {
- close(FIXIN) if fileno(FIXIN);
system("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
}
}
@@ -1178,7 +1179,7 @@ sub _rename {
my($old, $new) = @_;
foreach my $file ($old, $new) {
- if( $Is_VMS and basename($file) !~ /\./ ) {
+ if( $Is{VMS} and basename($file) !~ /\./ ) {
# rename() in 5.8.0 on VMS will not rename a file if it
# does not contain a dot yet it returns success.
$file = "$file.";
@@ -1254,17 +1255,17 @@ Called by init_main.
sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
my($self) = @_;
- my($name, %dir, %xs, %c, %h, %pl_files, %pm);
+ my(%dir, %xs, %c, %h, %pl_files, %pm);
my %ignore = map {( $_ => 1 )} qw(Makefile.PL Build.PL test.pl t);
# ignore the distdir
- $Is_VMS ? $ignore{"$self->{DISTVNAME}.dir"} = 1
+ $Is{VMS} ? $ignore{"$self->{DISTVNAME}.dir"} = 1
: $ignore{$self->{DISTVNAME}} = 1;
- @ignore{map lc, keys %ignore} = values %ignore if $Is_VMS;
+ @ignore{map lc, keys %ignore} = values %ignore if $Is{VMS};
- foreach $name ($self->lsdir($Curdir)){
+ foreach my $name ($self->lsdir($Curdir)){
next if $name =~ /\#/;
next if $name eq $Curdir or $name eq $Updir or $ignore{$name};
next unless $self->libscan($name);
@@ -1283,14 +1284,14 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
$h{$name} = 1;
} elsif ($name =~ /\.PL\z/) {
($pl_files{$name} = $name) =~ s/\.PL\z// ;
- } elsif (($Is_VMS || $Is_Dos) && $name =~ /[._]pl$/i) {
+ } elsif (($Is{VMS} || $Is{Dos}) && $name =~ /[._]pl$/i) {
# case-insensitive filesystem, one dot per name, so foo.h.PL
# under Unix appears as foo.h_pl under VMS or fooh.pl on Dos
- local($/); open(PL,$name); my $txt = <PL>; close PL;
+ local($/); open(my $pl, '<', $name); my $txt = <$pl>; close $pl;
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/){
@@ -1322,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"} ||= {};
@@ -1330,7 +1331,7 @@ sub init_MANPODS {
else {
my $init_method = "init_${man}PODS";
$self->$init_method();
- }
+ }
}
}
@@ -1338,19 +1339,18 @@ sub init_MANPODS {
sub _has_pod {
my($self, $file) = @_;
- local *FH;
my($ispod)=0;
- if (open(FH,"<$file")) {
- while (<FH>) {
- if (/^=(?:head\d+|item|pod)\b/) {
- $ispod=1;
- last;
- }
- }
- close FH;
+ if (open( my $fh, '<', $file )) {
+ while (<$fh>) {
+ if (/^=(?:head\d+|item|pod)\b/) {
+ $ispod=1;
+ last;
+ }
+ }
+ close $fh;
} else {
- # If it doesn't exist yet, we assume, it has pods in it
- $ispod = 1;
+ # If it doesn't exist yet, we assume, it has pods in it
+ $ispod = 1;
}
return $ispod;
@@ -1461,7 +1461,7 @@ sub init_PM {
# that's important for nested modules.
unless( $self->{PMLIBDIRS} ) {
- if( $Is_VMS ) {
+ if( $Is{VMS} ) {
# Avoid logical name vs directory collisions
$self->{PMLIBDIRS} = ['./lib', "./$self->{BASEEXT}"];
}
@@ -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};
@@ -1596,7 +1597,7 @@ sub init_main {
if (-f $self->catfile($dir,"config_h.SH") &&
-f $self->catfile($dir,"perl.h") &&
- -f $self->catfile($dir,"lib","Exporter.pm")
+ -f $self->catfile($dir,"lib","strict.pm")
) {
$self->{PERL_SRC}=$dir ;
last;
@@ -1615,11 +1616,11 @@ sub init_main {
$self->catdir("$self->{PERL_SRC}","xlib",$Cross::platform);
$self->{PERL_INC} =
$self->catdir("$self->{PERL_SRC}","xlib",$Cross::platform,
- $Is_Win32?("CORE"):());
+ $Is{Win32}?("CORE"):());
}
else {
$self->{PERL_ARCHLIB} = $self->{PERL_LIB};
- $self->{PERL_INC} = ($Is_Win32) ?
+ $self->{PERL_INC} = ($Is{Win32}) ?
$self->catdir($self->{PERL_LIB},"CORE") : $self->{PERL_SRC};
}
@@ -1627,11 +1628,11 @@ sub init_main {
unless (
-s $self->catfile($self->{PERL_SRC},'cflags')
or
- $Is_VMS
+ $Is{VMS}
&&
-s $self->catfile($self->{PERL_SRC},'perlshr_attr.opt')
or
- $Is_Win32
+ $Is{Win32}
){
warn qq{
You cannot build extensions below the perl source tree after executing
@@ -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" )
+ 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;
@@ -1693,17 +1694,17 @@ EOP
# Get some stuff out of %Config if we haven't yet done so
print STDOUT "CONFIG must be an array ref\n"
- if ($self->{CONFIG} and ref $self->{CONFIG} ne 'ARRAY');
+ if ($self->{CONFIG} and ref $self->{CONFIG} ne 'ARRAY');
$self->{CONFIG} = [] unless (ref $self->{CONFIG});
push(@{$self->{CONFIG}}, @ExtUtils::MakeMaker::Get_from_Config);
push(@{$self->{CONFIG}}, 'shellflags') if $Config{shellflags};
my(%once_only);
foreach my $m (@{$self->{CONFIG}}){
- next if $once_only{$m};
- print STDOUT "CONFIG key '$m' does not exist in Config.pm\n"
- unless exists $Config{$m};
- $self->{uc $m} ||= $Config{$m};
- $once_only{$m} = 1;
+ next if $once_only{$m};
+ print STDOUT "CONFIG key '$m' does not exist in Config.pm\n"
+ unless exists $Config{$m};
+ $self->{uc $m} ||= $Config{$m};
+ $once_only{$m} = 1;
}
# This is too dangerous:
@@ -1723,11 +1724,11 @@ EOP
$self->{LIBPERL_A} ||= "libperl$self->{LIB_EXT}";
- # make a simple check if we find Exporter
+ # make a simple check if we find strict
warn "Warning: PERL_LIB ($self->{PERL_LIB}) seems not to be a perl library directory
- (Exporter.pm not found)"
- unless -f $self->catfile("$self->{PERL_LIB}","Exporter.pm") ||
- $self->{NAME} eq "ExtUtils::MakeMaker";
+ (strict.pm not found)"
+ unless -f $self->catfile("$self->{PERL_LIB}","strict.pm") ||
+ $self->{NAME} eq "ExtUtils::MakeMaker";
}
=item init_others
@@ -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} = "";
- my($libs);
- foreach $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;
}
@@ -1931,7 +1858,7 @@ sub init_PERL {
my $thisperl = $self->canonpath($^X);
$thisperl .= $Config{exe_ext} unless
# VMS might have a file version # at the end
- $Is_VMS ? $thisperl =~ m/$Config{exe_ext}(;\d+)?$/i
+ $Is{VMS} ? $thisperl =~ m/$Config{exe_ext}(;\d+)?$/i
: $thisperl =~ m/$Config{exe_ext}$/i;
# We need a relative path to perl when in the core.
@@ -1958,7 +1885,7 @@ 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
@@ -1976,6 +1903,11 @@ sub init_PERL {
}
else {
$self->{ABSPERL} = $self->rel2abs($self->{ABSPERL});
+
+ # Quote the perl command if it contains whitespace
+ $self->{ABSPERL} = $self->quote_literal($self->{ABSPERL})
+ if $self->{ABSPERL} =~ /\s/;
+
$self->{ABSPERL} = 'MCR '.$self->{ABSPERL} if $has_mcr;
}
@@ -2044,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};
@@ -2088,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
@@ -2112,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{ \
@@ -2126,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{ \
@@ -2139,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{ \
@@ -2150,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) \
@@ -2161,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) \
@@ -2172,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) \
@@ -2215,7 +2148,7 @@ sub installbin {
my @exefiles = @{$self->{EXE_FILES}};
return "" unless @exefiles;
- @exefiles = map vmsify($_), @exefiles if $Is_VMS;
+ @exefiles = map vmsify($_), @exefiles if $Is{VMS};
my %fromto;
for my $from (@exefiles) {
@@ -2225,7 +2158,7 @@ sub installbin {
my $to = $self->libscan($path);
print "libscan($from) => '$to'\n" if ($Verbose >=2);
- $to = vmsify($to) if $Is_VMS;
+ $to = vmsify($to) if $Is{VMS};
$fromto{$from} = $to;
}
my @to = values %fromto;
@@ -2399,16 +2332,14 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib
if( exists $self->{INCLUDE_EXT} ){
my $found = 0;
- my $incl;
- my $xx;
- ($xx = $File::Find::name) =~ s,.*?/auto/,,s;
+ (my $xx = $File::Find::name) =~ s,.*?/auto/,,s;
$xx =~ s,/?$_,,;
$xx =~ s,/,::,g;
# Throw away anything not explicitly marked for inclusion.
# DynaLoader is implied.
- foreach $incl ((@{$self->{INCLUDE_EXT}},'DynaLoader')){
+ foreach my $incl ((@{$self->{INCLUDE_EXT}},'DynaLoader')){
if( $xx eq $incl ){
$found++;
last;
@@ -2417,15 +2348,12 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib
return unless $found;
}
elsif( exists $self->{EXCLUDE_EXT} ){
- my $excl;
- my $xx;
-
- ($xx = $File::Find::name) =~ s,.*?/auto/,,s;
+ (my $xx = $File::Find::name) =~ s,.*?/auto/,,s;
$xx =~ s,/?$_,,;
$xx =~ s,/,::,g;
# Throw away anything explicitly marked for exclusion
- foreach $excl (@{$self->{EXCLUDE_EXT}}){
+ foreach my $excl (@{$self->{EXCLUDE_EXT}}){
return if( $xx eq $excl );
}
}
@@ -2453,7 +2381,7 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib
push @$extra, $_;
}
- grep(s/^(.*)/"-I$1"/, @{$perlinc || []});
+ s/^(.*)/"-I$1"/ for @{$perlinc || []};
$target ||= "perl";
$tmp ||= ".";
@@ -2483,10 +2411,10 @@ MAP_PRELIBS = $Config{perllibs} $Config{cryptlib}
if (! -f $libperl and ! -f $lperl) {
# We did not find a static libperl. Maybe there is a shared one?
- if ($Is_SunOS) {
+ if ($Is{SunOS}) {
$lperl = $libperl = "$dir/$Config{libperl}";
# SUNOS ld does not take the full path to a shared library
- $libperl = '' if $Is_SunOS4;
+ $libperl = '' if $Is{SunOS4};
}
}
@@ -2510,8 +2438,7 @@ $(INST_ARCHAUTODIR)/extralibs.all : $(INST_ARCHAUTODIR)$(DFSEP).exists '.join("
$(NOECHO) $(TOUCH) $@
';
- my $catfile;
- foreach $catfile (@$extra){
+ foreach my $catfile (@$extra){
push @m, "\tcat $catfile >> \$\@\n";
}
@@ -2583,7 +2510,7 @@ $(OBJECT) : $(FIRST_MAKEFILE)
' if $self->{OBJECT};
- my $newer_than_target = $Is_VMS ? '$(MMS$SOURCE_LIST)' : '$?';
+ 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;
@@ -2598,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
@@ -2628,8 +2555,8 @@ also has_link_code())
sub needs_linking {
my($self) = shift;
- my($child,$caller);
- $caller = (caller(0))[3];
+
+ my $caller = (caller(0))[3];
confess("needs_linking called too early") if
$caller =~ /^ExtUtils::MakeMaker::/;
return $self->{NEEDS_LINKING} if defined $self->{NEEDS_LINKING};
@@ -2637,7 +2564,7 @@ sub needs_linking {
$self->{NEEDS_LINKING} = 1;
return 1;
}
- foreach $child (keys %{$self->{CHILDREN}}) {
+ foreach my $child (keys %{$self->{CHILDREN}}) {
if ($self->{CHILDREN}->{$child}->needs_linking) {
$self->{NEEDS_LINKING} = 1;
return 1;
@@ -2656,13 +2583,13 @@ parse a file and return what you think is the ABSTRACT
sub parse_abstract {
my($self,$parsefile) = @_;
my $result;
- local *FH;
+
local $/ = "\n";
- open(FH,$parsefile) or die "Could not open '$parsefile': $!";
+ open(my $fh, '<', $parsefile) or die "Could not open '$parsefile': $!";
my $inpod = 0;
my $package = $self->{DISTNAME};
$package =~ s/-/::/g;
- while (<FH>) {
+ while (<$fh>) {
$inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod;
next if !$inpod;
chop;
@@ -2670,7 +2597,8 @@ sub parse_abstract {
$result = $2;
last;
}
- close FH;
+ close $fh;
+
return $result;
}
@@ -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);
@@ -2692,16 +2621,17 @@ parse_version() will try to C<use version> before checking for C<$VERSION> so th
sub parse_version {
my($self,$parsefile) = @_;
my $result;
- local *FH;
+
local $/ = "\n";
local $_;
- open(FH,$parsefile) or die "Could not open '$parsefile': $!";
+ open(my $fh, '<', $parsefile) or die "Could not open '$parsefile': $!";
my $inpod = 0;
- while (<FH>) {
+ while (<$fh>) {
$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;
@@ -2718,14 +2648,15 @@ sub parse_version {
\$$2=undef;
do {
$_
- }; \$$2
+ };
+ \$$2;
};
local $^W = 0;
- $result = eval($eval);
+ $result = eval($eval); ## no critic
warn "Could not eval '$eval' in $parsefile: $@" if $@;
- last;
+ last if defined $result;
}
- close FH;
+ close $fh;
$result = "undef" unless defined $result;
return $result;
@@ -2741,13 +2672,13 @@ subdirectories.
sub pasthru {
my($self) = shift;
- my(@m,$key);
+ my(@m);
my(@pasthru);
- my($sep) = $Is_VMS ? ',' : '';
+ my($sep) = $Is{VMS} ? ',' : '';
$sep .= "\\\n\t";
- foreach $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE
+ foreach my $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE
PREFIX INSTALL_BASE)
)
{
@@ -2755,7 +2686,7 @@ sub pasthru {
push @pasthru, "$key=\"\$($key)\"";
}
- foreach $key (qw(DEFINE INC)) {
+ foreach my $key (qw(DEFINE INC)) {
next unless defined $self->{$key};
push @pasthru, "PASTHRU_$key=\"\$(PASTHRU_$key)\"";
}
@@ -2796,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"
@@ -2858,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
@@ -2898,11 +2800,12 @@ sub pm_to_blib {
my $self = shift;
my($autodir) = $self->catdir('$(INST_LIB)','auto');
my $r = q{
-pm_to_blib : $(TO_INST_PM)
+pm_to_blib : $(FIRST_MAKEFILE) $(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}});
@@ -2946,6 +2849,14 @@ sub postamble {
"";
}
+# transform dot-separated version string into comma-separated quadruple
+# examples: '1.2.3.4.5' => '1,2,3,4'
+# '1.2.3' => '1,2,3,0'
+sub _ppd_version {
+ my ($self, $string) = @_;
+ return join ',', ((split /\./, $string), (0) x 4)[0..3];
+}
+
=item ppd
Defines target that creates a PPD (Perl Package Description) file
@@ -2956,8 +2867,6 @@ for a binary distribution.
sub ppd {
my($self) = @_;
- my ($pack_ver) = join ",", (split (/\./, $self->{VERSION}), (0)x4)[0..3];
-
my $abstract = $self->{ABSTRACT} || '';
$abstract =~ s/\n/\\n/sg;
$abstract =~ s/</&lt;/g;
@@ -2967,23 +2876,36 @@ 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
$ppd_xml .= " <IMPLEMENTATION>\n";
- foreach my $prereq (sort keys %{$self->{PREREQ_PM}}) {
- my $pre_req = $prereq;
- $pre_req =~ s/::/-/g;
- my ($dep_ver) = join ",", (split (/\./, $self->{PREREQ_PM}{$prereq}),
- (0) x 4) [0 .. 3];
- $ppd_xml .= sprintf <<'PPD_OUT', $pre_req, $dep_ver;
- <DEPENDENCY NAME="%s" VERSION="%s" />
-PPD_OUT
+ if ( $self->{MIN_PERL_VERSION} ) {
+ my $min_perl_version = $self->_ppd_version($self->{MIN_PERL_VERSION});
+ $ppd_xml .= sprintf <<'PPD_PERLVERS', $min_perl_version;
+ <PERLCORE VERSION="%s" />
+PPD_PERLVERS
+
+ }
+
+ # 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};
@@ -2991,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
@@ -3065,7 +2986,7 @@ sub prefixify {
print STDERR " prefixify $var => $path\n" if $Verbose >= 2;
print STDERR " from $sprefix to $rprefix\n" if $Verbose >= 2;
- if( $self->{ARGS}{PREFIX} && $self->file_name_is_absolute($path) &&
+ if( $self->{ARGS}{PREFIX} &&
$path !~ s{^\Q$sprefix\E\b}{$rprefix}s )
{
@@ -3099,7 +3020,7 @@ sub processPL {
: [$pl_files->{$plfile}];
foreach my $target (@$list) {
- if( $Is_VMS ) {
+ if( $Is{VMS} ) {
$plfile = vmsify($self->eliminate_macros($plfile));
$target = vmsify($self->eliminate_macros($target));
}
@@ -3388,11 +3309,11 @@ Defines targets to process subdirectories.
sub subdirs {
# --- Sub-directory Sections ---
my($self) = shift;
- my(@m,$dir);
+ my(@m);
# This method provides a mechanism to automatically deal with
# subdirectories containing further Makefile.PL scripts.
# It calls the subdir_x() method for each subdirectory.
- foreach $dir (@{$self->{DIR}}){
+ foreach my $dir (@{$self->{DIR}}){
push(@m, $self->subdir_x($dir));
#### print "Including $dir subdirectory\n";
}
@@ -3508,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.
@@ -3568,23 +3455,22 @@ sub tool_xsubpp {
my $tmdir = File::Spec->catdir($self->{PERL_LIB},"ExtUtils");
my(@tmdeps) = $self->catfile($tmdir,'typemap');
if( $self->{TYPEMAPS} ){
- my $typemap;
- foreach $typemap (@{$self->{TYPEMAPS}}){
- if( ! -f $typemap ){
- warn "Typemap $typemap not found.\n";
- }
- else{
- push(@tmdeps, $typemap);
- }
- }
+ foreach my $typemap (@{$self->{TYPEMAPS}}){
+ if( ! -f $typemap ) {
+ warn "Typemap $typemap not found.\n";
+ }
+ else {
+ push(@tmdeps, $typemap);
+ }
+ }
}
push(@tmdeps, "typemap") if -f "typemap";
my(@tmargs) = map("-typemap $_", @tmdeps);
if( exists $self->{XSOPT} ){
- unshift( @tmargs, $self->{XSOPT} );
+ unshift( @tmargs, $self->{XSOPT} );
}
- if ($Is_VMS &&
+ if ($Is{VMS} &&
$Config{'ldflags'} &&
$Config{'ldflags'} =~ m!/Debug!i &&
(!exists($self->{XSOPT}) || $self->{XSOPT} !~ /linenumbers/)
@@ -3641,7 +3527,7 @@ sub top_targets {
pure_all :: config pm_to_blib subdirs linkext
$(NOECHO) $(NOOP)
-subdirs ::
+subdirs :: $(MYEXTLIB)
$(NOECHO) $(NOOP)
config :: $(FIRST_MAKEFILE) blibdirs
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/MM_VMS.pm b/gnu/usr.bin/perl/lib/ExtUtils/MM_VMS.pm
index 3b47470264c..492a12071a4 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/MM_VMS.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/MM_VMS.pm
@@ -15,17 +15,14 @@ BEGIN {
use File::Basename;
-# $Revision can't be on the same line or SVN/K gets confused
-use vars qw($Revision
- $VERSION @ISA);
-$VERSION = '6.42';
+our $VERSION = '6.55_02';
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
-@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
+our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
use ExtUtils::MakeMaker qw($Verbose neatvalue);
-$Revision = $ExtUtils::MakeMaker::Revision;
+our $Revision = $ExtUtils::MakeMaker::Revision;
=head1 NAME
@@ -107,7 +104,7 @@ package name.
sub guess_name {
my($self) = @_;
- my($defname,$defpm,@pm,%xs,$pm);
+ my($defname,$defpm,@pm,%xs);
local *PM;
$defname = basename(fileify($ENV{'DEFAULT'}));
@@ -118,19 +115,20 @@ sub guess_name {
# extension's name. We'll use the name of a unique .pm file, or the
# first .pm file with a matching .xs file.
if (not -e "${defpm}.pm") {
- @pm = map { s/.pm$//; $_ } glob('*.pm');
+ @pm = glob('*.pm');
+ s/.pm$// for @pm;
if (@pm == 1) { ($defpm = $pm[0]) =~ s/.pm$//; }
elsif (@pm) {
- %xs = map { s/.xs$//; ($_,1) } glob('*.xs');
+ %xs = map { s/.xs$//; ($_,1) } glob('*.xs'); ## no critic
if (keys %xs) {
- foreach $pm (@pm) {
+ foreach my $pm (@pm) {
$defpm = $pm, last if exists $xs{$pm};
}
}
}
}
- if (open(PM,"${defpm}.pm")){
- while (<PM>) {
+ if (open(my $pm, '<', "${defpm}.pm")){
+ while (<$pm>) {
if (/^\s*package\s+([^;]+)/i) {
$defname = $1;
last;
@@ -138,8 +136,8 @@ sub guess_name {
}
print STDOUT "Warning (non-fatal): Couldn't find package name in ${defpm}.pm;\n\t",
"defaulting package name to $defname\n"
- if eof(PM);
- close PM;
+ if eof($pm);
+ close $pm;
}
else {
print STDOUT "Warning (non-fatal): Couldn't find ${defpm}.pm;\n\t",
@@ -158,7 +156,7 @@ invoke Perl images.
sub find_perl {
my($self, $ver, $names, $dirs, $trace) = @_;
- my($name,$dir,$vmsfile,@sdirs,@snames,@cand);
+ my($vmsfile,@sdirs,@snames,@cand);
my($rslt);
my($inabs) = 0;
local *TCF;
@@ -190,36 +188,40 @@ sub find_perl {
}
# Image names containing Perl version use '_' instead of '.' under VMS
- foreach $name (@snames) { $name =~ s/\.(\d+)$/_$1/; }
+ s/\.(\d+)$/_$1/ for @snames;
if ($trace >= 2){
- print "Looking for perl $ver by these names:\n";
- print "\t@snames,\n";
- print "in these dirs:\n";
- print "\t@sdirs\n";
+ print "Looking for perl $ver by these names:\n";
+ print "\t@snames,\n";
+ print "in these dirs:\n";
+ print "\t@sdirs\n";
}
- foreach $dir (@sdirs){
- next unless defined $dir; # $self->{PERL_SRC} may be undefined
- $inabs++ if $self->file_name_is_absolute($dir);
- if ($inabs == 1) {
- # We've covered relative dirs; everything else is an absolute
- # dir (probably an installed location). First, we'll try potential
- # command names, to see whether we can avoid a long MCR expression.
- foreach $name (@snames) { push(@cand,$name) if $name =~ /^[\w\-\$]+$/; }
- $inabs++; # Should happen above in next $dir, but just in case . . .
- }
- foreach $name (@snames){
- if ($name !~ m![/:>\]]!) { push(@cand,$self->catfile($dir,$name)); }
- else { push(@cand,$self->fixpath($name,0)); }
- }
+ foreach my $dir (@sdirs){
+ next unless defined $dir; # $self->{PERL_SRC} may be undefined
+ $inabs++ if $self->file_name_is_absolute($dir);
+ if ($inabs == 1) {
+ # We've covered relative dirs; everything else is an absolute
+ # dir (probably an installed location). First, we'll try
+ # potential command names, to see whether we can avoid a long
+ # MCR expression.
+ foreach my $name (@snames) {
+ push(@cand,$name) if $name =~ /^[\w\-\$]+$/;
+ }
+ $inabs++; # Should happen above in next $dir, but just in case...
+ }
+ foreach my $name (@snames){
+ push @cand, ($name !~ m![/:>\]]!) ? $self->catfile($dir,$name)
+ : $self->fixpath($name,0);
+ }
}
- foreach $name (@cand) {
- print "Checking $name\n" if ($trace >= 2);
- # If it looks like a potential command, try it without the MCR
+ foreach my $name (@cand) {
+ print "Checking $name\n" if $trace >= 2;
+ # If it looks like a potential command, try it without the MCR
if ($name =~ /^[\w\-\$]+$/) {
- open(TCF,">temp_mmvms.com") || die('unable to open temp file');
- print TCF "\$ set message/nofacil/nosever/noident/notext\n";
- print TCF "\$ $name -e \"require $ver; print \"\"VER_OK\\n\"\"\"\n";
- close TCF;
+ open(my $tcf, ">", "temp_mmvms.com")
+ or die('unable to open temp file');
+ print $tcf "\$ set message/nofacil/nosever/noident/notext\n";
+ print $tcf "\$ $name -e \"require $ver; print \"\"VER_OK\\n\"\"\"\n";
+ close $tcf;
$rslt = `\@temp_mmvms.com` ;
unlink('temp_mmvms.com');
if ($rslt =~ /VER_OK/) {
@@ -227,19 +229,20 @@ sub find_perl {
return $name;
}
}
- next unless $vmsfile = $self->maybe_command($name);
- $vmsfile =~ s/;[\d\-]*$//; # Clip off version number; we can use a newer version as well
- print "Executing $vmsfile\n" if ($trace >= 2);
- open(TCF,">temp_mmvms.com") || die('unable to open temp file');
- print TCF "\$ set message/nofacil/nosever/noident/notext\n";
- print TCF "\$ mcr $vmsfile -e \"require $ver; print \"\"VER_OK\\n\"\"\" \n";
- close TCF;
+ next unless $vmsfile = $self->maybe_command($name);
+ $vmsfile =~ s/;[\d\-]*$//; # Clip off version number; we can use a newer version as well
+ print "Executing $vmsfile\n" if ($trace >= 2);
+ open(my $tcf, '>', "temp_mmvms.com")
+ or die('unable to open temp file');
+ print $tcf "\$ set message/nofacil/nosever/noident/notext\n";
+ print $tcf "\$ mcr $vmsfile -e \"require $ver; print \"\"VER_OK\\n\"\"\" \n";
+ close $tcf;
$rslt = `\@temp_mmvms.com`;
unlink('temp_mmvms.com');
if ($rslt =~ /VER_OK/) {
- print "Using PERL=MCR $vmsfile\n" if $trace;
- return "MCR $vmsfile";
- }
+ print "Using PERL=MCR $vmsfile\n" if $trace;
+ return "MCR $vmsfile";
+ }
}
print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
0; # false and not empty
@@ -261,20 +264,20 @@ sub maybe_command {
return $file if -x $file && ! -d _;
my(@dirs) = ('');
my(@exts) = ('',$Config{'exe_ext'},'.exe','.com');
- my($dir,$ext);
+
if ($file !~ m![/:>\]]!) {
- for (my $i = 0; defined $ENV{"DCL\$PATH;$i"}; $i++) {
- $dir = $ENV{"DCL\$PATH;$i"};
- $dir .= ':' unless $dir =~ m%[\]:]$%;
- push(@dirs,$dir);
- }
- push(@dirs,'Sys$System:');
- foreach $dir (@dirs) {
- my $sysfile = "$dir$file";
- foreach $ext (@exts) {
- return $file if -x "$sysfile$ext" && ! -d _;
- }
- }
+ for (my $i = 0; defined $ENV{"DCL\$PATH;$i"}; $i++) {
+ my $dir = $ENV{"DCL\$PATH;$i"};
+ $dir .= ':' unless $dir =~ m%[\]:]$%;
+ push(@dirs,$dir);
+ }
+ push(@dirs,'Sys$System:');
+ foreach my $dir (@dirs) {
+ my $sysfile = "$dir$file";
+ foreach my $ext (@exts) {
+ return $file if -x "$sysfile$ext" && ! -d _;
+ }
+ }
}
return 0;
}
@@ -369,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});
}
}
@@ -447,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');
@@ -466,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} = '! ';
@@ -849,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)
@@ -954,35 +949,38 @@ $(BASEEXT).opt : Makefile.PL
? uc($self->{BASEEXT}) :'$(BASEEXT)');
}
else { # We don't have a "main" object file, so pull 'em all in
- # Upcase module names if linker is being case-sensitive
- my($upcase) = $Config{d_vms_case_sensitive_symbols};
- my(@omods) = map { s/\.[^.]*$//; # Trim off file type
- s[\$\(\w+_EXT\)][]; # even as a macro
- s/.*[:>\/\]]//; # Trim off dir spec
- $upcase ? uc($_) : $_;
- } split ' ', $self->eliminate_macros($self->{OBJECT});
- my($tmp,@lines,$elt) = '';
- $tmp = shift @omods;
- foreach $elt (@omods) {
- $tmp .= ",$elt";
- if (length($tmp) > 80) { push @lines, $tmp; $tmp = ''; }
- }
- push @lines, $tmp;
- push @m, '(', join( qq[, -\\n\\t"";" >>\$(MMS\$TARGET)\n\t\$(PERL) -e "print ""], @lines),')';
+ # Upcase module names if linker is being case-sensitive
+ my($upcase) = $Config{d_vms_case_sensitive_symbols};
+ my(@omods) = split ' ', $self->eliminate_macros($self->{OBJECT});
+ for (@omods) {
+ s/\.[^.]*$//; # Trim off file type
+ s[\$\(\w+_EXT\)][]; # even as a macro
+ s/.*[:>\/\]]//; # Trim off dir spec
+ $_ = uc if $upcase;
+ };
+
+ my(@lines);
+ my $tmp = shift @omods;
+ foreach my $elt (@omods) {
+ $tmp .= ",$elt";
+ if (length($tmp) > 80) { push @lines, $tmp; $tmp = ''; }
+ }
+ push @lines, $tmp;
+ push @m, '(', join( qq[, -\\n\\t"";" >>\$(MMS\$TARGET)\n\t\$(PERL) -e "print ""], @lines),')';
}
- push @m, '\n$(INST_STATIC)/Library\n"";" >>$(MMS$TARGET)',"\n";
+ push @m, '\n$(INST_STATIC)/Library\n"";" >>$(MMS$TARGET)',"\n";
if (length $self->{LDLOADLIBS}) {
- my($lib); my($line) = '';
- foreach $lib (split ' ', $self->{LDLOADLIBS}) {
- $lib =~ s%\$%\\\$%g; # Escape '$' in VMS filespecs
- if (length($line) + length($lib) > 160) {
- push @m, "\t\$(PERL) -e \"print qq{$line}\" >>\$(MMS\$TARGET)\n";
- $line = $lib . '\n';
- }
- else { $line .= $lib . '\n'; }
- }
- push @m, "\t\$(PERL) -e \"print qq{$line}\" >>\$(MMS\$TARGET)\n" if $line;
+ my($line) = '';
+ foreach my $lib (split ' ', $self->{LDLOADLIBS}) {
+ $lib =~ s%\$%\\\$%g; # Escape '$' in VMS filespecs
+ if (length($line) + length($lib) > 160) {
+ push @m, "\t\$(PERL) -e \"print qq{$line}\" >>\$(MMS\$TARGET)\n";
+ $line = $lib . '\n';
+ }
+ else { $line .= $lib . '\n'; }
+ }
+ push @m, "\t\$(PERL) -e \"print qq{$line}\" >>\$(MMS\$TARGET)\n" if $line;
}
join('',@m);
@@ -1036,7 +1034,7 @@ $(INST_STATIC) :
$(NOECHO) $(NOOP)
' unless ($self->{OBJECT} or @{$self->{C} || []} or $self->{MYEXTLIB});
- my(@m,$lib);
+ my(@m);
push @m,'
# Rely on suffix rule for update action
$(OBJECT) : $(INST_ARCHAUTODIR)$(DFSEP).exists
@@ -1059,7 +1057,7 @@ $(INST_STATIC) : $(OBJECT) $(MYEXTLIB)
}
push @m, "\t\$(NOECHO) \$(PERL) -e 1 >\$(INST_ARCHAUTODIR)extralibs.ld\n";
- foreach $lib (split ' ', $self->{EXTRALIBS}) {
+ foreach my $lib (split ' ', $self->{EXTRALIBS}) {
push(@m,"\t",'$(NOECHO) $(PERL) -e "print qq{',$lib,'\n}" >>$(INST_ARCHAUTODIR)extralibs.ld',"\n");
}
join('',@m);
@@ -1331,7 +1329,7 @@ Consequently, it hasn't really been tested, and may well be incomplete.
=cut
-use vars qw(%olbs);
+our %olbs; # needs to be localized
sub makeaperl {
my($self, %attribs) = @_;
@@ -1384,16 +1382,14 @@ $(MAP_TARGET) :: $(MAKE_APERL_FILE)
if( exists $self->{INCLUDE_EXT} ){
my $found = 0;
- my $incl;
- my $xx;
- ($xx = $File::Find::name) =~ s,.*?/auto/,,;
+ (my $xx = $File::Find::name) =~ s,.*?/auto/,,;
$xx =~ s,/?$_,,;
$xx =~ s,/,::,g;
# Throw away anything not explicitly marked for inclusion.
# DynaLoader is implied.
- foreach $incl ((@{$self->{INCLUDE_EXT}},'DynaLoader')){
+ foreach my $incl ((@{$self->{INCLUDE_EXT}},'DynaLoader')){
if( $xx eq $incl ){
$found++;
last;
@@ -1402,15 +1398,12 @@ $(MAP_TARGET) :: $(MAKE_APERL_FILE)
return unless $found;
}
elsif( exists $self->{EXCLUDE_EXT} ){
- my $excl;
- my $xx;
-
- ($xx = $File::Find::name) =~ s,.*?/auto/,,;
+ (my $xx = $File::Find::name) =~ s,.*?/auto/,,;
$xx =~ s,/?$_,,;
$xx =~ s,/,::,g;
# Throw away anything explicitly marked for exclusion
- foreach $excl (@{$self->{EXCLUDE_EXT}}){
+ foreach my $excl (@{$self->{EXCLUDE_EXT}}){
return if( $xx eq $excl );
}
}
@@ -1440,8 +1433,8 @@ $(MAP_TARGET) :: $(MAKE_APERL_FILE)
# Get external libraries this extension will need
if (-f $extralibs ) {
my %seenthis;
- open LIST,$extralibs or warn $!,next;
- while (<LIST>) {
+ open my $list, "<", $extralibs or warn $!,next;
+ while (<$list>) {
chomp;
# Include a library in the link only once, unless it's mentioned
# multiple times within a single extension's options file, in which
@@ -1452,12 +1445,11 @@ $(MAP_TARGET) :: $(MAKE_APERL_FILE)
next if $skip;
push @$extra,$_;
}
- close LIST;
}
# Get full name of extension for ExtUtils::Miniperl
if (-f $extopt) {
- open OPT,$extopt or die $!;
- while (<OPT>) {
+ open my $opt, '<', $extopt or die $!;
+ while (<$opt>) {
next unless /(?:UNIVERSAL|VECTOR)=boot_([\w_]+)/;
my $pkg = $1;
$pkg =~ s#__*#::#g;
@@ -1572,6 +1564,7 @@ map_clean :
join '', @m;
}
+
# --- Output postprocessing section ---
=item maketext_filter (override)
@@ -1611,10 +1604,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 +1807,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
@@ -1889,7 +1921,7 @@ File::Spec::VMS is deprecated.
sub fixpath {
my($self,$path,$force_path) = @_;
return '' unless $path;
- $self = bless {} unless ref $self;
+ $self = bless {}, $self unless ref $self;
my($fixedpath,$prefix,$name);
if ($path =~ /[ \t]/) {
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/MM_Win32.pm b/gnu/usr.bin/perl/lib/ExtUtils/MM_Win32.pm
index 8975e31f739..1a5bbf0659f 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/MM_Win32.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/MM_Win32.pm
@@ -24,17 +24,15 @@ use File::Basename;
use File::Spec;
use ExtUtils::MakeMaker qw( neatvalue );
-use vars qw(@ISA $VERSION);
-
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
-@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = '6.42';
+our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
+our $VERSION = '6.55_02';
$ENV{EMXSHELL} = 'sh'; # to run `commands`
-my $BORLAND = 1 if $Config{'cc'} =~ /^bcc/i;
-my $GCC = 1 if $Config{'cc'} =~ /^gcc/i;
+my $BORLAND = $Config{'cc'} =~ /^bcc/i ? 1 : 0;
+my $GCC = $Config{'cc'} =~ /^gcc/i ? 1 : 0;
=head2 Overridden methods
@@ -128,12 +126,10 @@ Using \ for Windows.
sub init_DIRFILESEP {
my($self) = shift;
- my $make = $self->make;
-
# The ^ makes sure its not interpreted as an escape in nmake
- $self->{DIRFILESEP} = $make eq 'nmake' ? '^\\' :
- $make eq 'dmake' ? '\\\\'
- : '\\';
+ $self->{DIRFILESEP} = $self->is_make_type('nmake') ? '^\\' :
+ $self->is_make_type('dmake') ? '\\\\'
+ : '\\';
}
=item B<init_others>
@@ -153,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;
@@ -236,7 +221,7 @@ sub special_targets {
my $make_frag = $self->SUPER::special_targets;
- $make_frag .= <<'MAKE_FRAG' if $self->make eq 'dmake';
+ $make_frag .= <<'MAKE_FRAG' if $self->is_make_type('dmake');
.USESHELL :
MAKE_FRAG
@@ -331,7 +316,7 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).
} elsif ($BORLAND) {
push(@m,
q{ $(LD) $(LDDLFLAGS) $(OTHERLDFLAGS) }.$ldfrom.q{,$@,,}
- .($self->make eq 'dmake'
+ .($self->is_make_type('dmake')
? q{$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) }
.q{$(MYEXTLIB:s,/,\,),$(EXPORT_LIST:s,/,\,)}
: q{$(subst /,\,$(PERL_ARCHIVE)) $(subst /,\,$(LDLOADLIBS)) }
@@ -342,13 +327,10 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).
q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) }
.q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)});
- # VS2005 (aka VC 8) or higher, but not for 64-bit compiler from Platform SDK
- if ($Config{ivsize} == 4 && $Config{cc} eq 'cl' and $Config{ccversion} =~ /^(\d+)/ and $1 >= 14)
- {
- push(@m,
- q{
- mt -nologo -manifest $@.manifest -outputresource:$@;2 && del $@.manifest});
- }
+ # Embed the manifest file if it exists
+ push(@m, q{
+ if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
+ if exist $@.manifest del $@.manifest});
}
push @m, '
$(CHMOD) $(PERM_RWX) $@
@@ -419,7 +401,32 @@ banner.
sub pasthru {
my($self) = shift;
- return "PASTHRU = " . ($self->make eq 'nmake' ? "-nologo" : "");
+ return "PASTHRU = " . ($self->is_make_type('nmake') ? "-nologo" : "");
+}
+
+
+=item arch_check (override)
+
+Normalize all arguments for consistency of comparison.
+
+=cut
+
+sub arch_check {
+ my $self = shift;
+
+ # Win32 is an XS module, minperl won't have it.
+ # arch_check() is not critical, so just fake it.
+ return 1 unless $self->can_load_xs;
+ return $self->SUPER::arch_check( map { $self->_normalize_path_name($_) } @_);
+}
+
+sub _normalize_path_name {
+ my $self = shift;
+ my $file = shift;
+
+ require Win32;
+ my $short = Win32::GetShortPathName($file);
+ return defined $short ? lc $short : lc $file;
}
@@ -458,7 +465,7 @@ sub quote_literal {
# quotes; however it transforms {{ into { either inside and outside double
# quotes. It also translates }} into }. The escaping below is not
# 100% correct.
- if( $self->make eq 'dmake' ) {
+ if( $self->is_make_type('dmake') ) {
$text =~ s/{/{{/g;
$text =~ s/}}/}}}/g;
}
@@ -482,19 +489,17 @@ 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
sub cd {
my($self, $dir, @cmds) = @_;
- return $self->SUPER::cd($dir, @cmds) unless $self->make eq 'nmake';
+ return $self->SUPER::cd($dir, @cmds) unless $self->is_make_type('nmake');
my $cmd = join "\n\t", map "$_", @cmds;
@@ -564,6 +569,11 @@ PERLTYPE = $self->{PERLTYPE}
}
+sub is_make_type {
+ my($self, $type) = @_;
+ return !! ($self->make =~ /\b$type(?:\.exe)?$/);
+}
+
1;
__END__
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker.pm b/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker.pm
index 5c6d96c3b6a..e1806cc4126 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker.pm
@@ -1,43 +1,41 @@
-# $Id: MakeMaker.pm,v 1.9 2008/09/29 17:36:11 millert Exp $
+# $Id: MakeMaker.pm,v 1.10 2009/10/12 18:24:40 millert Exp $
package ExtUtils::MakeMaker;
-BEGIN {require 5.005_03;}
+use strict;
+
+BEGIN {require 5.006;}
require Exporter;
use ExtUtils::MakeMaker::Config;
use Carp ();
use File::Path;
-use vars qw(
- @ISA @EXPORT @EXPORT_OK
- $VERSION $Verbose %Config
- @Prepend_parent @Parent
- %Recognized_Att_Keys @Get_from_Config @MM_Sections @Overridable
- $Filename
- );
-
-# Has to be on its own line with no $ after it to avoid being noticed by
-# the version control system
-use vars qw($Revision);
-use strict;
+our $Verbose = 0; # exported
+our @Parent; # needs to be localized
+our @Get_from_Config; # referenced by MM_Unix
+our @MM_Sections;
+our @Overridable;
+my @Prepend_parent;
+my %Recognized_Att_Keys;
+
+our $VERSION = '6.55_02';
-$VERSION = '6.42';
-($Revision) = q$Revision: 1.9 $ =~ /Revision:\s+(\S+)/;
+# Emulate something resembling CVS $Revision: 1.10 $
+(our $Revision = $VERSION) =~ s{_}{};
+$Revision = int $Revision * 10000;
-@ISA = qw(Exporter);
-@EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt);
-@EXPORT_OK = qw($VERSION &neatvalue &mkbootstrap &mksymlists
- &WriteEmptyMakefile);
+our $Filename = __FILE__; # referenced outside MakeMaker
+
+our @ISA = qw(Exporter);
+our @EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt);
+our @EXPORT_OK = qw($VERSION &neatvalue &mkbootstrap &mksymlists
+ &WriteEmptyMakefile);
# These will go away once the last of the Win32 & VMS specific code is
# purged.
my $Is_VMS = $^O eq 'VMS';
my $Is_Win32 = $^O eq 'MSWin32';
-# Our filename for diagnostic and debugging purposes. More reliable
-# than %INC (think caseless filesystems)
-$Filename = __FILE__;
-
full_setup();
require ExtUtils::MM; # Things like CPAN assume loading ExtUtils::MakeMaker
@@ -45,7 +43,7 @@ require ExtUtils::MM; # Things like CPAN assume loading ExtUtils::MakeMaker
require ExtUtils::MY; # XXX pre-5.8 versions of ExtUtils::Embed expect
# loading ExtUtils::MakeMaker will give them MY.
- # This will go when Embed is it's own CPAN module.
+ # This will go when Embed is its own CPAN module.
sub WriteMakefile {
@@ -83,11 +81,15 @@ my %Special_Sigs = (
LIBS => ['ARRAY',''],
MAN1PODS => 'HASH',
MAN3PODS => 'HASH',
+ META_ADD => 'HASH',
+ META_MERGE => 'HASH',
PL_FILES => 'HASH',
PM => 'HASH',
PMLIBDIRS => 'ARRAY',
PMLIBPARENTDIRS => 'ARRAY',
PREREQ_PM => 'HASH',
+ BUILD_REQUIRES => 'HASH',
+ CONFIGURE_REQUIRES => 'HASH',
SKIP => 'ARRAY',
TYPEMAPS => 'ARRAY',
XS => 'HASH',
@@ -122,7 +124,7 @@ sub _verify_att {
my @sigs = ref $sig ? @$sig : $sig;
my $given = ref $val;
- unless( grep { $given eq $_ || ($_ && eval{$val->isa($_)}) } @sigs ) {
+ unless( grep { _is_of_type($val, $_) } @sigs ) {
my $takes = join " or ", map { _format_att($_) } @sigs;
my $has = _format_att($given);
@@ -133,6 +135,19 @@ sub _verify_att {
}
+# Check if a given thing is a reference or instance of $type
+sub _is_of_type {
+ my($thing, $type) = @_;
+
+ return 1 if ref $thing eq $type;
+
+ local $SIG{__DIE__};
+ return 1 if eval{ $thing->isa($type) };
+
+ return 0;
+}
+
+
sub _format_att {
my $given = shift;
@@ -143,7 +158,7 @@ sub _format_att {
}
-sub prompt ($;$) {
+sub prompt ($;$) { ## no critic
my($mess, $def) = @_;
Carp::confess("prompt function called without an argument")
unless defined $mess;
@@ -219,8 +234,9 @@ 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
- EXCLUDE_EXT EXE_FILES EXTRA_META FIRST_MAKEFILE
+ 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
@@ -239,10 +255,11 @@ sub full_setup {
SITELIBEXP SITEARCHEXP
INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS LICENSE
- LINKTYPE MAKE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET
+ LINKTYPE MAKE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET
+ META_ADD META_MERGE MIN_PERL_VERSION BUILD_REQUIRES 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
@@ -292,7 +309,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
@@ -373,17 +390,22 @@ sub new {
$self->{ARGS}{$k} = $self->{$k};
}
+ $self = {} unless defined $self;
+
+ $self->{PREREQ_PM} ||= {};
+ $self->{BUILD_REQUIRES} ||= {};
+
+ # Temporarily bless it into MM so it can be used as an
+ # object. It will be blessed into a temp package later.
+ bless $self, "MM";
+
if ("@ARGV" =~ /\bPREREQ_PRINT\b/) {
- require Data::Dumper;
- print Data::Dumper->Dump([$self->{PREREQ_PM}], [qw(PREREQ_PM)]);
- exit 0;
+ $self->_PREREQ_PRINT;
}
# PRINT_PREREQ is RedHatism.
if ("@ARGV" =~ /\bPRINT_PREREQ\b/) {
- print join(" ", map { "perl($_)>=$self->{PREREQ_PM}->{$_} " }
- sort keys %{$self->{PREREQ_PM}}), "\n";
- exit 0;
+ $self->_PRINT_PREREQ;
}
print STDOUT "MakeMaker (v$VERSION)\n" if $Verbose;
@@ -391,42 +413,74 @@ sub new {
check_manifest();
}
- $self = {} unless (defined $self);
-
check_hints($self);
+ # Translate X.Y.Z to X.00Y00Z
+ if( defined $self->{MIN_PERL_VERSION} ) {
+ $self->{MIN_PERL_VERSION} =~ s{ ^ (\d+) \. (\d+) \. (\d+) $ }
+ {sprintf "%d.%03d%03d", $1, $2, $3}ex;
+ }
+
+ my $perl_version_ok = eval {
+ local $SIG{__WARN__} = sub {
+ # simulate "use warnings FATAL => 'all'" for vintage perls
+ die @_;
+ };
+ !$self->{MIN_PERL_VERSION} or $self->{MIN_PERL_VERSION} <= $]
+ };
+ if (!$perl_version_ok) {
+ if (!defined $perl_version_ok) {
+ warn <<'END';
+Warning: MIN_PERL_VERSION is not in a recognized format.
+Recommended is a quoted numerical value like '5.005' or '5.008001'.
+END
+ }
+ elsif ($self->{PREREQ_FATAL}) {
+ die sprintf <<"END", $self->{MIN_PERL_VERSION}, $];
+MakeMaker FATAL: perl version too low for this distribution.
+Required is %s. We run %s.
+END
+ }
+ else {
+ warn sprintf
+ "Warning: Perl version %s or higher required. We run %s.\n",
+ $self->{MIN_PERL_VERSION}, $];
+ }
+ }
+
my %configure_att; # record &{$self->{CONFIGURE}} attributes
my(%initial_att) = %$self; # record initial attributes
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 $prereqs = $self->_all_prereqs;
+ foreach my $prereq (sort keys %$prereqs) {
+ my $required_version = $prereqs->{$prereq};
- my $pr_version = $prereq->VERSION || 0;
+ my $installed_file = MM->_installed_file_for_module($prereq);
+ my $pr_version = 0;
+ $pr_version = MM->parse_version($installed_file) if $installed_file;
+ $pr_version = 0 if $pr_version eq 'undef';
# convert X.Y_Z alpha version #s to X.YZ for easier comparisons
$pr_version =~ s/(\d+)\.(\d+)_(\d+)/$1.$2$3/;
- if ($@) {
+ if (!$installed_file) {
warn sprintf "Warning: prerequisite %s %s not found.\n",
- $prereq, $self->{PREREQ_PM}{$prereq}
+ $prereq, $required_version
unless $self->{PREREQ_FATAL};
+
$unsatisfied{$prereq} = 'not installed';
- } elsif ($pr_version < $self->{PREREQ_PM}->{$prereq} ){
+ }
+ elsif ($pr_version < $required_version ){
warn sprintf "Warning: prerequisite %s %s not found. We have %s.\n",
- $prereq, $self->{PREREQ_PM}{$prereq},
- ($pr_version || 'unknown version')
+ $prereq, $required_version, ($pr_version || 'unknown version')
unless $self->{PREREQ_FATAL};
- $unsatisfied{$prereq} = $self->{PREREQ_PM}->{$prereq} ?
- $self->{PREREQ_PM}->{$prereq} : 'unknown version' ;
+
+ $unsatisfied{$prereq} = $required_version ? $required_version : 'unknown version' ;
}
}
-
- if (%unsatisfied && $self->{PREREQ_FATAL}){
+
+ if (%unsatisfied && $self->{PREREQ_FATAL}){
my $failedprereqs = join "\n", map {" $_ $unsatisfied{$_}"}
sort { $a cmp $b } keys %unsatisfied;
die <<"END";
@@ -454,19 +508,19 @@ END
my $newclass = ++$PACKNAME;
local @Parent = @Parent; # Protect against non-local exits
{
- no strict 'refs';
print "Blessing Object into class [$newclass]\n" if $Verbose>=2;
mv_all_methods("MY",$newclass);
bless $self, $newclass;
push @Parent, $self;
require ExtUtils::MY;
+
+ no strict 'refs'; ## no critic;
@{"$newclass\:\:ISA"} = 'MM';
}
if (defined $Parent[-2]){
$self->{PARENT} = $Parent[-2];
- my $key;
- for $key (@Prepend_parent) {
+ for my $key (@Prepend_parent) {
next unless defined $self->{PARENT}{$key};
# Don't stomp on WriteMakefile() args.
@@ -528,30 +582,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();
@@ -571,18 +605,9 @@ END
#
# MakeMaker ARGV: $argv
#
-# MakeMaker Parameters:
END
- foreach my $key (sort keys %initial_att){
- next if $key eq 'ARGS';
-
- my($v) = neatvalue($initial_att{$key});
- $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/;
- $v =~ tr/\n/ /s;
- push @{$self->{RESULT}}, "# $key => $v";
- }
- undef %initial_att; # free memory
+ push @{$self->{RESULT}}, $self->_MakeMaker_Parameters_section(\%initial_att);
if (defined $self->{CONFIGURE}) {
push @{$self->{RESULT}}, <<END;
@@ -606,8 +631,7 @@ END
}
# turn the SKIP array into a SKIPHASH hash
- my (%skip,$skip);
- for $skip (@{$self->{SKIP} || []}) {
+ for my $skip (@{$self->{SKIP} || []}) {
$self->{SKIPHASH}{$skip} = 1;
}
delete $self->{SKIP}; # free memory
@@ -662,8 +686,8 @@ sub WriteEmptyMakefile {
if ( -f $new ) {
_rename($new, $old) or warn "rename $new => $old: $!"
}
- open MF, '>'.$new or die "open $new for write: $!";
- print MF <<'EOP';
+ open my $mfh, '>', $new or die "open $new for write: $!";
+ print $mfh <<'EOP';
all :
clean :
@@ -675,9 +699,73 @@ makemakerdflt :
test :
EOP
- close MF or die "close $new for write: $!";
+ close $mfh or die "close $new for write: $!";
+}
+
+
+=begin private
+
+=head3 _installed_file_for_module
+
+ my $file = MM->_installed_file_for_module($module);
+
+Return the first installed .pm $file associated with the $module. The
+one which will show up when you C<use $module>.
+
+$module is something like "strict" or "Test::More".
+
+=end private
+
+=cut
+
+sub _installed_file_for_module {
+ my $class = shift;
+ my $prereq = shift;
+
+ my $file = "$prereq.pm";
+ $file =~ s{::}{/}g;
+
+ my $path;
+ for my $dir (@INC) {
+ my $tmp = File::Spec->catfile($dir, $file);
+ if ( -r $tmp ) {
+ $path = $tmp;
+ last;
+ }
+ }
+
+ return $path;
+}
+
+
+# Extracted from MakeMaker->new so we can test it
+sub _MakeMaker_Parameters_section {
+ my $self = shift;
+ my $att = shift;
+
+ my @result = <<'END';
+# MakeMaker Parameters:
+END
+
+ # CPAN.pm takes prereqs from this field in 'Makefile'
+ # and does not know about BUILD_REQUIRES
+ if( $att->{PREREQ_PM} || $att->{BUILD_REQUIRES} ) {
+ %{$att->{'PREREQ_PM'}} = (%{$att->{'PREREQ_PM'}||{}}, %{$att->{'BUILD_REQUIRES'}||{}});
+ }
+
+ foreach my $key (sort keys %$att){
+ next if $key eq 'ARGS';
+
+ my($v) = neatvalue($att->{$key});
+ $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/;
+ $v =~ tr/\n/ /s;
+ push @result, "# $key => $v";
+ }
+
+ return @result;
}
+
sub check_manifest {
print STDOUT "Checking if your kit is complete...\n";
require ExtUtils::Manifest;
@@ -794,7 +882,7 @@ sub check_hints {
}
sub _run_hintfile {
- no strict 'vars';
+ our $self;
local($self) = shift; # make $self available to the hint file.
my($hint_file) = shift;
@@ -813,8 +901,6 @@ sub _run_hintfile {
sub mv_all_methods {
my($from,$to) = @_;
- no strict 'refs';
- my($symtab) = \%{"${from}::"};
# Here you see the *current* list of methods that are overridable
# from Makefile.PL via MY:: subroutines. As of VERSION 5.07 I'm
@@ -837,19 +923,23 @@ sub mv_all_methods {
next unless defined &{"${from}::$method"};
- *{"${to}::$method"} = \&{"${from}::$method"};
-
- # delete would do, if we were sure, nobody ever called
- # MY->makeaperl directly
-
- # delete $symtab->{$method};
-
- # If we delete a method, then it will be undefined and cannot
- # be called. But as long as we have Makefile.PLs that rely on
- # %MY:: being intact, we have to fill the hole with an
- # inheriting method:
-
- eval "package MY; sub $method { shift->SUPER::$method(\@_); }";
+ {
+ no strict 'refs'; ## no critic
+ *{"${to}::$method"} = \&{"${from}::$method"};
+
+ # If we delete a method, then it will be undefined and cannot
+ # be called. But as long as we have Makefile.PLs that rely on
+ # %MY:: being intact, we have to fill the hole with an
+ # inheriting method:
+
+ {
+ package MY;
+ my $super = "SUPER::".$method;
+ *{$method} = sub {
+ shift->$super(@_);
+ };
+ }
+ }
}
# We have to clean out %INC also, because the current directory is
@@ -898,20 +988,19 @@ sub skipcheck {
sub flush {
my $self = shift;
- my($chunk);
- local *FH;
my $finalname = $self->{MAKEFILE};
print STDOUT "Writing $finalname for $self->{NAME}\n";
unlink($finalname, "MakeMaker.tmp", $Is_VMS ? 'Descrip.MMS' : ());
- open(FH,">MakeMaker.tmp") or die "Unable to open MakeMaker.tmp: $!";
+ open(my $fh,">", "MakeMaker.tmp")
+ or die "Unable to open MakeMaker.tmp: $!";
- for $chunk (@{$self->{RESULT}}) {
- print FH "$chunk\n";
+ for my $chunk (@{$self->{RESULT}}) {
+ print $fh "$chunk\n";
}
- close FH;
+ close $fh;
_rename("MakeMaker.tmp", $finalname) or
warn "rename MakeMaker.tmp => $finalname: $!";
chmod 0644, $finalname unless $Is_VMS;
@@ -1389,6 +1478,14 @@ architecture. For example:
builds a PPD package that references a binary of the C<Agent> package,
located in the C<x86> directory relative to the PPD itself.
+=item BUILD_REQUIRES
+
+A hash of modules that are needed to build your module but not run it.
+
+This will go into the C<build_requires> field of your F<META.yml>.
+
+The format is the same as PREREQ_PM.
+
=item C
Ref to array of *.c file names. Initialised from a directory scan
@@ -1427,6 +1524,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">
@@ -1445,8 +1553,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
@@ -1666,7 +1774,7 @@ If set to 'none', no man pages will be installed.
=item INSTALLVENDORSCRIPT
Used by 'make install' which copies files from INST_SCRIPT to this
-directory if INSTALLDIRS is set to is set to vendor.
+directory if INSTALLDIRS is set to vendor.
=item INST_ARCHLIB
@@ -1756,7 +1864,7 @@ MakeMaker will turn it into an array with one element.
The licensing terms of your distribution. Generally its "perl" for the
same license as Perl itself.
-See L<Module::Build::Authoring> for the list of options.
+See L<Module::Build::API> for the list of options.
Defaults to "unknown".
@@ -1800,6 +1908,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
@@ -1808,11 +1925,32 @@ 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
may hold a name for that binary. Defaults to perl
+=item META_ADD
+
+=item META_MERGE
+
+A hashrefs of items to add to the F<META.yml>.
+
+They differ in how they behave if they have the same key as the
+default metadata. META_ADD will override the default value with it's
+own. META_MERGE will merge its value with the default.
+
+Unless you want to override the defaults, prefer META_MERGE so as to
+get the advantage of any future defaults.
+
+=item MIN_PERL_VERSION
+
+The minimum required version of Perl for this distribution.
+
+Either 5.006001 or 5.6.1 format is acceptable.
+
=item MYEXTLIB
If the extension links to a library that it builds set this to the
@@ -1955,15 +2093,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
@@ -2099,10 +2239,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
@@ -2110,11 +2259,18 @@ Bool. If this parameter is true, the prerequisites will be printed to
stdout and MakeMaker will exit. The output format is an evalable hash
ref.
-$PREREQ_PM = {
- 'A::B' => Vers1,
- 'C::D' => Vers2,
- ...
- };
+ $PREREQ_PM = {
+ 'A::B' => Vers1,
+ 'C::D' => Vers2,
+ ...
+ };
+
+If a distribution defines a minimal required perl version, this is
+added to the output as an additional line of the form:
+
+ $MIN_PERL_VERSION = '5.008001';
+
+If BUILD_REQUIRES is not empty, it will be dumped as $BUILD_REQUIRES hasref.
=item PRINT_PREREQ
@@ -2122,6 +2278,10 @@ RedHatism for C<PREREQ_PRINT>. The output format is different, though:
perl(A::B)>=Vers1 perl(C::D)>=Vers2 ...
+A minimal required perl version, if present, will look like this:
+
+ perl(perl)>=5.008001
+
=item SITEPREFIX
Like PERLPREFIX, but only for the site install locations.
@@ -2190,26 +2350,29 @@ will be evaluated with eval() and the value of the named variable
B<after> the eval() will be assigned to the VERSION attribute of the
MakeMaker object. The following lines will be parsed o.k.:
- $VERSION = '1.00';
- *VERSION = \'1.01';
- ($VERSION) = q$Revision: 1.9 $ =~ /(\d+)/g;
+ $VERSION = '1.00';
+ *VERSION = \'1.01';
+ ($VERSION) = q$Revision: 1.10 $ =~ /(\d+)/g;
$FOO::VERSION = '1.10';
*FOO::VERSION = \'1.11';
- our $VERSION = 1.2.3; # new for perl5.6.0
but these will fail:
- my $VERSION = '1.01';
- local $VERSION = '1.02';
+ # Bad
+ my $VERSION = '1.01';
+ local $VERSION = '1.02';
local $FOO::VERSION = '1.30';
-L<version> will be loaded, if available, so this will work.
+"Version strings" are incompatible should not be used.
- our $VERSION = qv(1.2.3); # version.pm will be loaded if available
+ # Bad
+ $VERSION = 1.2.3;
+ $VERSION = v1.2.3;
-Its up to you to declare a dependency on C<version>. Also note that this
-feature was introduced in MakeMaker 6.35. Earlier versions of MakeMaker
-require this:
+L<version> objects are fine. As of MakeMaker 6.35 version.pm will be
+automatically loaded, but you must declare the dependency on version.pm.
+For compatibility with older MakeMaker you should load on the same line
+as $VERSION is declared.
# All on one line
use version; our $VERSION = qv(1.2.3);
@@ -2514,7 +2677,13 @@ following parameters are recognized:
An example:
- WriteMakefile( 'dist' => { COMPRESS=>"bzip2", SUFFIX=>".bz2" })
+ WriteMakefile(
+ ...other options...
+ dist => {
+ COMPRESS => "bzip2",
+ SUFFIX => ".bz2"
+ }
+ );
=head2 Module Meta-Data
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/FAQ.pod b/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/FAQ.pod
index 95846eb8208..d7aedb8c05b 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/FAQ.pod
+++ b/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/FAQ.pod
@@ -1,7 +1,6 @@
package ExtUtils::MakeMaker::FAQ;
-use vars qw($VERSION);
-$VERSION = '1.12';
+our $VERSION = '1.12';
1;
__END__
@@ -182,32 +181,32 @@ by hand is a pain and you often forget.
Simplest way to do it automatically is to use your version control
system's revision number (you are using version control, right?).
-In CVS, RCS and SVN you use $Revision: 1.4 $ (see the documentation of your
+In CVS, RCS and SVN you use $Revision: 1.5 $ (see the documentation of your
version control system for details). Every time the file is checked
-in the $Revision: 1.4 $ will be updated, updating your $VERSION.
+in the $Revision: 1.5 $ will be updated, updating your $VERSION.
-SVN uses a simple integer for $Revision: 1.4 $ so you can adapt it for your
+SVN uses a simple integer for $Revision: 1.5 $ so you can adapt it for your
$VERSION like so:
- ($VERSION) = q$Revision: 1.4 $ =~ /(\d+)/;
+ ($VERSION) = q$Revision: 1.5 $ =~ /(\d+)/;
In CVS and RCS version 1.9 is followed by 1.10. Since CPAN compares
version numbers numerically we use a sprintf() to convert 1.9 to 1.009
and 1.10 to 1.010 which compare properly.
- $VERSION = sprintf "%d.%03d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/g;
+ $VERSION = sprintf "%d.%03d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/g;
-If branches are involved (ie. $Revision: 1.4 $) its a little more
+If branches are involved (ie. $Revision: 1.5 $) its a little more
complicated.
# must be all on one line or MakeMaker will get confused.
- $VERSION = do { my @r = (q$Revision: 1.4 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r };
+ $VERSION = do { my @r = (q$Revision: 1.5 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r };
-In SVN, $Revision: 1.4 $ should be the same for every file in the project so
+In SVN, $Revision: 1.5 $ should be the same for every file in the project so
they would all have the same $VERSION. CVS and RCS have a different
-$Revision: 1.4 $ per file so each file will have a differnt $VERSION.
+$Revision: 1.5 $ per file so each file will have a differnt $VERSION.
Distributed version control systems, such as SVK, may have a different
-$Revision: 1.4 $ based on who checks out the file leading to a different $VERSION
+$Revision: 1.5 $ based on who checks out the file leading to a different $VERSION
on each machine! Finally, some distributed version control systems, such
as darcs, have no concept of revision number at all.
@@ -268,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/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/bytes.pm b/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/bytes.pm
deleted file mode 100644
index 41ae2077a8d..00000000000
--- a/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/bytes.pm
+++ /dev/null
@@ -1,41 +0,0 @@
-package ExtUtils::MakeMaker::bytes;
-
-use strict;
-
-use vars qw($VERSION);
-$VERSION = 6.42;
-
-my $Have_Bytes = eval q{require bytes; 1;};
-
-sub import {
- return unless $Have_Bytes;
-
- shift;
- unshift @_, 'bytes';
-
- goto &bytes::import;
-}
-
-1;
-
-
-=head1 NAME
-
-ExtUtils::MakeMaker::bytes - Version-agnostic bytes.pm
-
-=head1 SYNOPSIS
-
- use just like bytes.pm
-
-=head1 DESCRIPTION
-
-bytes.pm was introduced with 5.6. This means any code which has 'use
-bytes' in it won't even compile on 5.5.X. Since bytes is a lexical
-pragma and must be used at compile time we can't simply wrap it in
-a BEGIN { eval 'use bytes' } block.
-
-ExtUtils::MakeMaker::bytes is just a very thin wrapper around bytes
-which works just like it when bytes.pm exists and everywhere else it
-does nothing.
-
-=cut
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/vmsish.pm b/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/vmsish.pm
deleted file mode 100644
index f3d0ac8cf70..00000000000
--- a/gnu/usr.bin/perl/lib/ExtUtils/MakeMaker/vmsish.pm
+++ /dev/null
@@ -1,42 +0,0 @@
-package ExtUtils::MakeMaker::vmsish;
-
-use strict;
-
-use vars qw($VERSION);
-$VERSION = 6.42;
-
-my $IsVMS = $^O eq 'VMS';
-
-require vmsish if $IsVMS;
-
-
-sub import {
- return unless $IsVMS;
-
- shift;
- unshift @_, 'vmsish';
-
- goto &vmsish::import;
-}
-
-1;
-
-
-=head1 NAME
-
-ExtUtils::MakeMaker::vmsish - Platform-agnostic vmsish.pm
-
-=head1 SYNOPSIS
-
- use just like vmsish.pm
-
-=head1 DESCRIPTION
-
-Until 5.8.0, vmsish.pm is only installed on VMS. This means any code
-which has 'use vmsish' in it won't even compile outside VMS. This
-makes ExtUtils::MM_VMS very hard to test.
-
-ExtUtils::MakeMaker::vmsish is just a very thin wrapper around vmsish
-which works just like it on VMS and everywhere else it does nothing.
-
-=cut
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/Manifest.pm b/gnu/usr.bin/perl/lib/ExtUtils/Manifest.pm
index ee508c8fa98..7281421cc5f 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/Manifest.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/Manifest.pm
@@ -10,19 +10,48 @@ use Carp;
use strict;
use vars qw($VERSION @ISA @EXPORT_OK
- $Is_MacOS $Is_VMS
+ $Is_MacOS $Is_VMS $Is_VMS_mode $Is_VMS_lc $Is_VMS_nodot
$Debug $Verbose $Quiet $MANIFEST $DEFAULT_MSKIP);
-$VERSION = '1.51_01';
+$VERSION = '1.56';
@ISA=('Exporter');
@EXPORT_OK = qw(mkmanifest
manicheck filecheck fullcheck skipcheck
manifind maniread manicopy maniadd
+ maniskip
);
$Is_MacOS = $^O eq 'MacOS';
$Is_VMS = $^O eq 'VMS';
-require VMS::Filespec if $Is_VMS;
+$Is_VMS_mode = 0;
+$Is_VMS_lc = 0;
+$Is_VMS_nodot = 0; # No dots in dir names or double dots in files
+
+if ($Is_VMS) {
+ require VMS::Filespec if $Is_VMS;
+ my $vms_unix_rpt;
+ my $vms_efs;
+ my $vms_case;
+
+ $Is_VMS_mode = 1;
+ $Is_VMS_lc = 1;
+ $Is_VMS_nodot = 1;
+ if (eval { local $SIG{__DIE__}; require VMS::Feature; }) {
+ $vms_unix_rpt = VMS::Feature::current("filename_unix_report");
+ $vms_efs = VMS::Feature::current("efs_charset");
+ $vms_case = VMS::Feature::current("efs_case_preserve");
+ } else {
+ my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
+ my $efs_charset = $ENV{'DECC$EFS_CHARSET'} || '';
+ my $efs_case = $ENV{'DECC$EFS_CASE_PRESERVE'} || '';
+ $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i;
+ $vms_efs = $efs_charset =~ /^[ET1]/i;
+ $vms_case = $efs_case =~ /^[ET1]/i;
+ }
+ $Is_VMS_lc = 0 if ($vms_case);
+ $Is_VMS_mode = 0 if ($vms_unix_rpt);
+ $Is_VMS_nodot = 0 if ($vms_efs);
+}
$Debug = $ENV{PERL_MM_MANIFEST_DEBUG} || 0;
$Verbose = defined $ENV{PERL_MM_MANIFEST_VERBOSE} ?
@@ -71,16 +100,14 @@ exported on request
mkmanifest();
Writes all files in and below the current directory to your F<MANIFEST>.
-It works similar to
+It works similar to the result of the Unix command
find . > MANIFEST
All files that match any regular expression in a file F<MANIFEST.SKIP>
(if it exists) are ignored.
-Any existing F<MANIFEST> file will be saved as F<MANIFEST.bak>. Lines
-from the old F<MANIFEST> file is preserved, including any comments
-that are found in the existing F<MANIFEST> file in the new one.
+Any existing F<MANIFEST> file will be saved as F<MANIFEST.bak>.
=cut
@@ -94,14 +121,15 @@ sub mkmanifest {
$read = {} if $manimiss;
local *M;
my $bakbase = $MANIFEST;
- $bakbase =~ s/\./_/g if $Is_VMS; # avoid double dots
+ $bakbase =~ s/\./_/g if $Is_VMS_nodot; # avoid double dots
rename $MANIFEST, "$bakbase.bak" unless $manimiss;
- open M, ">$MANIFEST" or die "Could not open $MANIFEST: $!";
- my $skip = _maniskip();
+ open M, "> $MANIFEST" or die "Could not open $MANIFEST: $!";
+ my $skip = maniskip();
my $found = manifind();
my($key,$val,$file,%all);
%all = (%$found, %$read);
- $all{$MANIFEST} = ($Is_VMS ? "$MANIFEST\t\t" : '') . 'This list of files'
+ $all{$MANIFEST} = ($Is_VMS_mode ? "$MANIFEST\t\t" : '') .
+ 'This list of files'
if $manimiss; # add new MANIFEST to known file list
foreach $file (_sort keys %all) {
if ($skip->($file)) {
@@ -118,6 +146,10 @@ sub mkmanifest {
my $tabs = (5 - (length($file)+1)/8);
$tabs = 1 if $tabs < 1;
$tabs = 0 unless $text;
+ if ($file =~ /\s/) {
+ $file =~ s/([\\'])/\\$1/g;
+ $file = "'$file'";
+ }
print M $file, "\t" x $tabs, $text, "\n";
}
close M;
@@ -150,8 +182,8 @@ sub manifind {
my $name = clean_up_filename($File::Find::name);
warn "Debug: diskfile $name\n" if $Debug;
return if -d $_;
-
- if( $Is_VMS ) {
+
+ if( $Is_VMS_lc ) {
$name =~ s#(.*)\.$#\L$1#;
$name = uc($name) if $name =~ /^MANIFEST(\.SKIP)?$/i;
}
@@ -231,7 +263,7 @@ file.
sub skipcheck {
my($p) = @_;
my $found = manifind();
- my $matches = _maniskip();
+ my $matches = maniskip();
my @skipped = ();
foreach my $file (_sort keys %$found){
@@ -274,7 +306,7 @@ sub _check_manifest {
my($p) = @_;
my $read = maniread() || {};
my $found = manifind($p);
- my $skip = _maniskip();
+ my $skip = maniskip();
my @missentry = ();
foreach my $file (_sort keys %$found){
@@ -308,7 +340,7 @@ sub maniread {
$mfile ||= $MANIFEST;
my $read = {};
local *M;
- unless (open M, $mfile){
+ unless (open M, "< $mfile"){
warn "Problem opening $mfile: $!";
return $read;
}
@@ -317,24 +349,37 @@ sub maniread {
chomp;
next if /^\s*#/;
- my($file, $comment) = /^(\S+)\s*(.*)/;
+ my($file, $comment);
+
+ # filename may contain spaces if enclosed in ''
+ # (in which case, \\ and \' are escapes)
+ if (($file, $comment) = /^'(\\[\\']|.+)+'\s*(.*)/) {
+ $file =~ s/\\([\\'])/$1/g;
+ }
+ else {
+ ($file, $comment) = /^(\S+)\s*(.*)/;
+ }
next unless $file;
if ($Is_MacOS) {
$file = _macify($file);
$file =~ s/\\([0-3][0-7][0-7])/sprintf("%c", oct($1))/ge;
}
- elsif ($Is_VMS) {
+ elsif ($Is_VMS_mode) {
require File::Basename;
my($base,$dir) = File::Basename::fileparse($file);
# Resolve illegal file specifications in the same way as tar
- $dir =~ tr/./_/;
- my(@pieces) = split(/\./,$base);
- if (@pieces > 2) { $base = shift(@pieces) . '.' . join('_',@pieces); }
- my $okfile = "$dir$base";
- warn "Debug: Illegal name $file changed to $okfile\n" if $Debug;
- $file = $okfile;
- $file = lc($file) unless $file =~ /^MANIFEST(\.SKIP)?$/;
+ if ($Is_VMS_nodot) {
+ $dir =~ tr/./_/;
+ my(@pieces) = split(/\./,$base);
+ if (@pieces > 2)
+ { $base = shift(@pieces) . '.' . join('_',@pieces); }
+ my $okfile = "$dir$base";
+ warn "Debug: Illegal name $file changed to $okfile\n" if $Debug;
+ $file = $okfile;
+ }
+ $file = lc($file)
+ unless $Is_VMS_lc &&($file =~ /^MANIFEST(\.SKIP)?$/);
}
$read->{$file} = $comment;
@@ -343,24 +388,39 @@ sub maniread {
$read;
}
+=item maniskip
+
+ my $skipchk = maniskip();
+ my $skipchk = maniskip($manifest_skip_file);
+
+ if ($skipchk->($file)) { .. }
+
+reads a named C<MANIFEST.SKIP> file (defaults to C<MANIFEST.SKIP> in
+the current directory) and returns a CODE reference that tests whether
+a given filename should be skipped.
+
+=cut
+
# returns an anonymous sub that decides if an argument matches
-sub _maniskip {
+sub maniskip {
my @skip ;
- my $mfile = "$MANIFEST.SKIP";
+ my $mfile = shift || "$MANIFEST.SKIP";
_check_mskip_directives($mfile) if -f $mfile;
local(*M, $_);
- open M, $mfile or open M, $DEFAULT_MSKIP or return sub {0};
+ open M, "< $mfile" or open M, "< $DEFAULT_MSKIP" or return sub {0};
while (<M>){
chomp;
s/\r//;
next if /^#/;
next if /^\s*$/;
+ s/^'//;
+ s/'$//;
push @skip, _macify($_);
}
close M;
return sub {0} unless (scalar @skip > 0);
- my $opts = $Is_VMS ? '(?i)' : '';
+ my $opts = $Is_VMS_mode ? '(?i)' : '';
# Make sure each entry is isolated in its own parentheses, in case
# any of them contain alternations
@@ -380,7 +440,7 @@ sub _check_mskip_directives {
local (*M, $_);
my @lines = ();
my $flag = 0;
- unless (open M, $mfile) {
+ unless (open M, "< $mfile") {
warn "Problem opening $mfile: $!";
return;
}
@@ -407,10 +467,10 @@ sub _check_mskip_directives {
close M;
return unless $flag;
my $bakbase = $mfile;
- $bakbase =~ s/\./_/g if $Is_VMS; # avoid double dots
+ $bakbase =~ s/\./_/g if $Is_VMS_nodot; # avoid double dots
rename $mfile, "$bakbase.bak";
warn "Debug: Saving original $mfile as $bakbase.bak\n" if $Debug;
- unless (open M, ">$mfile") {
+ unless (open M, "> $mfile") {
warn "Problem opening $mfile: $!";
return;
}
@@ -428,7 +488,7 @@ sub _include_mskip_file {
return;
}
local (*M, $_);
- unless (open M, $mskip) {
+ unless (open M, "< $mskip") {
warn "Problem opening $mskip: $!";
return;
}
@@ -468,7 +528,7 @@ sub manicopy {
require File::Path;
require File::Basename;
- $target = VMS::Filespec::unixify($target) if $Is_VMS;
+ $target = VMS::Filespec::unixify($target) if $Is_VMS_mode;
File::Path::mkpath([ $target ],! $Quiet,$Is_VMS ? undef : 0755);
foreach my $file (keys %$read){
if ($Is_MacOS) {
@@ -479,10 +539,10 @@ sub manicopy {
}
cp_if_diff($file, _maccat($target, $file), $how);
} else {
- $file = VMS::Filespec::unixify($file) if $Is_VMS;
+ $file = VMS::Filespec::unixify($file) if $Is_VMS_mode;
if ($file =~ m!/!) { # Ilya, that hurts, I fear, or maybe not?
my $dir = File::Basename::dirname($file);
- $dir = VMS::Filespec::unixify($dir) if $Is_VMS;
+ $dir = VMS::Filespec::unixify($dir) if $Is_VMS_mode;
File::Path::mkpath(["$target/$dir"],! $Quiet,$Is_VMS ? undef : 0755);
}
cp_if_diff($file, "$target/$file", $how);
@@ -492,7 +552,10 @@ sub manicopy {
sub cp_if_diff {
my($from, $to, $how)=@_;
- -f $from or carp "$0: $from not found";
+ if (! -f $from) {
+ carp "$from not found";
+ return;
+ }
my($diff) = 0;
local(*F,*T);
open(F,"< $from\0") or die "Can't read $from: $!\n";
@@ -531,6 +594,7 @@ sub cp {
sub ln {
my ($srcFile, $dstFile) = @_;
+ # Fix-me - VMS can support links.
return &cp if $Is_VMS or ($^O eq 'MSWin32' and Win32::IsWin95());
link($srcFile, $dstFile);
@@ -626,6 +690,10 @@ sub maniadd {
foreach my $file (_sort @needed) {
my $comment = $additions->{$file} || '';
+ if ($file =~ /\s/) {
+ $file =~ s/([\\'])/\\$1/g;
+ $file = "'$file'";
+ }
printf MANIFEST "%-40s %s\n", $file, $comment;
}
close MANIFEST or die "Error closing $MANIFEST: $!";
@@ -669,11 +737,14 @@ means F<foo/bar> style not F<foo\bar>.
Anything between white space and an end of line within a C<MANIFEST>
file is considered to be a comment. Any line beginning with # is also
-a comment.
+a comment. Beginning with ExtUtils::Manifest 1.52, a filename may
+contain whitespace characters if it is enclosed in single quotes; single
+quotes or backslashes in that filename must be backslash-escaped.
# this a comment
some/file
some/other/file comment about some/file
+ 'some/third file' comment
=head2 MANIFEST.SKIP
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/Mkbootstrap.pm b/gnu/usr.bin/perl/lib/ExtUtils/Mkbootstrap.pm
index b358709673f..f1b47f6750c 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/Mkbootstrap.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/Mkbootstrap.pm
@@ -3,16 +3,15 @@ package ExtUtils::Mkbootstrap;
# There's just too much Dynaloader incest here to turn on strict vars.
use strict 'refs';
-use vars qw($VERSION @ISA @EXPORT);
-$VERSION = '6.42';
+our $VERSION = '6.55_02';
require Exporter;
-@ISA = ('Exporter');
-@EXPORT = ('&Mkbootstrap');
+our @ISA = ('Exporter');
+our @EXPORT = ('&Mkbootstrap');
use Config;
-use vars qw($Verbose);
+our $Verbose = 0;
sub Mkbootstrap {
@@ -49,26 +48,26 @@ sub Mkbootstrap {
my(@all) = (@bsloadlibs, @DynaLoader::dl_resolve_using);
my($method) = '';
if (@all){
- open BS, ">$baseext.bs"
+ open my $bs, ">", "$baseext.bs"
or die "Unable to open $baseext.bs: $!";
print STDOUT "Writing $baseext.bs\n";
print STDOUT " containing: @all" if $Verbose;
- print BS "# $baseext DynaLoader bootstrap file for $^O architecture.\n";
- print BS "# Do not edit this file, changes will be lost.\n";
- print BS "# This file was automatically generated by the\n";
- print BS "# Mkbootstrap routine in ExtUtils::Mkbootstrap (v$VERSION).\n";
- print BS "\@DynaLoader::dl_resolve_using = ";
+ print $bs "# $baseext DynaLoader bootstrap file for $^O architecture.\n";
+ print $bs "# Do not edit this file, changes will be lost.\n";
+ print $bs "# This file was automatically generated by the\n";
+ print $bs "# Mkbootstrap routine in ExtUtils::Mkbootstrap (v$VERSION).\n";
+ print $bs "\@DynaLoader::dl_resolve_using = ";
# If @all contains names in the form -lxxx or -Lxxx then it's asking for
# runtime library location so we automatically add a call to dl_findfile()
if (" @all" =~ m/ -[lLR]/){
- print BS " dl_findfile(qw(\n @all\n ));\n";
+ print $bs " dl_findfile(qw(\n @all\n ));\n";
}else{
- print BS " qw(@all);\n";
+ print $bs " qw(@all);\n";
}
# write extra code if *_BS says so
- print BS $DynaLoader::bscode if $DynaLoader::bscode;
- print BS "\n1;\n";
- close BS;
+ print $bs $DynaLoader::bscode if $DynaLoader::bscode;
+ print $bs "\n1;\n";
+ close $bs;
}
}
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/Mksymlists.pm b/gnu/usr.bin/perl/lib/ExtUtils/Mksymlists.pm
index 49fd6b2abc7..9b133f74a7a 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/Mksymlists.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/Mksymlists.pm
@@ -1,6 +1,6 @@
package ExtUtils::Mksymlists;
-use 5.00503;
+use 5.006;
use strict qw[ subs refs ];
# no strict 'vars'; # until filehandles are exempted
@@ -8,10 +8,9 @@ use Carp;
use Exporter;
use Config;
-use vars qw(@ISA @EXPORT $VERSION);
-@ISA = 'Exporter';
-@EXPORT = '&Mksymlists';
-$VERSION = '6.42';
+our @ISA = qw(Exporter);
+our @EXPORT = qw(&Mksymlists);
+our $VERSION = '6.55_02';
sub Mksymlists {
my(%spec) = @_;
@@ -28,16 +27,17 @@ sub Mksymlists {
unless ( ($spec{DL_FUNCS} and keys %{$spec{DL_FUNCS}}) or
@{$spec{FUNCLIST}});
if (defined $spec{DL_FUNCS}) {
- my($package);
- foreach $package (keys %{$spec{DL_FUNCS}}) {
- my($packprefix,$sym,$bootseen);
+ foreach my $package (keys %{$spec{DL_FUNCS}}) {
+ my($packprefix,$bootseen);
($packprefix = $package) =~ s/\W/_/g;
- foreach $sym (@{$spec{DL_FUNCS}->{$package}}) {
+ foreach my $sym (@{$spec{DL_FUNCS}->{$package}}) {
if ($sym =~ /^boot_/) {
push(@{$spec{FUNCLIST}},$sym);
$bootseen++;
}
- else { push(@{$spec{FUNCLIST}},"XS_${packprefix}_$sym"); }
+ else {
+ push(@{$spec{FUNCLIST}},"XS_${packprefix}_$sym");
+ }
}
push(@{$spec{FUNCLIST}},"boot_$packprefix") unless $bootseen;
}
@@ -55,7 +55,9 @@ sub Mksymlists {
elsif ($osname eq 'VMS') { _write_vms(\%spec) }
elsif ($osname eq 'os2') { _write_os2(\%spec) }
elsif ($osname eq 'MSWin32') { _write_win32(\%spec) }
- else { croak("Don't know how to create linker option file for $osname\n"); }
+ else {
+ croak("Don't know how to create linker option file for $osname\n");
+ }
}
@@ -64,11 +66,11 @@ sub _write_aix {
rename "$data->{FILE}.exp", "$data->{FILE}.exp_old";
- open(EXP,">$data->{FILE}.exp")
+ open( my $exp, ">", "$data->{FILE}.exp")
or croak("Can't create $data->{FILE}.exp: $!\n");
- print EXP join("\n",@{$data->{DL_VARS}}, "\n") if @{$data->{DL_VARS}};
- print EXP join("\n",@{$data->{FUNCLIST}}, "\n") if @{$data->{FUNCLIST}};
- close EXP;
+ print $exp join("\n",@{$data->{DL_VARS}}, "\n") if @{$data->{DL_VARS}};
+ print $exp join("\n",@{$data->{FUNCLIST}}, "\n") if @{$data->{FUNCLIST}};
+ close $exp;
}
@@ -88,30 +90,30 @@ sub _write_os2 {
$Config::Config{version}, $threaded, $patchlevel, $data->{NAME};
chomp $comment;
if ($data->{INSTALLDIRS} and $data->{INSTALLDIRS} eq 'perl') {
- $distname = 'perl5-porters@perl.org';
- $comment = "Core $comment";
+ $distname = 'perl5-porters@perl.org';
+ $comment = "Core $comment";
}
$comment = "$comment (Perl-config: $Config{config_args})";
$comment = substr($comment, 0, 200) . "...)" if length $comment > 203;
rename "$data->{FILE}.def", "$data->{FILE}_def.old";
- open(DEF,">$data->{FILE}.def")
+ open(my $def, ">", "$data->{FILE}.def")
or croak("Can't create $data->{FILE}.def: $!\n");
- print DEF "LIBRARY '$data->{DLBASE}' INITINSTANCE TERMINSTANCE\n";
- print DEF "DESCRIPTION '\@#$distname:$data->{VERSION}#\@ $comment'\n";
- print DEF "CODE LOADONCALL\n";
- print DEF "DATA LOADONCALL NONSHARED MULTIPLE\n";
- print DEF "EXPORTS\n ";
- print DEF join("\n ",@{$data->{DL_VARS}}, "\n") if @{$data->{DL_VARS}};
- print DEF join("\n ",@{$data->{FUNCLIST}}, "\n") if @{$data->{FUNCLIST}};
+ print $def "LIBRARY '$data->{DLBASE}' INITINSTANCE TERMINSTANCE\n";
+ print $def "DESCRIPTION '\@#$distname:$data->{VERSION}#\@ $comment'\n";
+ print $def "CODE LOADONCALL\n";
+ print $def "DATA LOADONCALL NONSHARED MULTIPLE\n";
+ print $def "EXPORTS\n ";
+ print $def join("\n ",@{$data->{DL_VARS}}, "\n") if @{$data->{DL_VARS}};
+ print $def join("\n ",@{$data->{FUNCLIST}}, "\n") if @{$data->{FUNCLIST}};
if (%{$data->{IMPORTS}}) {
- print DEF "IMPORTS\n";
- my ($name, $exp);
- while (($name, $exp)= each %{$data->{IMPORTS}}) {
- print DEF " $name=$exp\n";
- }
+ print $def "IMPORTS\n";
+ my ($name, $exp);
+ while (($name, $exp)= each %{$data->{IMPORTS}}) {
+ print $def " $name=$exp\n";
+ }
}
- close DEF;
+ close $def;
}
sub _write_win32 {
@@ -124,13 +126,13 @@ sub _write_win32 {
}
rename "$data->{FILE}.def", "$data->{FILE}_def.old";
- open(DEF,">$data->{FILE}.def")
+ open( my $def, ">", "$data->{FILE}.def" )
or croak("Can't create $data->{FILE}.def: $!\n");
# put library name in quotes (it could be a keyword, like 'Alias')
if ($Config::Config{'cc'} !~ /^gcc/i) {
- print DEF "LIBRARY \"$data->{DLBASE}\"\n";
+ print $def "LIBRARY \"$data->{DLBASE}\"\n";
}
- print DEF "EXPORTS\n ";
+ print $def "EXPORTS\n ";
my @syms;
# Export public symbols both with and without underscores to
# ensure compatibility between DLLs from different compilers
@@ -138,24 +140,24 @@ sub _write_win32 {
# so this is only to cover the case when the extension DLL may be
# linked to directly from C. GSAR 97-07-10
if ($Config::Config{'cc'} =~ /^bcc/i) {
- for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) {
- push @syms, "_$_", "$_ = _$_";
- }
+ for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) {
+ push @syms, "_$_", "$_ = _$_";
+ }
}
else {
- for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) {
- push @syms, "$_", "_$_ = $_";
- }
+ for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) {
+ push @syms, "$_", "_$_ = $_";
+ }
}
- print DEF join("\n ",@syms, "\n") if @syms;
+ print $def join("\n ",@syms, "\n") if @syms;
if (%{$data->{IMPORTS}}) {
- print DEF "IMPORTS\n";
+ print $def "IMPORTS\n";
my ($name, $exp);
while (($name, $exp)= each %{$data->{IMPORTS}}) {
- print DEF " $name=$exp\n";
+ print $def " $name=$exp\n";
}
}
- close DEF;
+ close $def;
}
@@ -167,11 +169,10 @@ sub _write_vms {
my($isvax) = $Config::Config{'archname'} =~ /VAX/i;
my($set) = new ExtUtils::XSSymSet;
- my($sym);
rename "$data->{FILE}.opt", "$data->{FILE}.opt_old";
- open(OPT,">$data->{FILE}.opt")
+ open(my $opt,">", "$data->{FILE}.opt")
or croak("Can't create $data->{FILE}.opt: $!\n");
# Options file declaring universal symbols
@@ -181,21 +182,23 @@ sub _write_vms {
# We don't do anything to preserve order, so we won't relax
# the GSMATCH criteria for a dynamic extension
- print OPT "case_sensitive=yes\n"
+ print $opt "case_sensitive=yes\n"
if $Config::Config{d_vms_case_sensitive_symbols};
- foreach $sym (@{$data->{FUNCLIST}}) {
+
+ foreach my $sym (@{$data->{FUNCLIST}}) {
my $safe = $set->addsym($sym);
- if ($isvax) { print OPT "UNIVERSAL=$safe\n" }
- else { print OPT "SYMBOL_VECTOR=($safe=PROCEDURE)\n"; }
+ if ($isvax) { print $opt "UNIVERSAL=$safe\n" }
+ else { print $opt "SYMBOL_VECTOR=($safe=PROCEDURE)\n"; }
}
- foreach $sym (@{$data->{DL_VARS}}) {
+
+ foreach my $sym (@{$data->{DL_VARS}}) {
my $safe = $set->addsym($sym);
- print OPT "PSECT_ATTR=${sym},PIC,OVR,RD,NOEXE,WRT,NOSHR\n";
- if ($isvax) { print OPT "UNIVERSAL=$safe\n" }
- else { print OPT "SYMBOL_VECTOR=($safe=DATA)\n"; }
+ print $opt "PSECT_ATTR=${sym},PIC,OVR,RD,NOEXE,WRT,NOSHR\n";
+ if ($isvax) { print $opt "UNIVERSAL=$safe\n" }
+ else { print $opt "SYMBOL_VECTOR=($safe=DATA)\n"; }
}
- close OPT;
-
+
+ close $opt;
}
1;
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/t/bytes.t b/gnu/usr.bin/perl/lib/ExtUtils/t/bytes.t
deleted file mode 100644
index e566831cc21..00000000000
--- a/gnu/usr.bin/perl/lib/ExtUtils/t/bytes.t
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 4;
-
-use_ok('ExtUtils::MakeMaker::bytes');
-
-SKIP: {
- skip "bytes.pm appeared in 5.6", 3 if $] < 5.006;
-
- my $chr = chr(400);
- is( length $chr, 1 );
-
- {
- use ExtUtils::MakeMaker::bytes;
- is( length $chr, 2, 'byte.pm in effect' );
- }
-
- is( length $chr, 1, ' score is lexical' );
-}
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/t/parse_version.t b/gnu/usr.bin/perl/lib/ExtUtils/t/parse_version.t
index b56a02b2850..25769cb2e09 100755
--- a/gnu/usr.bin/perl/lib/ExtUtils/t/parse_version.t
+++ b/gnu/usr.bin/perl/lib/ExtUtils/t/parse_version.t
@@ -18,7 +18,7 @@ my $Has_Version = eval 'require version; "version"->import; 1';
my %versions = (q[$VERSION = '1.00'] => '1.00',
q[*VERSION = \'1.01'] => '1.01',
- q[($VERSION) = q/Revision: 32208 / =~ /(\d+)/g;] => 32208,
+ q[($VERSION) = q$Revision: 1.4 $ =~ /(\d+)/g;] => 32208,
q[$FOO::VERSION = '1.10';] => '1.10',
q[*FOO::VERSION = \'1.11';] => '1.11',
'$VERSION = 0.02' => 0.02,
@@ -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: 1.4 $ =~ /(\d+)\.(\d+)/);' => '3.074',
+ '$VERSION = substr(q$Revision: 1.4 $, 10) + 2 . "";' => '4.8',
);
if( $Has_Version ) {
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/t/vmsish.t b/gnu/usr.bin/perl/lib/ExtUtils/t/vmsish.t
deleted file mode 100644
index 6195a0d5c11..00000000000
--- a/gnu/usr.bin/perl/lib/ExtUtils/t/vmsish.t
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 1;
-
-use_ok('ExtUtils::MakeMaker::vmsish');
-
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/testlib.pm b/gnu/usr.bin/perl/lib/ExtUtils/testlib.pm
index 972b1b9c53b..b1231e2c4cb 100644
--- a/gnu/usr.bin/perl/lib/ExtUtils/testlib.pm
+++ b/gnu/usr.bin/perl/lib/ExtUtils/testlib.pm
@@ -1,9 +1,9 @@
package ExtUtils::testlib;
use strict;
+use warnings;
-use vars qw($VERSION);
-$VERSION = 6.42;
+our $VERSION = 6.55_02;
use Cwd;
use File::Spec;
@@ -17,7 +17,7 @@ my $cwd;
BEGIN {
($cwd) = getcwd() =~ /(.*)/;
}
-use lib map File::Spec->rel2abs($_, $cwd), qw(blib/arch blib/lib);
+use lib map { File::Spec->rel2abs($_, $cwd) } qw(blib/arch blib/lib);
1;
__END__