+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
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';
=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',
# 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;
POD
do {
- my($key, $val) = splice(@ARGV, 0, 2);
+ my($key, $val) = splice(@mod_info, 0, 2);
$pod .= <<POD
=item *
POD
- } while(@ARGV);
+ } while(@mod_info);
$pod .= "=back\n\n";
$pod =~ s/^ //mg;
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 {
# 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';
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
}
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.
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";
foreach (Text::ParseWords::quotewords('\s+', 0, $potential_libs)){
- $thislib = $_;
+ my $thislib = $_;
# see if entry is a flag
if (/^:\w+$/) {
}
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;
sub _vms_ext {
- my($self, $potential_libs,$verbose,$give_libs) = @_;
+ my($self, $potential_libs, $verbose, $give_libs) = @_;
$verbose ||= 0;
my(@crtls,$crtlstr);
# 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'}; }
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
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;
# 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 = '';
@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
}
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";
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;
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
{
# Convenient alias.
package MM;
- use vars qw(@ISA);
- @ISA = qw(ExtUtils::MM);
+ our @ISA = qw(ExtUtils::MM);
sub DESTROY {}
}
$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;
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;
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);
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);
# 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 {
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
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
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
use strict;
-use vars qw($VERSION);
-$VERSION = 6.42;
+our $VERSION = 6.43_01;
sub new {
die <<'UNSUPPORTED';
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 );
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
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: $!, \$?=$?";
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
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
package ExtUtils::MM_Unix;
-require 5.005_03; # Maybe further back, dunno
+require 5.006;
use strict;
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;
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;
}
echo perltype=\$perltype
echo optdebug=\$optdebug
`;
- my($line);
- foreach $line (@o){
+ foreach my $line (@o){
chomp $line;
if ($line =~ /(.*?)=\s*(.*)\s*$/){
$cflags{$1} = $2;
# --- 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);
}
# 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;
}
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
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).
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
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
sub find_perl {
my($self, $ver, $names, $dirs, $trace) = @_;
- my($name, $dir);
+
if ($trace >= 2){
print "Looking for perl $ver by these names:
@$names
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 {
}
}
- 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
# ( 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) {
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;
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;
$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"
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;
unlink $file_bak;
}
continue {
- close(FIXIN) if fileno(FIXIN);
system("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
}
}
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.";
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);
$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 ;
}
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;
# 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}"];
}
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;
$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};
}
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
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;
# 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:
$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
$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]){
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.
# 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
$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};
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) {
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;
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;
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 );
}
}
push @$extra, $_;
}
- map(s/^(.*)/"-I$1"/, @{$perlinc || []});
+ grep(s/^(.*)/"-I$1"/, @{$perlinc || []});
$target ||= "perl";
$tmp ||= ".";
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};
}
}
$(NOECHO) $(TOUCH) $@
';
- my $catfile;
- foreach $catfile (@$extra){
+ foreach my $catfile (@$extra){
push @m, "\tcat $catfile >> \$\@\n";
}
' 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;
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};
$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;
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;
$result = $2;
last;
}
- close FH;
+ close $fh;
+
return $result;
}
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;
\$$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;
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)
)
{
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)\"";
}
: [$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));
}
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";
}
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/)
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
sub guess_name {
my($self) = @_;
- my($defname,$defpm,@pm,%xs,$pm);
+ my($defname,$defpm,@pm,%xs);
local *PM;
$defname = basename(fileify($ENV{'DEFAULT'}));
# 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;
}
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",
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;
}
# 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/) {
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
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;
}
? 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);
$(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
}
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);
=cut
-use vars qw(%olbs);
+our %olbs; # needs to be localized
sub makeaperl {
my($self, %attribs) = @_;
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;
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 );
}
}
# 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
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;
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]/) {
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
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
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;
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 {}
-# $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
}
-sub prompt ($;$) {
+sub prompt ($;$) { ## no critic
my($mess, $def) = @_;
Carp::confess("prompt function called without an argument")
unless defined $mess;
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.
}
# 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
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 :
test :
EOP
- close MF or die "close $new for write: $!";
+ close $mfh or die "close $new for write: $!";
}
sub check_manifest {
}
sub _run_hintfile {
- no strict 'vars';
+ our $self;
local($self) = shift; # make $self available to the hint file.
my($hint_file) = shift;
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
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
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;
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".
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);
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;
}
package ExtUtils::MakeMaker::FAQ;
-use vars qw($VERSION);
-$VERSION = '1.12';
+our $VERSION = '1.12';
1;
__END__
package ExtUtils::MakeMaker::Tutorial;
-use vars qw($VERSION);
-$VERSION = 0.02;
+our $VERSION = 0.02;
=head1 NAME
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;
use strict;
-use vars qw($VERSION);
-$VERSION = 6.42;
+our $VERSION = 6.43_01;
my $IsVMS = $^O eq 'VMS';
# 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 {
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;
}
}
package ExtUtils::Mksymlists;
-use 5.00503;
+use 5.006;
use strict qw[ subs refs ];
# no strict 'vars'; # until filehandles are exempted
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) = @_;
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;
}
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");
+ }
}
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;
}
$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 {
}
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
# 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;
}
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
# 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;
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;
# 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');
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";
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" ) ||
package ExtUtils::testlib;
use strict;
+use warnings;
-use vars qw($VERSION);
-$VERSION = 6.42;
+our $VERSION = 6.43_01;
use Cwd;
use File::Spec;
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__