diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-02-08 13:07:25 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-02-08 13:07:25 +0000 |
commit | a592ba15a3fa6c61975e7fb62c50cd2f64c750d6 (patch) | |
tree | 82a837ea03710de3dc0a81d0b9c3431527057b16 /lib/ExtUtils | |
parent | 5de3775cb1f5ef0af0777e63f1032a2b570b9dd9 (diff) | |
download | perl-a592ba15a3fa6c61975e7fb62c50cd2f64c750d6.tar.gz |
Upgrade to MakeMaker 6.43_01
p4raw-id: //depot/perl@33250
Diffstat (limited to 'lib/ExtUtils')
33 files changed, 540 insertions, 533 deletions
diff --git a/lib/ExtUtils/Changes b/lib/ExtUtils/Changes index c4c37c80a3..a96d92866d 100644 --- a/lib/ExtUtils/Changes +++ b/lib/ExtUtils/Changes @@ -1,3 +1,40 @@ +6.43_01 Tue Jan 1 16:06:47 PST 2008 + Bug Fixes + * Change the "is this really a Perl core library directory" checks to + look for strict instead of Exporter. Now that Exporter is on CPAN + it can wind up in site_perl. + * split_command() will now set aside a little more space for macro + expansion. This should help on systems with cramped command line + lengths. Specifically, Pugs on Win32. [rt.cpan.org 20145] + + Installation + * MakeMaker would not install if the installed MakeMaker was too old, + like on 5.6.1. The installation process was still using the + installed MakeMaker in a few places. This has been fixed. + [rt.cpan.org 24746] + + OS X + * "make dist" will no longer bundle up resource fork files (._foo). + [rt.cpan.org 29525] + + Docs + * The documentation of VERSION_FROM was recommending vstrings (1.2.3) + which have never worked right. + * The documentation for the accepted values of LICENSE moved to + Module::Build::API. [rt.cpan.org 32020] + + Tests + * The compilation test was testing the installed modules, not the + about-to-be-installed. + * xs.t would fail if ExtUtils::CBuilder was not installed. + + Misc + * Cleanups brought to you by no more 5.5 compatibility! + * MakeMaker is now perlcritic clean at severity level 5... except + the really silly ones. + * DIE use vars DIE! + * Added some resources to the META.yml + 6.42 Fri Dec 7 17:00:14 PST 2007 Bug Fixes - 6.33 moved PREREQ_FATAL to happen after CONFIGURE. This meant if diff --git a/lib/ExtUtils/Command/MM.pm b/lib/ExtUtils/Command/MM.pm index 48a66cedb9..03da0dd939 100644 --- a/lib/ExtUtils/Command/MM.pm +++ b/lib/ExtUtils/Command/MM.pm @@ -1,15 +1,16 @@ package ExtUtils::Command::MM; +require 5.006; + use strict; +use warnings; -require 5.005_03; require Exporter; -use vars qw($VERSION @ISA @EXPORT); -@ISA = qw(Exporter); +our @ISA = qw(Exporter); -@EXPORT = qw(test_harness pod2man perllocal_install uninstall - warn_if_old_packlist); -$VERSION = '6.42'; +our @EXPORT = qw(test_harness pod2man perllocal_install uninstall + warn_if_old_packlist); +our $VERSION = '6.43_01'; my $Is_VMS = $^O eq 'VMS'; @@ -89,14 +90,14 @@ If no arguments are given to pod2man it will read from @ARGV. =cut sub pod2man { + local @ARGV = @_ ? @_ : @ARGV; + require Pod::Man; require Getopt::Long; - my %options = (); - # We will cheat and just use Getopt::Long. We fool it by putting # our arguments into @ARGV. Should be safe. - local @ARGV = @_ ? @_ : @ARGV; + my %options = (); Getopt::Long::config ('bundling_override'); Getopt::Long::GetOptions (\%options, 'section|s=s', 'release|r=s', 'center|c=s', @@ -193,7 +194,8 @@ sub perllocal_install { # VMS feeds args as a piped file on STDIN since it usually can't # fit all the args on a single command line. - @ARGV = split /\|/, <STDIN> if $Is_VMS; + my @mod_info = $Is_VMS ? split /\|/, <STDIN> + : @ARGV; my $pod; $pod = sprintf <<POD, scalar localtime; @@ -204,7 +206,7 @@ sub perllocal_install { POD do { - my($key, $val) = splice(@ARGV, 0, 2); + my($key, $val) = splice(@mod_info, 0, 2); $pod .= <<POD =item * @@ -213,7 +215,7 @@ POD POD - } while(@ARGV); + } while(@mod_info); $pod .= "=back\n\n"; $pod =~ s/^ //mg; diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index 2991149fc7..ad130c0659 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -2,12 +2,11 @@ package ExtUtils::Liblist; use strict; -use vars qw($VERSION @ISA); -$VERSION = '6.42'; +our $VERSION = '6.43_01'; 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/lib/ExtUtils/Liblist/Kid.pm b/lib/ExtUtils/Liblist/Kid.pm index bef182b1bd..9144e538b8 100644 --- a/lib/ExtUtils/Liblist/Kid.pm +++ b/lib/ExtUtils/Liblist/Kid.pm @@ -5,12 +5,11 @@ package ExtUtils::Liblist::Kid; # This kid package is to be used by MakeMaker. It will not work if # $self is not a Makemaker. -use 5.00503; +use 5.006; # Broken out of MakeMaker from version 4.11 use strict; -use vars qw($VERSION); -$VERSION = 6.42; +our $VERSION = 6.43_01; use Config; use Cwd 'cwd'; @@ -50,11 +49,11 @@ sub _unix_os2_ext { my(@libpath) = split " ", $Config{'libpth'}; my(@ldloadlibs, @bsloadlibs, @extralibs, @ld_run_path, %ld_run_path_seen); my(@libs, %libs_seen); - my($fullname, $thislib, $thispth, @fullname); + my($fullname, @fullname); my($pwd) = cwd(); # from Cwd.pm my($found) = 0; - foreach $thislib (split ' ', $potential_libs){ + foreach my $thislib (split ' ', $potential_libs) { # Handle possible linker path arguments. if ($thislib =~ s/^(-[LR]|-Wl,-R)//){ # save path flag type @@ -89,7 +88,7 @@ sub _unix_os2_ext { } my($found_lib)=0; - foreach $thispth (@searchpath, @libpath){ + foreach my $thispth (@searchpath, @libpath) { # Try to find the full name of the library. We need this to # determine whether it's a dynamically-loadable library or not. @@ -259,7 +258,7 @@ sub _win32_ext { my $lib = ''; my $found = 0; my $search = 1; - my($fullname, $thislib, $thispth); + my($fullname); # add "$Config{installarchlib}/CORE" to default search path push @libpath, "$Config{installarchlib}/CORE"; @@ -270,7 +269,7 @@ sub _win32_ext { foreach (Text::ParseWords::quotewords('\s+', 0, $potential_libs)){ - $thislib = $_; + my $thislib = $_; # see if entry is a flag if (/^:\w+$/) { @@ -323,7 +322,7 @@ sub _win32_ext { } my $found_lib = 0; - foreach $thispth (@searchpath, @libpath){ + foreach my $thispth (@searchpath, @libpath){ unless (-f ($fullname="$thispth\\$_")) { warn "'$thislib' not found as '$fullname'\n" if $verbose; next; @@ -372,7 +371,7 @@ sub _win32_ext { sub _vms_ext { - my($self, $potential_libs,$verbose,$give_libs) = @_; + my($self, $potential_libs, $verbose, $give_libs) = @_; $verbose ||= 0; my(@crtls,$crtlstr); @@ -386,8 +385,8 @@ sub _vms_ext { # to insure that the copy in the local tree is used, rather than one to # which a system-wide logical may point. if ($self->{PERL_SRC}) { - my($lib,$locspec,$type); - foreach $lib (@crtls) { + my($locspec,$type); + foreach my $lib (@crtls) { if (($locspec,$type) = $lib =~ m{^([\w\$-]+)(/\w+)?} and $locspec =~ /perl/i) { if (lc $type eq '/share') { $locspec .= $Config{'exe_ext'}; } elsif (lc $type eq '/library') { $locspec .= $Config{'lib_ext'}; } @@ -404,7 +403,7 @@ sub _vms_ext { return ('', '', $crtlstr, '', ($give_libs ? [] : ())); } - my(@dirs,@libs,$dir,$lib,%found,@fndlibs,$ldlib); + my(%found,@fndlibs,$ldlib); my $cwd = cwd(); my($so,$lib_ext,$obj_ext) = @Config{'so','lib_ext','obj_ext'}; # List of common Unix library names and their VMS equivalents @@ -421,7 +420,8 @@ sub _vms_ext { warn "Potential libraries are '$potential_libs'\n" if $verbose; # First, sort out directories and library names in the input - foreach $lib (split ' ',$potential_libs) { + my(@dirs, @libs); + foreach my $lib (split ' ',$potential_libs) { push(@dirs,$1), next if $lib =~ /^-L(.*)/; push(@dirs,$lib), next if $lib =~ /[:>\]]$/; push(@dirs,$lib), next if -d $lib; @@ -433,7 +433,7 @@ sub _vms_ext { # Now make sure we've got VMS-syntax absolute directory specs # (We don't, however, check whether someone's hidden a relative # path in a logical name.) - foreach $dir (@dirs) { + foreach my $dir (@dirs) { unless (-d $dir) { warn "Skipping nonexistent Directory $dir\n" if $verbose > 1; $dir = ''; @@ -450,13 +450,13 @@ sub _vms_ext { @dirs = grep { length($_) } @dirs; unshift(@dirs,''); # Check each $lib without additions first - LIB: foreach $lib (@libs) { + LIB: foreach my $lib (@libs) { if (exists $libmap{$lib}) { next unless length $libmap{$lib}; $lib = $libmap{$lib}; } - my(@variants,$variant,$cand); + my(@variants,$cand); my($ctype) = ''; # If we don't have a file type, consider it a possibly abbreviated name and @@ -469,10 +469,10 @@ sub _vms_ext { } push(@variants,$lib); warn "Looking for $lib\n" if $verbose; - foreach $variant (@variants) { + foreach my $variant (@variants) { my($fullname, $name); - foreach $dir (@dirs) { + foreach my $dir (@dirs) { my($type); $name = "$dir$variant"; @@ -536,7 +536,7 @@ sub _vms_ext { push @fndlibs, @{$found{OBJ}} if exists $found{OBJ}; push @fndlibs, map { "$_/Library" } @{$found{OLB}} if exists $found{OLB}; push @fndlibs, map { "$_/Share" } @{$found{SHR}} if exists $found{SHR}; - $lib = join(' ',@fndlibs); + my $lib = join(' ',@fndlibs); $ldlib = $crtlstr ? "$lib $crtlstr" : $lib; warn "Result:\n\tEXTRALIBS: $lib\n\tLDLOADLIBS: $ldlib\n" if $verbose; diff --git a/lib/ExtUtils/MM.pm b/lib/ExtUtils/MM.pm index 546b76dbcc..0b688d1bf7 100644 --- a/lib/ExtUtils/MM.pm +++ b/lib/ExtUtils/MM.pm @@ -2,13 +2,12 @@ package ExtUtils::MM; use strict; use ExtUtils::MakeMaker::Config; -use vars qw(@ISA $VERSION); -$VERSION = '6.42'; + +our $VERSION = '6.43_01'; require ExtUtils::Liblist; require ExtUtils::MakeMaker; - -@ISA = qw(ExtUtils::Liblist ExtUtils::MakeMaker); +our @ISA = qw(ExtUtils::Liblist ExtUtils::MakeMaker); =head1 NAME @@ -38,8 +37,7 @@ away. { # Convenient alias. package MM; - use vars qw(@ISA); - @ISA = qw(ExtUtils::MM); + our @ISA = qw(ExtUtils::MM); sub DESTROY {} } @@ -69,6 +67,7 @@ if( $Is{NW5} ) { $Is{VOS} = $^O eq 'vos'; $Is{QNX} = $^O eq 'qnx'; $Is{AIX} = $^O eq 'aix'; +$Is{Darwin} = $^O eq 'darwin'; $Is{Unix} = !grep { $_ } values %Is; @@ -78,7 +77,7 @@ my($OS) = keys %Is; my $class = "ExtUtils::MM_$OS"; -eval "require $class" unless $INC{"ExtUtils/MM_$OS.pm"}; +eval "require $class" unless $INC{"ExtUtils/MM_$OS.pm"}; ## no critic die $@ if $@; unshift @ISA, $class; diff --git a/lib/ExtUtils/MM_AIX.pm b/lib/ExtUtils/MM_AIX.pm index f847303bae..988cba7657 100644 --- a/lib/ExtUtils/MM_AIX.pm +++ b/lib/ExtUtils/MM_AIX.pm @@ -1,11 +1,10 @@ package ExtUtils::MM_AIX; use strict; -use vars qw($VERSION @ISA); -$VERSION = '6.42'; +our $VERSION = '6.43_01'; require ExtUtils::MM_Unix; -@ISA = qw(ExtUtils::MM_Unix); +our @ISA = qw(ExtUtils::MM_Unix); use ExtUtils::MakeMaker qw(neatvalue); diff --git a/lib/ExtUtils/MM_Any.pm b/lib/ExtUtils/MM_Any.pm index b3d0d0f088..4f6e3d350c 100644 --- a/lib/ExtUtils/MM_Any.pm +++ b/lib/ExtUtils/MM_Any.pm @@ -1,12 +1,11 @@ package ExtUtils::MM_Any; use strict; -use vars qw($VERSION @ISA); -$VERSION = '6.42'; +our $VERSION = '6.43_01'; use Carp; use File::Spec; -BEGIN { @ISA = qw(File::Spec); } +BEGIN { our @ISA = qw(File::Spec); } # We need $Verbose use ExtUtils::MakeMaker qw($Verbose); @@ -145,8 +144,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 { diff --git a/lib/ExtUtils/MM_BeOS.pm b/lib/ExtUtils/MM_BeOS.pm index d7812b3f91..1425ec1e19 100644 --- a/lib/ExtUtils/MM_BeOS.pm +++ b/lib/ExtUtils/MM_BeOS.pm @@ -25,9 +25,8 @@ use File::Spec; require ExtUtils::MM_Any; require ExtUtils::MM_Unix; -use vars qw(@ISA $VERSION); -@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix ); -$VERSION = '6.42'; +our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix ); +our $VERSION = '6.43_01'; =item os_flavor diff --git a/lib/ExtUtils/MM_Cygwin.pm b/lib/ExtUtils/MM_Cygwin.pm index ca4d58d9ec..ba793f7b1b 100644 --- a/lib/ExtUtils/MM_Cygwin.pm +++ b/lib/ExtUtils/MM_Cygwin.pm @@ -1,16 +1,15 @@ package ExtUtils::MM_Cygwin; use strict; -use vars qw($VERSION @ISA); use ExtUtils::MakeMaker::Config; use File::Spec; 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 ); -$VERSION = '6.42'; +our $VERSION = '6.43_01'; =head1 NAME diff --git a/lib/ExtUtils/MM_DOS.pm b/lib/ExtUtils/MM_DOS.pm index f47a72d1ef..0310a06b17 100644 --- a/lib/ExtUtils/MM_DOS.pm +++ b/lib/ExtUtils/MM_DOS.pm @@ -1,13 +1,12 @@ package ExtUtils::MM_DOS; use strict; -use vars qw($VERSION @ISA); -$VERSION = 6.42; +our $VERSION = 6.43_01; 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 ); =head1 NAME diff --git a/lib/ExtUtils/MM_MacOS.pm b/lib/ExtUtils/MM_MacOS.pm index 32d5ffed5d..e1796f3066 100644 --- a/lib/ExtUtils/MM_MacOS.pm +++ b/lib/ExtUtils/MM_MacOS.pm @@ -2,8 +2,7 @@ package ExtUtils::MM_MacOS; use strict; -use vars qw($VERSION); -$VERSION = 6.42; +our $VERSION = 6.43_01; sub new { die <<'UNSUPPORTED'; diff --git a/lib/ExtUtils/MM_NW5.pm b/lib/ExtUtils/MM_NW5.pm index 222008a7fb..6536986285 100644 --- a/lib/ExtUtils/MM_NW5.pm +++ b/lib/ExtUtils/MM_NW5.pm @@ -22,11 +22,10 @@ use strict; use ExtUtils::MakeMaker::Config; use File::Basename; -use vars qw(@ISA $VERSION); -$VERSION = '6.42'; +our $VERSION = '6.43_01'; require ExtUtils::MM_Win32; -@ISA = qw(ExtUtils::MM_Win32); +our @ISA = qw(ExtUtils::MM_Win32); use ExtUtils::MakeMaker qw( &neatvalue ); diff --git a/lib/ExtUtils/MM_OS2.pm b/lib/ExtUtils/MM_OS2.pm index 7d14ac701d..33ac54b9ca 100644 --- a/lib/ExtUtils/MM_OS2.pm +++ b/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.43_01'; 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/lib/ExtUtils/MM_QNX.pm b/lib/ExtUtils/MM_QNX.pm index 98009bfc3e..d9038153d3 100644 --- a/lib/ExtUtils/MM_QNX.pm +++ b/lib/ExtUtils/MM_QNX.pm @@ -1,11 +1,10 @@ package ExtUtils::MM_QNX; use strict; -use vars qw($VERSION @ISA); -$VERSION = '6.42'; +our $VERSION = '6.43_01'; require ExtUtils::MM_Unix; -@ISA = qw(ExtUtils::MM_Unix); +our @ISA = qw(ExtUtils::MM_Unix); =head1 NAME diff --git a/lib/ExtUtils/MM_UWIN.pm b/lib/ExtUtils/MM_UWIN.pm index 6be793010f..67fd1080f7 100644 --- a/lib/ExtUtils/MM_UWIN.pm +++ b/lib/ExtUtils/MM_UWIN.pm @@ -1,11 +1,10 @@ package ExtUtils::MM_UWIN; use strict; -use vars qw($VERSION @ISA); -$VERSION = 6.42; +our $VERSION = 6.43_01; require ExtUtils::MM_Unix; -@ISA = qw(ExtUtils::MM_Unix); +our @ISA = qw(ExtUtils::MM_Unix); =head1 NAME diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index 854cb0b0ad..36ec6a1973 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/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,40 +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_03'; -$VERSION = eval $VERSION; +# If we make $VERSION an our variable parse_version() breaks +use vars qw($VERSION); +$VERSION = '6.43_01'; 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; @@ -164,7 +161,7 @@ sub c_o { push @m, qq{ .C\$(OBJ_EXT): $command \$*.C -} if !$Is_OS2 and !$Is_Win32 and !$Is_Dos; #Case-specific +} if !$Is{OS2} and !$Is{Win32} and !$Is{Dos}; #Case-specific return join "", @m; } @@ -232,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; @@ -309,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); } @@ -339,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; } @@ -859,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 @@ -898,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). @@ -917,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 @@ -933,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 @@ -995,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 @@ -1006,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 { @@ -1018,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 @@ -1044,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) { @@ -1081,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; @@ -1106,8 +1107,8 @@ sub fixin { # stolen from the pink Camel book, more or less my (@absdirs) = 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; @@ -1132,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" @@ -1140,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; @@ -1169,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 ':'; } } @@ -1179,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."; @@ -1255,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); @@ -1284,10 +1284,10 @@ 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 ; } @@ -1339,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; @@ -1462,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}"]; } @@ -1597,7 +1596,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; @@ -1616,11 +1615,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}; } @@ -1628,11 +1627,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 @@ -1667,7 +1666,7 @@ from the perl source tree. 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")) { $self->{PERL_LIB} = $lib; @@ -1694,17 +1693,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: @@ -1724,11 +1723,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 @@ -1754,8 +1753,8 @@ sub init_others { # --- Initialize Other Attributes $self->{LIBS} = [''] unless @{$self->{LIBS}} && defined $self->{LIBS}[0]; $self->{LD_RUN_PATH} = ""; - my($libs); - foreach $libs ( @{$self->{LIBS}} ){ + + foreach my $libs ( @{$self->{LIBS}} ){ $libs =~ s/^\s*(.*\S)\s*$/$1/; # remove leading and trailing whitespace my(@libs) = $self->extliblist($libs); if ($libs[0] or $libs[1] or $libs[2]){ @@ -1932,7 +1931,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. @@ -1959,7 +1958,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 @@ -1980,9 +1979,6 @@ sub init_PERL { $self->{ABSPERL} = 'MCR '.$self->{ABSPERL} if $has_mcr; } - $self->{ABSPERL} = qq{"$self->{ABSPERL}"} - if ($self->{ABSPERL} =~ /\s/) && ! $has_mcr; - # Are we building the core? $self->{PERL_CORE} = $ENV{PERL_CORE} unless exists $self->{PERL_CORE}; $self->{PERL_CORE} = 0 unless defined $self->{PERL_CORE}; @@ -2219,7 +2215,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) { @@ -2229,7 +2225,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; @@ -2403,16 +2399,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; @@ -2421,15 +2415,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 ); } } @@ -2457,7 +2448,7 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib push @$extra, $_; } - map(s/^(.*)/"-I$1"/, @{$perlinc || []}); + grep(s/^(.*)/"-I$1"/, @{$perlinc || []}); $target ||= "perl"; $tmp ||= "."; @@ -2487,10 +2478,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}; } } @@ -2514,8 +2505,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"; } @@ -2587,7 +2577,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; @@ -2632,8 +2622,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}; @@ -2641,7 +2631,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; @@ -2660,13 +2650,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; @@ -2674,7 +2664,8 @@ sub parse_abstract { $result = $2; last; } - close FH; + close $fh; + return $result; } @@ -2696,12 +2687,12 @@ 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; @@ -2722,14 +2713,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; } - close FH; + close $fh; $result = "undef" unless defined $result; return $result; @@ -2745,13 +2737,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) ) { @@ -2759,7 +2751,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)\""; } @@ -3103,7 +3095,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)); } @@ -3392,11 +3384,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"; } @@ -3572,23 +3564,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/) diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index 3b47470264..a4b2eb91c7 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/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.43_01'; 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; } @@ -954,35 +957,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 +1042,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 +1065,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 +1337,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 +1390,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 +1406,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 +1441,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 +1453,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; @@ -1889,7 +1889,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/lib/ExtUtils/MM_VOS.pm b/lib/ExtUtils/MM_VOS.pm index 171a8b727e..cd734ab2ab 100644 --- a/lib/ExtUtils/MM_VOS.pm +++ b/lib/ExtUtils/MM_VOS.pm @@ -1,11 +1,10 @@ package ExtUtils::MM_VOS; use strict; -use vars qw($VERSION @ISA); -$VERSION = '6.42'; +our $VERSION = '6.43_01'; require ExtUtils::MM_Unix; -@ISA = qw(ExtUtils::MM_Unix); +our @ISA = qw(ExtUtils::MM_Unix); =head1 NAME diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm index 8975e31f73..3bd717e761 100644 --- a/lib/ExtUtils/MM_Win32.pm +++ b/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.43_01'; $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 diff --git a/lib/ExtUtils/MM_Win95.pm b/lib/ExtUtils/MM_Win95.pm index 7dbdee6332..3933e7eacf 100644 --- a/lib/ExtUtils/MM_Win95.pm +++ b/lib/ExtUtils/MM_Win95.pm @@ -2,11 +2,10 @@ package ExtUtils::MM_Win95; use strict; -use vars qw($VERSION @ISA); -$VERSION = '6.42'; +our $VERSION = '6.43_01'; require ExtUtils::MM_Win32; -@ISA = qw(ExtUtils::MM_Win32); +our @ISA = qw(ExtUtils::MM_Win32); use ExtUtils::MakeMaker::Config; diff --git a/lib/ExtUtils/MY.pm b/lib/ExtUtils/MY.pm index d8de9aa750..136b9b9801 100644 --- a/lib/ExtUtils/MY.pm +++ b/lib/ExtUtils/MY.pm @@ -3,14 +3,12 @@ package ExtUtils::MY; use strict; require ExtUtils::MM; -use vars qw(@ISA $VERSION); -$VERSION = 6.42; -@ISA = qw(ExtUtils::MM); +our $VERSION = 6.43_01; +our @ISA = qw(ExtUtils::MM); { package MY; - use vars qw(@ISA); - @ISA = qw(ExtUtils::MY); + our @ISA = qw(ExtUtils::MY); } sub DESTROY {} diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index dd2e2358df..5ecba06203 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -1,43 +1,37 @@ -# $Id: /mirror/svn.schwern.org/CPAN/ExtUtils-MakeMaker/trunk/lib/ExtUtils/MakeMaker.pm 41145 2007-12-08T01:01:11.051959Z schwern $ +# $Id: /local/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 41372 2008-01-02T00:07:06.491251Z schwern $ 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 +my @MM_Sections; +my @Overridable; +my @Prepend_parent; +my %Recognized_Att_Keys; -$VERSION = '6.42'; -($Revision) = q$Revision: 41145 $ =~ /Revision:\s+(\S+)/; +our $VERSION = '6.43_01'; +our ($Revision) = q$Revision: 41372 $ =~ /Revision:\s+(\S+)/; +our $Filename = __FILE__; # referenced outside MakeMaker -@ISA = qw(Exporter); -@EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt); -@EXPORT_OK = qw($VERSION &neatvalue &mkbootstrap &mksymlists - &WriteEmptyMakefile); +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 @@ -143,7 +137,7 @@ sub _format_att { } -sub prompt ($;$) { +sub prompt ($;$) { ## no critic my($mess, $def) = @_; Carp::confess("prompt function called without an argument") unless defined $mess; @@ -454,19 +448,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. @@ -606,8 +600,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 +655,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,7 +668,7 @@ makemakerdflt : test : EOP - close MF or die "close $new for write: $!"; + close $mfh or die "close $new for write: $!"; } sub check_manifest { @@ -794,7 +787,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 +806,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 +828,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 +893,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; @@ -1756,7 +1750,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". @@ -2190,26 +2184,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: 41145 $ =~ /(\d+)/g; + $VERSION = '1.00'; + *VERSION = \'1.01'; + ($VERSION) = q$Revision: 41372 $ =~ /(\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); diff --git a/lib/ExtUtils/MakeMaker/Config.pm b/lib/ExtUtils/MakeMaker/Config.pm index 65f9d47475..6bdbbd58b3 100644 --- a/lib/ExtUtils/MakeMaker/Config.pm +++ b/lib/ExtUtils/MakeMaker/Config.pm @@ -1,18 +1,18 @@ package ExtUtils::MakeMaker::Config; -$VERSION = '6.42'; - use strict; + +our $VERSION = '6.43_01'; + use Config (); # Give us an overridable config. -use vars qw(%Config); -%Config = %Config::Config; +our %Config = %Config::Config; sub import { my $caller = caller; - no strict 'refs'; + no strict 'refs'; ## no critic *{$caller.'::Config'} = \%Config; } diff --git a/lib/ExtUtils/MakeMaker/FAQ.pod b/lib/ExtUtils/MakeMaker/FAQ.pod index f733cb8c1a..e681b0178d 100644 --- a/lib/ExtUtils/MakeMaker/FAQ.pod +++ b/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__ diff --git a/lib/ExtUtils/MakeMaker/Tutorial.pod b/lib/ExtUtils/MakeMaker/Tutorial.pod index a4aae73eb0..8ad72649b1 100644 --- a/lib/ExtUtils/MakeMaker/Tutorial.pod +++ b/lib/ExtUtils/MakeMaker/Tutorial.pod @@ -1,7 +1,6 @@ package ExtUtils::MakeMaker::Tutorial; -use vars qw($VERSION); -$VERSION = 0.02; +our $VERSION = 0.02; =head1 NAME diff --git a/lib/ExtUtils/MakeMaker/bytes.pm b/lib/ExtUtils/MakeMaker/bytes.pm index 41ae2077a8..5f621c844b 100644 --- a/lib/ExtUtils/MakeMaker/bytes.pm +++ b/lib/ExtUtils/MakeMaker/bytes.pm @@ -2,10 +2,9 @@ package ExtUtils::MakeMaker::bytes; use strict; -use vars qw($VERSION); -$VERSION = 6.42; +our $VERSION = 6.43_01; -my $Have_Bytes = eval q{require bytes; 1;}; +my $Have_Bytes = eval { require bytes; 1; }; sub import { return unless $Have_Bytes; diff --git a/lib/ExtUtils/MakeMaker/vmsish.pm b/lib/ExtUtils/MakeMaker/vmsish.pm index f3d0ac8cf7..16af8af61b 100644 --- a/lib/ExtUtils/MakeMaker/vmsish.pm +++ b/lib/ExtUtils/MakeMaker/vmsish.pm @@ -2,8 +2,7 @@ package ExtUtils::MakeMaker::vmsish; use strict; -use vars qw($VERSION); -$VERSION = 6.42; +our $VERSION = 6.43_01; my $IsVMS = $^O eq 'VMS'; diff --git a/lib/ExtUtils/Mkbootstrap.pm b/lib/ExtUtils/Mkbootstrap.pm index b358709673..41352a3796 100644 --- a/lib/ExtUtils/Mkbootstrap.pm +++ b/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.43_01'; 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/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm index 49fd6b2abc..331cecd011 100644 --- a/lib/ExtUtils/Mksymlists.pm +++ b/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.43_01'; 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/lib/ExtUtils/t/00compile.t b/lib/ExtUtils/t/00compile.t index e2995dc4a2..fb9943ae78 100644 --- a/lib/ExtUtils/t/00compile.t +++ b/lib/ExtUtils/t/00compile.t @@ -31,10 +31,11 @@ close MANIFEST; chdir 'lib'; plan tests => scalar @modules * 2; foreach my $file (@modules) { - # 5.8.0 has a bug about require alone in an eval. Thus the extra - # statement. - eval { require($file); 1 }; - is( $@, '', "require $file" ); + # Make sure we look at the local files and do not reload them if + # they're already loaded. This avoids recompilation warnings. + local @INC = @INC; + unshift @INC, "."; + ok eval { require($file); 1 } or diag "require $file failed.\n$@"; SKIP: { skip "Test::Pod not installed", 1 unless $Has_Test_Pod; diff --git a/lib/ExtUtils/t/MM_Unix.t b/lib/ExtUtils/t/MM_Unix.t index ffcfd295de..75af156542 100644 --- a/lib/ExtUtils/t/MM_Unix.t +++ b/lib/ExtUtils/t/MM_Unix.t @@ -31,10 +31,10 @@ my $class = 'ExtUtils::MM_Unix'; # only one of the following can be true # test should be removed if MM_Unix ever stops handling other OS than Unix -my $os = ($ExtUtils::MM_Unix::Is_OS2 || 0) - + ($ExtUtils::MM_Unix::Is_Win32 || 0) - + ($ExtUtils::MM_Unix::Is_Dos || 0) - + ($ExtUtils::MM_Unix::Is_VMS || 0); +my $os = ($ExtUtils::MM_Unix::Is{OS2} || 0) + + ($ExtUtils::MM_Unix::Is{Win32} || 0) + + ($ExtUtils::MM_Unix::Is{Dos} || 0) + + ($ExtUtils::MM_Unix::Is{VMS} || 0); ok ( $os <= 1, 'There can be only one (or none)'); cmp_ok ($ExtUtils::MM_Unix::VERSION, '>=', '1.12606', 'Should be at least version 1.12606'); diff --git a/lib/ExtUtils/t/xs.t b/lib/ExtUtils/t/xs.t index 1cadc109b7..cab52047a7 100644 --- a/lib/ExtUtils/t/xs.t +++ b/lib/ExtUtils/t/xs.t @@ -19,7 +19,7 @@ use File::Spec; use File::Path; if( have_compiler() ) { - plan tests => 7; + plan tests => 5; } else { plan skip_all => "ExtUtils::CBuilder not installed or couldn't find a compiler"; @@ -39,8 +39,8 @@ $| = 1; ok( setup_xs(), 'setup' ); END { - ok( chdir File::Spec->updir ); - ok( teardown_xs(), 'teardown' ); + chdir File::Spec->updir or die; + teardown_xs(), 'teardown' or die; } ok( chdir('XS-Test'), "chdir'd to XS-Test" ) || diff --git a/lib/ExtUtils/testlib.pm b/lib/ExtUtils/testlib.pm index 972b1b9c53..884077dc49 100644 --- a/lib/ExtUtils/testlib.pm +++ b/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.43_01; 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__ |