summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-11-07 22:27:42 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-11-07 22:27:42 +0000
commit2eff091ea70fb05ddcdba02ef815edeb6315652a (patch)
tree3a12e801055f1c2503e6ee82ca13ae9e768b47e0
parentde83437f3b4cf4b0079d4d014d49aa786337f178 (diff)
downloadperl-2eff091ea70fb05ddcdba02ef815edeb6315652a.tar.gz
Upgrade to MakeMaker 6.20.
Get the SDBM_File/sdbm Makefile.PL from blead, as it now breaks. p4raw-id: //depot/maint-5.6/perl-5.6.2@21679
-rw-r--r--MANIFEST5
-rw-r--r--ext/SDBM_File/sdbm/Makefile.PL41
-rw-r--r--lib/ExtUtils/Changes52
-rw-r--r--lib/ExtUtils/Command.pm89
-rw-r--r--lib/ExtUtils/Command/MM.pm2
-rw-r--r--lib/ExtUtils/Install.pm8
-rw-r--r--lib/ExtUtils/Liblist/Kid.pm1
-rw-r--r--lib/ExtUtils/MANIFEST.SKIP1
-rw-r--r--lib/ExtUtils/META.yml4
-rw-r--r--lib/ExtUtils/MM.pm2
-rw-r--r--lib/ExtUtils/MM_Any.pm101
-rw-r--r--lib/ExtUtils/MM_Cygwin.pm4
-rw-r--r--lib/ExtUtils/MM_NW5.pm11
-rw-r--r--lib/ExtUtils/MM_Unix.pm192
-rw-r--r--lib/ExtUtils/MM_VMS.pm25
-rw-r--r--lib/ExtUtils/MM_Win32.pm8
-rw-r--r--lib/ExtUtils/MM_Win95.pm6
-rw-r--r--lib/ExtUtils/MakeMaker.pm56
-rw-r--r--lib/ExtUtils/Manifest.pm66
-rw-r--r--lib/ExtUtils/README9
-rw-r--r--lib/ExtUtils/TODO4
-rwxr-xr-xlib/ExtUtils/instmodsh17
-rw-r--r--lib/ExtUtils/t/Command.t39
-rw-r--r--lib/ExtUtils/t/INST.t9
-rw-r--r--lib/ExtUtils/t/INST_PREFIX.t135
-rw-r--r--lib/ExtUtils/t/Install.t10
-rw-r--r--lib/ExtUtils/t/MM_Cygwin.t2
-rw-r--r--lib/ExtUtils/t/MM_Unix.t38
-rw-r--r--lib/ExtUtils/t/Manifest.t45
-rw-r--r--lib/ExtUtils/t/basic.t18
-rw-r--r--lib/ExtUtils/t/parse_version.t34
-rw-r--r--lib/ExtUtils/t/postamble.t10
-rw-r--r--lib/ExtUtils/t/prefixify.t7
-rw-r--r--lib/ExtUtils/t/prereq_print.t9
-rw-r--r--lib/ExtUtils/t/problems.t9
-rw-r--r--lib/ExtUtils/t/writemakefile_args.t9
-rw-r--r--lib/ExtUtils/t/zz_cleanup_dummy.t23
-rw-r--r--t/lib/MakeMaker/Test/Setup/BFD.pm (renamed from lib/ExtUtils/t/00setup_dummy.t)97
-rw-r--r--t/lib/MakeMaker/Test/Setup/Problem.pm56
-rw-r--r--t/lib/MakeMaker/Test/Setup/Recurs.pm3
40 files changed, 823 insertions, 434 deletions
diff --git a/MANIFEST b/MANIFEST
index 1d37fc61ee..a85b4afa60 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -626,7 +626,6 @@ lib/ExtUtils/Packlist.pm Manipulates .packlist files
lib/ExtUtils/PATCHING Suggestions for patching MakeMaker
lib/ExtUtils/README MakeMaker README
lib/ExtUtils/t/00compile.t See if MakeMaker modules compile
-lib/ExtUtils/t/00setup_dummy.t Setup MakeMaker test module
lib/ExtUtils/t/backwards.t Check MakeMaker's backwards compatibility
lib/ExtUtils/t/basic.t See if MakeMaker can build a module
lib/ExtUtils/t/bytes.t Test ExtUtils::MakeMaker::bytes
@@ -651,6 +650,7 @@ lib/ExtUtils/t/MM_Win32.t See if ExtUtils::MM_Win32 works
lib/ExtUtils/TODO Things TODO in MakeMaker
lib/ExtUtils/t/oneliner.t See if MM can generate perl one-liners
lib/ExtUtils/t/Packlist.t See if Packlist works
+lib/ExtUtils/t/parse_version.t See if versions are parsed properly
lib/ExtUtils/t/postamble.t See if postamble works
lib/ExtUtils/t/prefixify.t See if MakeMaker can apply a PREFIX
lib/ExtUtils/t/prereq_print.t See if PREREQ_PRINT works
@@ -663,7 +663,6 @@ lib/ExtUtils/t/VERSION_FROM.t See if MakeMaker's VERSION_FROM works
lib/ExtUtils/t/vmsish.t Test ExtUtils::MakeMaker::vmsish
lib/ExtUtils/t/writemakefile_args.t See if WriteMakefile works
lib/ExtUtils/typemap Extension interface types
-lib/ExtUtils/t/zz_cleanup_dummy.t Cleanup MakeMaker test module
lib/ExtUtils/xsubpp External subroutine preprocessor
lib/fastcwd.pl a faster but more dangerous getcwd
lib/Fatal.pm Make errors in functions/builtins fatal
@@ -1519,6 +1518,8 @@ t/lib/io_udp.t See if UDP socket-related methods from IO work
t/lib/io_unix.t See if UNIX socket-related methods from IO work
t/lib/io_xs.t See if XSUB methods from IO work
t/lib/ipc_sysv.t See if IPC::SysV works
+t/lib/MakeMaker/Test/Setup/BFD.pm MakeMaker test utilities
+t/lib/MakeMaker/Test/Setup/Problem.pm MakeMaker test utilities
t/lib/MakeMaker/Test/Setup/Recurs.pm MakeMaker test utilities
t/lib/MakeMaker/Test/Utils.pm MakeMaker test utilities
t/lib/ndbm.t See if NDBM_File works
diff --git a/ext/SDBM_File/sdbm/Makefile.PL b/ext/SDBM_File/sdbm/Makefile.PL
index 4453dea1fd..91d8172841 100644
--- a/ext/SDBM_File/sdbm/Makefile.PL
+++ b/ext/SDBM_File/sdbm/Makefile.PL
@@ -1,6 +1,6 @@
use ExtUtils::MakeMaker;
-$define = '-DSDBM -DDUFF';
+my $define = '-DSDBM -DDUFF';
$define .= ' -DWIN32 -DPERL_STATIC_SYMS' if ($^O eq 'MSWin32');
if ($^O eq 'VMS') { # Old VAXC compiler can't handle Duff's device
@@ -13,7 +13,6 @@ WriteMakefile(
# LINKTYPE => 'static',
DEFINE => $define,
INC => '-I$(PERL_INC)', # force PERL_INC dir ahead of system -I's
- INST_ARCHLIB => '.',
SKIP => [qw(dynamic dynamic_lib dlsyms)],
OBJECT => '$(O_FILES)',
clean => {'FILES' => 'dbu libsdbm.a dbd dba dbe x-dbu *.dir *.pag'},
@@ -21,35 +20,21 @@ WriteMakefile(
C => [qw(sdbm.c pair.c hash.c)]
);
-sub MY::constants {
- package MY;
- my $r = shift->SUPER::constants();
- if ($^O eq 'VMS') {
- $r =~ s/^INST_STATIC =.*$/INST_STATIC = libsdbm\$(LIB_EXT)/m
- }
- return $r;
-}
-sub MY::post_constants {
- package MY;
- if ($^O eq 'VMS') {
- shift->SUPER::post_constants();
- } else {
-'
-INST_STATIC = libsdbm$(LIB_EXT)
-'
- }
+package MY;
+sub constants {
+ my $self = shift;
+
+ $self->{INST_STATIC} = 'libsdbm$(LIB_EXT)';
+
+ return $self->SUPER::constants();
}
-sub MY::top_targets {
- my $noecho = shift->{NOECHO};
-
+sub top_targets {
+ my $self = shift;
my $r = '
all :: static
- ' . $noecho . '$(NOOP)
-
-config ::
- ' . $noecho . '$(NOOP)
+ $(NOECHO) $(NOOP)
lint:
lint -abchx $(LIBSRCS)
@@ -60,8 +45,8 @@ lint:
# variables into the environment so $(MYEXTLIB) is set in here to this
# value which can not be built.
sdbm/libsdbm.a:
- ' . $noecho . '$(NOOP)
+ $(NOECHO) $(NOOP)
' unless $^O eq 'VMS';
- return $r;
+ return $r . $self->SUPER::top_targets;
}
diff --git a/lib/ExtUtils/Changes b/lib/ExtUtils/Changes
index 3cbeddb84b..0342d044f5 100644
--- a/lib/ExtUtils/Changes
+++ b/lib/ExtUtils/Changes
@@ -1,3 +1,55 @@
+6.20 Thu Nov 6 02:25:58 PST 2003
+ - Fixing dos2unix on Cygwin. In-place editing doesn't work 100% so we
+ take a more conservative approach.
+ - Small postamble.t test temp file cleanup fix for Cygwin and Windows.
+ - Small Command.t test fix for 5.5.3. No real bug [rt 4290]
+ - Small Liblist fix for Cygwin and import libraries [Gerrit P. Haase]
+ - metafile error message slightly mangled. Bare $! mistake confusing
+ nmake [rt 4285 4301]
+
+6.19 Mon Nov 3 22:53:56 PST 2003
+ - Removed 00setup_dummy.t and zz_cleanup_dummy.t. Tests now setup and
+ teardown the dummy modules as needed.
+ - Little test glitch on systems without $Config{usevendorprefix} set
+ - INSTALL(SITE|VENDOR)MAN*DIR now fall back to $(INSTALLMAN*DIR)
+ instead of copying its value. This lets "perl Makefile.PL
+ INSTALLMAN1DIR=/some/man/man1" work like expected.
+
+6.18 Mon Nov 3 20:09:51 PST 2003
+ - parse_version() was blowing over $_ (Ilya Zakharevich)
+ - 5.6.2 has the same Cygwin shared lib name fix as 5.7.0. (Gerrit Haase)
+ * When $Config{install(site|vendor)man*dir} aren't set it will now
+ fall back to $Config{installman*dir}. Similar for
+ $Config{install(site|vendor)bin}. This preserves behavior for older
+ Perls.
+ * Eliminated the dependency on perl.h for pure-perl builds.
+ * Eliminated .exists files. Added blibdirs target using MKPATH instead.
+ - Removed now unused dir_target() method.
+ - Added a little documentation to instmodsh.
+ * Made sure PREFIX always has something in it. Module authors like to use
+ it when extending MakeMaker. Currently using one of
+ PERL/SITE/VENDORPREFIX based on the value of INSTALLDIRS.
+ * Added SIGN to generate module signatures with cpansign (Autrijus Tang)
+ - Slight tweaks to MAKEFILE_OLD and MAKE_APERL_FILE restoring a mistake
+ made around 6.06 to fix static builds on OS/2
+ - Added ExtUtils::Command::dos2unix()
+ * manicopy() would make the copied files read-only if 'cp' was used.
+ * Fixed prereq check for modules which are also keywords like if.pm and
+ open.pm (Autrijus Tang)
+ - Made ExtUtils::Command mv and cp return whether or not they succeeded.
+ * metafile_addtomanifest now mentions what its doing.
+ * metafile will not die if it can't write to META.yml, just emit a
+ warning. This lets 'make dist' continue with a read-only META.yml
+ - Small fix to identify UWIN on NT (Randy Sims)
+ * metafile will not touch the META.yml if it does not need to be changed
+ (Thanks to Tim Bunce for this idea)
+ * Fixed 'make uninstall' which looks like its been broken since last
+ November and nobody noticed.
+ - Fixing minor bug in VMS prefixification logic when PREFIX was not set
+ by the user.
+ - Fixing potential bug in prefixification for relative directories
+ * Documented UNINST=1
+
6.17 Sun Sep 14 20:52:45 PDT 2003
- Fixing LD so it can be set properly on Win32. (Orton Yves)
* Fixing the init_PERL() "tack $Config{exe_ext} onto $^X" logic so
diff --git a/lib/ExtUtils/Command.pm b/lib/ExtUtils/Command.pm
index 12e2b99ea5..f83c774006 100644
--- a/lib/ExtUtils/Command.pm
+++ b/lib/ExtUtils/Command.pm
@@ -8,10 +8,11 @@ use File::Compare;
use File::Basename;
use File::Path qw(rmtree);
require Exporter;
-use vars qw(@ISA @EXPORT $VERSION);
-@ISA = qw(Exporter);
-@EXPORT = qw(cp rm_f rm_rf mv cat eqtime mkpath touch test_f);
-$VERSION = '1.05';
+use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
+@ISA = qw(Exporter);
+@EXPORT = qw(cp rm_f rm_rf mv cat eqtime mkpath touch test_f chmod
+ dos2unix);
+$VERSION = '1.07';
my $Is_VMS = $^O eq 'VMS';
@@ -30,7 +31,8 @@ ExtUtils::Command - utilities to replace common UNIX commands in Makefiles etc.
perl -MExtUtils::Command -e mkpath directories...
perl -MExtUtils::Command -e eqtime source destination
perl -MExtUtils::Command -e test_f file
- perl -MExtUtils::Command=chmod -e chmod mode files...
+ perl -MExtUtils::Command -e chmod mode files...
+ ...
=head1 DESCRIPTION
@@ -132,34 +134,48 @@ sub touch {
=item mv source... destination
-Moves source to destination.
-Multiple sources are allowed if destination is an existing directory.
+Moves source to destination. Multiple sources are allowed if
+destination is an existing directory.
+
+Returns true if all moves succeeded, false otherwise.
=cut
sub mv {
- my $dst = pop(@ARGV);
expand_wildcards();
- croak("Too many arguments") if (@ARGV > 1 && ! -d $dst);
- foreach my $src (@ARGV) {
- move($src,$dst);
+ my @src = @ARGV;
+ my $dst = pop @src;
+
+ croak("Too many arguments") if (@src > 1 && ! -d $dst);
+
+ my $nok = 0;
+ foreach my $src (@src) {
+ $nok ||= !move($src,$dst);
}
+ return !$nok;
}
=item cp source... destination
-Copies source to destination.
-Multiple sources are allowed if destination is an existing directory.
+Copies source to destination. Multiple sources are allowed if
+destination is an existing directory.
+
+Returns true if all copies succeeded, false otherwise.
=cut
sub cp {
- my $dst = pop(@ARGV);
expand_wildcards();
- croak("Too many arguments") if (@ARGV > 1 && ! -d $dst);
- foreach my $src (@ARGV) {
- copy($src,$dst);
+ my @src = @ARGV;
+ my $dst = pop @src;
+
+ croak("Too many arguments") if (@src > 1 && ! -d $dst);
+
+ my $nok = 0;
+ foreach my $src (@src) {
+ $nok ||= !copy($src,$dst);
}
+ return $nok;
}
=item chmod mode files...
@@ -169,6 +185,7 @@ Sets UNIX like permissions 'mode' on all the files. e.g. 0666
=cut
sub chmod {
+ local @ARGV = @ARGV;
my $mode = shift(@ARGV);
expand_wildcards();
chmod(oct $mode,@ARGV) || die "Cannot chmod ".join(' ',$mode,@ARGV).":$!";
@@ -194,12 +211,40 @@ Tests if a file exists
sub test_f
{
- exit !-f shift(@ARGV);
+ exit !-f $ARGV[0];
}
+=item dos2unix
-1;
-__END__
+Converts DOS and OS/2 linefeeds to Unix style recursively.
+
+=cut
+
+sub dos2unix {
+ require File::Find;
+ File::Find::find(sub {
+ return if -d;
+ return unless -w _;
+ return unless -r _;
+ return if -B _;
+
+ local $\;
+
+ my $orig = $_;
+ my $temp = '.dos2unix_tmp';
+ open ORIG, $_ or do { warn "dos2unix can't open $_: $!"; return };
+ open TEMP, ">$temp" or
+ do { warn "dos2unix can't create .dos2unix_tmp: $!"; return };
+ while (my $line = <ORIG>) {
+ $line =~ s/\015\012/\012/g;
+ print TEMP $line;
+ }
+ close ORIG;
+ close TEMP;
+ rename $temp, $orig;
+
+ }, @ARGV);
+}
=back
@@ -213,7 +258,9 @@ ExtUtils::MakeMaker, ExtUtils::MM_Unix, ExtUtils::MM_Win32
=head1 AUTHOR
-Nick Ing-Simmons <F<nick@ni-s.u-net.com>>.
+Nick Ing-Simmons C<ni-s@cpan.org>
+
+Currently maintained by Michael G Schwern C<schwern@pobox.com>.
=cut
diff --git a/lib/ExtUtils/Command/MM.pm b/lib/ExtUtils/Command/MM.pm
index a597cc48a9..dc374a3581 100644
--- a/lib/ExtUtils/Command/MM.pm
+++ b/lib/ExtUtils/Command/MM.pm
@@ -228,7 +228,7 @@ uninstallation.
=cut
sub uninstall {
- my($packlist) = shift;
+ my($packlist) = shift @ARGV;
require ExtUtils::Install;
diff --git a/lib/ExtUtils/Install.pm b/lib/ExtUtils/Install.pm
index 18510ade4b..212b7c476a 100644
--- a/lib/ExtUtils/Install.pm
+++ b/lib/ExtUtils/Install.pm
@@ -533,14 +533,14 @@ Will be prepended to each install path.
Original author lost in the mists of time. Probably the same as Makemaker.
-Currently maintained by Michael G Schwern <F<schwern@pobox.com>>
+Currently maintained by Michael G Schwern C<schwern@pobox.com>
-Send patches and ideas to <F<makemaker@perl.org>>.
+Send patches and ideas to C<makemaker@perl.org>.
Send bug reports via http://rt.cpan.org/. Please send your
generated Makefile along with your report.
-For more up-to-date information, see http://www.makemaker.org.
+For more up-to-date information, see L<http://www.makemaker.org>.
=head1 LICENSE
@@ -548,7 +548,7 @@ For more up-to-date information, see http://www.makemaker.org.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
-See F<http://www.perl.com/perl/misc/Artistic.html>
+See L<http://www.perl.com/perl/misc/Artistic.html>
=cut
diff --git a/lib/ExtUtils/Liblist/Kid.pm b/lib/ExtUtils/Liblist/Kid.pm
index 6544509250..e3c7a1fcf3 100644
--- a/lib/ExtUtils/Liblist/Kid.pm
+++ b/lib/ExtUtils/Liblist/Kid.pm
@@ -132,6 +132,7 @@ sub _unix_os2_ext {
&& ($thislib .= "_s") ){ # we must explicitly use _s version
} elsif (-f ($fullname="$thispth/lib$thislib$Config_libext")){
} elsif (-f ($fullname="$thispth/$thislib$Config_libext")){
+ } elsif (-f ($fullname="$thispth/lib$thislib.dll$Config_libext")){
} elsif (-f ($fullname="$thispth/Slib$thislib$Config_libext")){
} elsif ($^O eq 'dgux'
&& -l ($fullname="$thispth/lib$thislib$Config_libext")
diff --git a/lib/ExtUtils/MANIFEST.SKIP b/lib/ExtUtils/MANIFEST.SKIP
index 41f89ae707..854b78ce12 100644
--- a/lib/ExtUtils/MANIFEST.SKIP
+++ b/lib/ExtUtils/MANIFEST.SKIP
@@ -10,6 +10,7 @@
\bblib/
\bMakeMaker-\d
\bpm_to_blib$
+\bblibdirs$
# Avoid Module::Build generated and utility files.
\bBuild$
diff --git a/lib/ExtUtils/META.yml b/lib/ExtUtils/META.yml
index c8515482da..60a0ef4057 100644
--- a/lib/ExtUtils/META.yml
+++ b/lib/ExtUtils/META.yml
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: ExtUtils-MakeMaker
-version: 6.17
+version: 6.20
version_from: lib/ExtUtils/MakeMaker.pm
installdirs: perl
requires:
@@ -11,4 +11,4 @@ requires:
Pod::Man: 0
distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+generated_by: ExtUtils::MakeMaker version 6.20
diff --git a/lib/ExtUtils/MM.pm b/lib/ExtUtils/MM.pm
index 2c23263c9c..d1b818fffc 100644
--- a/lib/ExtUtils/MM.pm
+++ b/lib/ExtUtils/MM.pm
@@ -50,7 +50,7 @@ $Is{MacOS} = 1 if $^O eq 'MacOS';
if( $^O eq 'MSWin32' ) {
Win32::IsWin95() ? $Is{Win95} = 1 : $Is{Win32} = 1;
}
-$Is{UWIN} = 1 if $^O eq 'uwin';
+$Is{UWIN} = 1 if $^O =~ /^uwin(-nt)?$/;
$Is{Cygwin} = 1 if $^O eq 'cygwin';
$Is{NW5} = 1 if $Config{osname} eq 'NetWare'; # intentional
$Is{BeOS} = 1 if $^O =~ /beos/i; # XXX should this be that loose?
diff --git a/lib/ExtUtils/MM_Any.pm b/lib/ExtUtils/MM_Any.pm
index 5d8d640b68..f03985b8bc 100644
--- a/lib/ExtUtils/MM_Any.pm
+++ b/lib/ExtUtils/MM_Any.pm
@@ -2,7 +2,7 @@ package ExtUtils::MM_Any;
use strict;
use vars qw($VERSION @ISA);
-$VERSION = 0.07;
+$VERSION = 0.09;
@ISA = qw(File::Spec);
use Config;
@@ -87,6 +87,34 @@ sub os_flavor_is {
return (grep { $flavors{$_} } @_) ? 1 : 0;
}
+=item blibdirs_target (o)
+
+ my $make_frag = $mm->blibdirs_target;
+
+Creates the blibdirs target which creates all the directories we use in
+blib/.
+
+=cut
+
+sub blibdirs_target {
+ my $self = shift;
+
+ my @dirs = map { uc "\$(INST_$_)" } qw(libdir
+ autodir archautodir
+ bin script
+ man1dir man3dir
+ );
+ my @mkpath = $self->split_command('$(NOECHO) $(MKPATH)', @dirs);
+ my @chmod = $self->split_command('$(NOECHO) $(CHMOD) 755', @dirs);
+
+ my $make = "\nblibdirs : \n";
+ $make .= join "", map { "\t$_\n" } @mkpath, @chmod;
+ $make .= "\t\$(NOECHO) \$(TOUCH) blibdirs\n\n";
+
+ return $make;
+}
+
+
=back
=head2 File::Spec wrappers
@@ -178,7 +206,7 @@ sub split_command {
}
chop $arg_str;
- push @cmds, $self->escape_newlines("$cmd\n$arg_str");
+ push @cmds, $self->escape_newlines("$cmd \n$arg_str");
} while @args;
return @cmds;
@@ -584,7 +612,7 @@ MAKE_FRAG
my $ver = $self->{PREREQ_PM}{$mod};
$prereq_pm .= sprintf " %-30s %s\n", "$mod:", $ver;
}
-
+
my $meta = <<YAML;
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
@@ -598,10 +626,42 @@ distribution_type: module
generated_by: ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION
YAML
- my @write_meta = $self->echo($meta, 'META.yml');
- return sprintf <<'MAKE_FRAG', join "\n\t", @write_meta;
+ my @write_meta = $self->echo($meta, 'META_new.yml');
+ my $move = $self->oneliner(<<'CODE', ['-MExtUtils::Command', '-MFile::Compare']);
+compare(@ARGV) != 0 ? (mv or warn "Cannot move @ARGV: $$!\n") : unlink(shift);
+CODE
+
+ return sprintf <<'MAKE_FRAG', join("\n\t", @write_meta), $move;
metafile :
+ $(NOECHO) $(ECHO) Generating META.yml
%s
+ -$(NOECHO) %s META_new.yml META.yml
+MAKE_FRAG
+
+}
+
+
+=item signature_target
+
+ my $target = $mm->signature_target;
+
+Generate the signature target.
+
+Writes the file SIGNATURE with "cpansign -s".
+
+=cut
+
+sub signature_target {
+ my $self = shift;
+
+ return <<'MAKE_FRAG' if !$self->{SIGN};
+signature :
+ $(NOECHO) $(NOOP)
+MAKE_FRAG
+
+ return <<'MAKE_FRAG';
+signature : signature_addtomanifest
+ cpansign -s
MAKE_FRAG
}
@@ -630,6 +690,37 @@ CODE
return sprintf <<'MAKE_FRAG', $add_meta;
metafile_addtomanifest:
+ $(NOECHO) $(ECHO) Adding META.yml to MANIFEST
+ $(NOECHO) %s
+MAKE_FRAG
+
+}
+
+
+=item signature_addtomanifest_target
+
+ my $target = $mm->signature_addtomanifest_target
+
+Adds the META.yml file to the MANIFEST.
+
+=cut
+
+sub signature_addtomanifest_target {
+ my $self = shift;
+
+ return <<'MAKE_FRAG' if !$self->{SIGN};
+signature_addtomanifest :
+ $(NOECHO) $(NOOP)
+MAKE_FRAG
+
+ my $add_sign = $self->oneliner(<<'CODE', ['-MExtUtils::Manifest=maniadd']);
+eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) }
+ or print "Could not add SIGNATURE to MANIFEST: $${'@'}\n"
+CODE
+
+ return sprintf <<'MAKE_FRAG', $add_sign;
+signature_addtomanifest :
+ $(NOECHO) $(ECHO) Adding SIGNATURE to MANIFEST
$(NOECHO) %s
MAKE_FRAG
diff --git a/lib/ExtUtils/MM_Cygwin.pm b/lib/ExtUtils/MM_Cygwin.pm
index 4529895fa0..0d5fb2af8a 100644
--- a/lib/ExtUtils/MM_Cygwin.pm
+++ b/lib/ExtUtils/MM_Cygwin.pm
@@ -10,7 +10,7 @@ require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = 1.06;
+$VERSION = 1.07;
=head1 NAME
@@ -86,7 +86,7 @@ sub init_linker {
if ($Config{useshrplib} eq 'true') {
my $libperl = '$(PERL_INC)' .'/'. "$Config{libperl}";
- if( $] >= 5.007 ) {
+ if( $] >= 5.006002 ) {
$libperl =~ s/a$/dll.a/;
}
$self->{PERL_ARCHIVE} = $libperl;
diff --git a/lib/ExtUtils/MM_NW5.pm b/lib/ExtUtils/MM_NW5.pm
index 82c2d66dbc..4e626cc23e 100644
--- a/lib/ExtUtils/MM_NW5.pm
+++ b/lib/ExtUtils/MM_NW5.pm
@@ -23,7 +23,7 @@ use Config;
use File::Basename;
use vars qw(@ISA $VERSION);
-$VERSION = '2.06';
+$VERSION = '2.07';
require ExtUtils::MM_Win32;
@ISA = qw(ExtUtils::MM_Win32);
@@ -152,7 +152,7 @@ sub static_lib {
return '' unless $self->has_link_code;
my $m = <<'END';
-$(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
+$(INST_STATIC): $(OBJECT) $(MYEXTLIB) blibdirs
$(RM_RF) $@
END
@@ -181,10 +181,9 @@ END
$m .= <<'END' if $self->{PERL_SRC};
$(NOECHO) $(ECHO) "$(EXTRALIBS)" >> $(PERL_SRC)\ext.libs
-
-
+
+
END
- $m .= $self->dir_target('$(INST_ARCHAUTODIR)');
return $m;
}
@@ -258,8 +257,6 @@ MAKE_FRAG
$(CHMOD) 755 $@
MAKE_FRAG
- $m .= $self->dir_target('$(INST_ARCHAUTODIR)');
-
return $m;
}
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index 3821a3571d..24348aca85 100644
--- a/lib/ExtUtils/MM_Unix.pm
+++ b/lib/ExtUtils/MM_Unix.pm
@@ -7,7 +7,7 @@ use strict;
use Exporter ();
use Carp;
use Config qw(%Config);
-use File::Basename qw(basename dirname fileparse);
+use File::Basename qw(basename dirname);
use DirHandle;
use vars qw($VERSION @ISA
@@ -20,7 +20,7 @@ use vars qw($VERSION @ISA
use ExtUtils::MakeMaker qw($Verbose neatvalue);
-$VERSION = '1.42';
+$VERSION = '1.44';
require ExtUtils::MM_Any;
@ISA = qw(ExtUtils::MM_Any);
@@ -295,7 +295,8 @@ clean :: clean_subdirs
push(@otherfiles, qw[./blib $(MAKE_APERL_FILE)
$(INST_ARCHAUTODIR)/extralibs.all
$(INST_ARCHAUTODIR)/extralibs.ld
- perlmain.c tmon.out mon.out so_locations pm_to_blib
+ perlmain.c tmon.out mon.out so_locations
+ blibdirs pm_to_blib
*$(OBJ_EXT) *$(LIB_EXT) perl.exe perl perl$(EXE_EXT)
$(BOOTSTRAP) $(BASEEXT).bso
$(BASEEXT).def lib$(BASEEXT).def
@@ -558,50 +559,6 @@ sub depend {
join "", @m;
}
-=item dir_target (o)
-
-Takes an array of directories that need to exist and returns a
-Makefile entry for a .exists file in these directories. Returns
-nothing, if the entry has already been processed. We're helpless
-though, if the same directory comes as $(FOO) _and_ as "bar". Both of
-them get an entry, that's why we use "::".
-
-=cut
-
-sub dir_target {
-# --- Make-Directories section (internal method) ---
-# dir_target(@array) returns a Makefile entry for the file .exists in each
-# named directory. Returns nothing, if the entry has already been processed.
-# We're helpless though, if the same directory comes as $(FOO) _and_ as "bar".
-# Both of them get an entry, that's why we use "::". I chose '$(PERL)' as the
-# prerequisite, because there has to be one, something that doesn't change
-# too often :)
-
- my($self,@dirs) = @_;
- my(@m,$dir,$targdir);
- foreach $dir (@dirs) {
- my($src) = $self->catfile($self->{PERL_INC},'perl.h');
- my($targ) = $self->catfile($dir,'.exists');
- # catfile may have adapted syntax of $dir to target OS, so...
- if ($Is_VMS) { # Just remove file name; dirspec is often in macro
- ($targdir = $targ) =~ s:/?\.exists\z::;
- }
- else { # while elsewhere we expect to see the dir separator in $targ
- $targdir = dirname($targ);
- }
- next if $self->{DIR_TARGET}{$self}{$targdir}++;
- push @m, qq{
-$targ :: $src
- \$(NOECHO) \$(MKPATH) $targdir
- \$(NOECHO) \$(EQUALIZE_TIMESTAMP) $src $targ
-};
- push(@m, qq{
- -\$(NOECHO) \$(CHMOD) \$(PERM_RWX) $targdir
-}) unless $Is_VMS;
- }
- join "", @m;
-}
-
=item init_DEST
$mm->init_DEST
@@ -953,7 +910,7 @@ sub distdir {
my($self) = shift;
return <<'MAKE_FRAG';
-distdir : metafile metafile_addtomanifest
+distdir : metafile metafile_addtomanifest signature
$(RM_RF) $(DISTVNAME)
$(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \
-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
@@ -1054,7 +1011,7 @@ BOOTSTRAP = $(BASEEXT).bs
# As Mkbootstrap might not write a file (if none is required)
# we use touch to prevent make continually trying to remake it.
# The DynaLoader only reads a non-empty file.
-$(BOOTSTRAP): $(FIRST_MAKEFILE) $(BOOTDEP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
+$(BOOTSTRAP): $(FIRST_MAKEFILE) $(BOOTDEP) blibdirs
$(NOECHO) $(ECHO) "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
$(NOECHO) $(PERLRUN) \
"-MExtUtils::Mkbootstrap" \
@@ -1062,7 +1019,7 @@ $(BOOTSTRAP): $(FIRST_MAKEFILE) $(BOOTDEP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exis
$(NOECHO) $(TOUCH) $(BOOTSTRAP)
$(CHMOD) $(PERM_RW) $@
-$(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
+$(INST_BOOT): $(BOOTSTRAP) blibdirs
$(NOECHO) $(RM_RF) $(INST_BOOT)
-$(CP) $(BOOTSTRAP) $(INST_BOOT)
$(CHMOD) $(PERM_RW) $@
@@ -1097,7 +1054,7 @@ OTHERLDFLAGS = '.$ld_opt.$otherldflags.'
INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
INST_DYNAMIC_FIX = '.$ld_fix.'
-$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
+$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) blibdirs $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
');
if ($armaybe ne ':'){
$ldfrom = 'tmp$(LIB_EXT)';
@@ -1120,18 +1077,16 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILE
my $libs = '$(LDLOADLIBS)';
- if ($Is_NetBSD) {
+ if ($Is_NetBSD && $Config{'useshrplib'}) {
# 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
# or -R to add paths to the run-time library search path.
- if ($Config{'useshrplib'}) {
- if ($Config{'lddlflags'} =~ /-Wl,-R/) {
- $libs .= ' -L$(PERL_INC) -Wl,-R$(INSTALLARCHLIB)/CORE -lperl';
- } elsif ($Config{'lddlflags'} =~ /-R/) {
- $libs .= ' -L$(PERL_INC) -R$(INSTALLARCHLIB)/CORE -lperl';
- }
- }
+ if ($Config{'lddlflags'} =~ /-Wl,-R/) {
+ $libs .= ' -L$(PERL_INC) -Wl,-R$(INSTALLARCHLIB)/CORE -lperl';
+ } elsif ($Config{'lddlflags'} =~ /-R/) {
+ $libs .= ' -L$(PERL_INC) -R$(INSTALLARCHLIB)/CORE -lperl';
+ }
}
push(@m,
@@ -1141,7 +1096,6 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILE
$(CHMOD) $(PERM_RWX) $@
';
- push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
join('',@m);
}
@@ -1814,25 +1768,7 @@ from the perl source tree.
EOP
}
}
- }
-
- unless(-f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h")))
- {
- die qq{
-Error: Unable to locate installed Perl libraries or Perl source code.
-
-It is recommended that you install perl in a standard location before
-building extensions. Some precompiled versions of perl do not contain
-these header files, so you cannot build extensions. In such a case,
-please build and install your perl from a fresh perl distribution. It
-usually solves this kind of problem.
-
-\(You get this message, because MakeMaker could not find "$perl_h"\)
-};
- }
-# print STDOUT "Using header files found in $self->{PERL_INC}\n"
-# if $Verbose && $self->needs_linking();
-
+ }
}
# We get SITELIBEXP and SITEARCHEXP directly via
@@ -1944,10 +1880,10 @@ sub init_others { # --- Initialize Other Attributes
$self->{NOOP} ||= '$(SHELL) -c true';
$self->{NOECHO} = '@' unless defined $self->{NOECHO};
- $self->{MAKEFILE} ||= 'Makefile';
- $self->{FIRST_MAKEFILE} ||= $self->{MAKEFILE};
- $self->{MAKEFILE_OLD} ||= '$(FIRST_MAKEFILE).old';
- $self->{MAKE_APERL_FILE} ||= '$(FIRST_MAKEFILE).aperl';
+ $self->{FIRST_MAKEFILE} ||= 'Makefile';
+ $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE};
+ $self->{MAKEFILE_OLD} ||= $self->{MAKEFILE}.'.old';
+ $self->{MAKE_APERL_FILE} ||= $self->{MAKEFILE}.'.aperl';
$self->{SHELL} ||= $Config{sh} || '/bin/sh';
@@ -2046,17 +1982,35 @@ sub init_INSTALL {
$self->init_lib2arch;
- # Initialize installvendorman*dir if necessary
+ # There are often no Config.pm defaults for these new man variables so
+ # we fall back to the old behavior which is to use installman*dir
+ foreach my $num (1, 3) {
+ my $k = 'installsiteman'.$num.'dir';
+
+ $self->{uc $k} ||= uc "\$(installman${num}dir)"
+ unless $Config{$k};
+ }
+
foreach my $num (1, 3) {
my $k = 'installvendorman'.$num.'dir';
- unless ($Config{$k}) {
- $Config_Override{$k} = $Config{usevendorprefix} ?
- $self->catdir($Config{vendorprefixexp}, 'man', "man$num") :
- '';
+ unless( $Config{$k} ) {
+ $self->{uc $k} ||= $Config{usevendorprefix}
+ ? uc "\$(installman${num}dir)"
+ : '';
}
}
+ $self->{INSTALLSITEBIN} ||= '$(INSTALLBIN)'
+ unless $Config{installsitebin};
+
+ unless( $Config{installvendorbin} ) {
+ $self->{INSTALLVENDORBIN} ||= $Config{usevendorprefix}
+ ? $Config{installbin}
+ : '';
+ }
+
+
my $iprefix = $Config{installprefixexp} || $Config{installprefix} ||
$Config{prefixexp} || $Config{prefix} || '';
my $vprefix = $Config{usevendorprefix} ? $Config{vendorprefixexp} : '';
@@ -2065,22 +2019,6 @@ sub init_INSTALL {
# 5.005_03 doesn't have a siteprefix.
$sprefix = $iprefix unless $sprefix;
- # There are often no Config.pm defaults for these, but we can make
- # it up.
- unless( $Config{installsiteman1dir} ) {
- $Config_Override{installsiteman1dir} =
- $self->catdir($sprefix, 'man', 'man1');
- }
-
- unless( $Config{installsiteman3dir} ) {
- $Config_Override{installsiteman3dir} =
- $self->catdir($sprefix, 'man', 'man3');
- }
-
- unless( $Config{installsitebin} ) {
- $Config_Override{installsitebin} =
- $self->catdir($sprefix, 'bin');
- }
$self->{PREFIX} ||= '';
@@ -2092,6 +2030,10 @@ sub init_INSTALL {
$self->{PERLPREFIX} ||= $iprefix;
$self->{SITEPREFIX} ||= $sprefix;
$self->{VENDORPREFIX} ||= $vprefix;
+
+ # Lots of MM extension authors like to use $(PREFIX) so we
+ # put something sensible in there no matter what.
+ $self->{PREFIX} = '$('.uc $self->{INSTALLDIRS}.'PREFIX)';
}
my $arch = $Config{archname};
@@ -2598,7 +2540,6 @@ sub installbin {
return "" unless $self->{EXE_FILES} && ref $self->{EXE_FILES} eq "ARRAY";
return "" unless @{$self->{EXE_FILES}};
my(@m, $from, $to, %fromto, @to);
- push @m, $self->dir_target(qw[$(INST_SCRIPT)]);
for $from (@{$self->{EXE_FILES}}) {
my($path)= $self->catfile('$(INST_SCRIPT)', basename($from));
local($_) = $path; # for backwards compatibility
@@ -2633,7 +2574,7 @@ realclean ::
last unless defined $from;
my $todir = dirname($to);
push @m, "
-$to: $from \$(FIRST_MAKEFILE) " . $self->catdir($todir,'.exists') . "
+$to: $from \$(FIRST_MAKEFILE) blibdirs
\$(NOECHO) \$(RM_F) $to
\$(CP) $from $to
\$(FIXIN) $to
@@ -2881,7 +2822,7 @@ LLIBPERL = $llibperl
";
push @m, "
-\$(INST_ARCHAUTODIR)/extralibs.all: \$(INST_ARCHAUTODIR)\$(DIRFILESEP).exists ".join(" \\\n\t", @$extra).'
+\$(INST_ARCHAUTODIR)/extralibs.all: blibdirs ".join(" \\\n\t", @$extra).'
$(NOECHO) $(RM_F) $@
$(NOECHO) $(TOUCH) $@
';
@@ -3076,6 +3017,7 @@ sub parse_version {
my $result;
local *FH;
local $/ = "\n";
+ local $_;
open(FH,$parsefile) or die "Could not open '$parsefile': $!";
my $inpod = 0;
while (<FH>) {
@@ -3429,7 +3371,9 @@ sub prefixify {
print STDERR " prefixify $var => $path\n" if $Verbose >= 2;
print STDERR " from $sprefix to $rprefix\n" if $Verbose >= 2;
- if( $path !~ s{^\Q$sprefix\E\b}{$rprefix}s && $self->{ARGS}{PREFIX} ) {
+ if( $self->{ARGS}{PREFIX} && $self->file_name_is_absolute($path) &&
+ $path !~ s{^\Q$sprefix\E\b}{$rprefix}s )
+ {
print STDERR " cannot prefix, using default.\n" if $Verbose >= 2;
print STDERR " no default!\n" if !$default && $Verbose >= 2;
@@ -3687,7 +3631,7 @@ sub static_lib {
my(@m);
push(@m, <<'END');
-$(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
+$(INST_STATIC): $(OBJECT) $(MYEXTLIB) blibdirs
$(RM_RF) $@
END
@@ -3716,7 +3660,6 @@ MAKE_FRAG
$(NOECHO) $(ECHO) "$(EXTRALIBS)" >> $(PERL_SRC)/ext.libs
MAKE_FRAG
- push @m, "\n", $self->dir_target('$(INST_ARCHAUTODIR)');
join('', @m);
}
@@ -4012,7 +3955,7 @@ sub top_targets {
my(@m);
push @m, $self->all_target, "\n" unless $self->{SKIPHASH}{'all'};
-
+
push @m, '
pure_all :: config pm_to_blib subdirs linkext
$(NOECHO) $(NOOP)
@@ -4020,34 +3963,11 @@ pure_all :: config pm_to_blib subdirs linkext
subdirs :: $(MYEXTLIB)
$(NOECHO) $(NOOP)
-config :: $(FIRST_MAKEFILE) $(INST_LIBDIR)$(DIRFILESEP).exists
- $(NOECHO) $(NOOP)
-
-config :: $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
- $(NOECHO) $(NOOP)
-
-config :: $(INST_AUTODIR)$(DIRFILESEP).exists
+config :: $(FIRST_MAKEFILE) blibdirs
$(NOECHO) $(NOOP)
';
- push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
-
- if (%{$self->{MAN1PODS}}) {
- push @m, q[
-config :: $(INST_MAN1DIR)$(DIRFILESEP).exists
- $(NOECHO) $(NOOP)
-
-];
- push @m, $self->dir_target(qw[$(INST_MAN1DIR)]);
- }
- if (%{$self->{MAN3PODS}}) {
- push @m, q[
-config :: $(INST_MAN3DIR)$(DIRFILESEP).exists
- $(NOECHO) $(NOOP)
-
-];
- push @m, $self->dir_target(qw[$(INST_MAN3DIR)]);
- }
+ push @m, $self->blibdirs_target;
push @m, '
$(O_FILES): $(H_FILES)
diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm
index a21a0d9b3a..2b2f50d97b 100644
--- a/lib/ExtUtils/MM_VMS.pm
+++ b/lib/ExtUtils/MM_VMS.pm
@@ -20,8 +20,8 @@ BEGIN {
use File::Basename;
use vars qw($Revision @ISA $VERSION);
-($VERSION) = '5.70';
-($Revision) = q$Revision: 1.110 $ =~ /Revision:\s+(\S+)/;
+($VERSION) = '5.71';
+($Revision) = q$Revision: 1.113 $ =~ /Revision:\s+(\S+)/;
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
@@ -1006,13 +1006,12 @@ INST_DYNAMIC_DEP = $inst_dynamic_dep
";
push @m, '
-$(INST_DYNAMIC) : $(INST_STATIC) $(PERL_INC)perlshr_attr.opt $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
+$(INST_DYNAMIC) : $(INST_STATIC) $(PERL_INC)perlshr_attr.opt blibdirs $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
$(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR)
If F$TrnLNm("',$shr,'").eqs."" Then Define/NoLog/User ',"$shr Sys\$Share:$shr.$Config{'dlext'}",'
Link $(LDFLAGS) /Shareable=$(MMS$TARGET)$(OTHERLDFLAGS) $(BASEEXT).opt/Option,$(PERL_INC)perlshr_attr.opt/Option
';
- push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
join('',@m);
}
@@ -1033,13 +1032,13 @@ BOOTSTRAP = '."$self->{BASEEXT}.bs".'
# As MakeMaker mkbootstrap might not write a file (if none is required)
# we use touch to prevent make continually trying to remake it.
# The DynaLoader only reads a non-empty file.
-$(BOOTSTRAP) : $(FIRST_MAKEFILE) '."$self->{BOOTDEP}".' $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
+$(BOOTSTRAP) : $(FIRST_MAKEFILE) '."$self->{BOOTDEP}".' blibdirs
$(NOECHO) $(ECHO) "Running mkbootstrap for $(NAME) ($(BSLOADLIBS))"
$(NOECHO) $(PERLRUN) -
-e "use ExtUtils::Mkbootstrap; Mkbootstrap(\'$(BASEEXT)\',\'$(BSLOADLIBS)\');"
$(NOECHO) $(TOUCH) $(MMS$TARGET)
-$(INST_BOOT) : $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
+$(INST_BOOT) : $(BOOTSTRAP) blibdirs
$(NOECHO) $(RM_RF) $(INST_BOOT)
- $(CP) $(BOOTSTRAP) $(INST_BOOT)
';
@@ -1063,7 +1062,7 @@ $(INST_STATIC) :
my(@m,$lib);
push @m,'
# Rely on suffix rule for update action
-$(OBJECT) : $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
+$(OBJECT) : blibdirs
$(INST_STATIC) : $(OBJECT) $(MYEXTLIB)
';
@@ -1086,7 +1085,6 @@ $(INST_STATIC) : $(OBJECT) $(MYEXTLIB)
foreach $lib (split ' ', $self->{EXTRALIBS}) {
push(@m,"\t",'$(NOECHO) $(PERL) -e "print qq{',$lib,'\n}" >>$(INST_ARCHAUTODIR)extralibs.ld',"\n");
}
- push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
join('',@m);
}
@@ -1172,10 +1170,10 @@ realclean ::
}
$todir = $self->fixpath($todir,1);
push @m, "
-$to : $from \$(FIRST_MAKEFILE) ${todir}\$(DIRFILESEP).exists
+$to : $from \$(FIRST_MAKEFILE) blibdirs
\$(CP) $from $to
-", $self->dir_target($todir);
+";
}
join "", @m;
}
@@ -1238,13 +1236,13 @@ clean :: clean_subdirs
}
}
push(@otherfiles, qw[ blib $(MAKE_APERL_FILE)
- perlmain.c pm_to_blib pm_to_blib.ts ]);
+ perlmain.c blibdirs pm_to_blib pm_to_blib.ts ]);
push(@otherfiles, $self->catfile('$(INST_ARCHAUTODIR)','extralibs.all'));
push(@otherfiles, $self->catfile('$(INST_ARCHAUTODIR)','extralibs.ld'));
# Occasionally files are repeated several times from different sources
{ my(%of) = map { ($_ => 1) } @otherfiles; @otherfiles = keys %of; }
-
+
my $line = '';
foreach my $file (@otherfiles) {
$file = $self->fixpath($file);
@@ -2045,6 +2043,9 @@ sub prefixify {
print STDERR " no Config found for $var.\n" if $Verbose >= 2;
$path = $self->_prefixify_default($rprefix, $default);
}
+ elsif( !$self->{ARGS}{PREFIX} || !$self->file_name_is_absolute($path) ) {
+ # do nothing if there's no prefix or if its relative
+ }
elsif( $sprefix eq $rprefix ) {
print STDERR " no new prefix.\n" if $Verbose >= 2;
}
diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm
index 8fe0b96d95..863642171c 100644
--- a/lib/ExtUtils/MM_Win32.pm
+++ b/lib/ExtUtils/MM_Win32.pm
@@ -29,7 +29,7 @@ use vars qw(@ISA $VERSION $BORLAND $GCC $DMAKE $NMAKE);
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = '1.09';
+$VERSION = '1.10';
$ENV{EMXSHELL} = 'sh'; # to run `commands`
@@ -269,7 +269,7 @@ sub static_lib {
my(@m);
push(@m, <<'END');
-$(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
+$(INST_STATIC): $(OBJECT) $(MYEXTLIB) blibdirs
$(RM_RF) $@
END
@@ -292,7 +292,6 @@ q{ $(AR) }.($BORLAND ? '$@ $(OBJECT:^"+")'
$(NOECHO) $(ECHO) "$(EXTRALIBS)" >> $(PERL_SRC)\ext.libs
MAKE_FRAG
- push @m, "\n", $self->dir_target('$(INST_ARCHAUTODIR)');
join('', @m);
}
@@ -331,7 +330,7 @@ sub dynamic_lib {
OTHERLDFLAGS = '.$otherldflags.'
INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
-$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
+$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) blibdirs $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
');
if ($GCC) {
push(@m,
@@ -356,7 +355,6 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILE
$(CHMOD) $(PERM_RWX) $@
';
- push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
join('',@m);
}
diff --git a/lib/ExtUtils/MM_Win95.pm b/lib/ExtUtils/MM_Win95.pm
index e6e56239d9..0c5046198a 100644
--- a/lib/ExtUtils/MM_Win95.pm
+++ b/lib/ExtUtils/MM_Win95.pm
@@ -209,11 +209,11 @@ sub os_flavor {
=head1 AUTHOR
-Code originally inside MM_Win32. Original author unknown.
+Code originally inside MM_Win32. Original author unknown.
-Currently maintained by Michael G Schwern <schwern@pobox.com>.
+Currently maintained by Michael G Schwern C<schwern@pobox.com>.
-Send patches and ideas to <F<makemaker@perl.org>>.
+Send patches and ideas to C<makemaker@perl.org>.
See http://www.makemaker.org.
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm
index 9b7d6ebfad..d1fe68b463 100644
--- a/lib/ExtUtils/MakeMaker.pm
+++ b/lib/ExtUtils/MakeMaker.pm
@@ -2,8 +2,8 @@ package ExtUtils::MakeMaker;
BEGIN {require 5.005_03;}
-$VERSION = '6.17';
-($Revision) = q$Revision: 1.133 $ =~ /Revision:\s+(\S+)/;
+$VERSION = '6.20';
+($Revision) = q$Revision: 1.142 $ =~ /Revision:\s+(\S+)/;
require Exporter;
use Config;
@@ -167,9 +167,11 @@ sub eval_in_subdirs {
foreach my $dir (@{$self->{DIR}}){
my($abs) = $self->catdir($pwd,$dir);
- $self->eval_in_x($abs);
+ eval { $self->eval_in_x($abs); };
+ last if $@;
}
chdir $pwd;
+ die $@ if $@;
}
sub eval_in_x {
@@ -226,7 +228,7 @@ sub full_setup {
PERL_SRC PERM_RW PERM_RWX
PL_FILES PM PM_FILTER PMLIBDIRS POLLUTE PPM_INSTALL_EXEC
PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
- SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
+ SIGN SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
XS_VERSION clean depend dist dynamic_lib linkext macro realclean
tool_autosplit
@@ -265,6 +267,7 @@ sub full_setup {
installbin subdirs
clean_subdirs clean realclean_subdirs realclean
metafile metafile_addtomanifest
+ signature signature_addtomanifest
dist_basics dist_core distdir dist_test dist_ci
install force perldepend makefile staticmake test ppd
@@ -273,7 +276,7 @@ sub full_setup {
@Overridable = @MM_Sections;
push @Overridable, qw[
- dir_target libscan makeaperl needs_linking perm_rw perm_rwx
+ blibdirs_target libscan makeaperl needs_linking perm_rw perm_rwx
subdir_x test_via_harness test_via_script init_PERL
];
@@ -380,7 +383,9 @@ sub new {
foreach my $prereq (sort keys %{$self->{PREREQ_PM}}) {
# 5.8.0 has a bug with require Foo::Bar alone in an eval, so an
# extra statement is a workaround.
- eval "require $prereq; 0";
+ my $file = "$prereq.pm";
+ $file =~ s{::}{/}g;
+ eval { require $file };
my $pr_version = $prereq->VERSION || 0;
@@ -1091,6 +1096,15 @@ searched by perl, run
perl -le 'print join $/, @INC'
+Sometimes older versions of the module you're installing live in other
+directories in @INC. Because Perl loads the first version of a module it
+finds, not the newest, you might accidentally get one of these older
+versions even after installing a brand new version. To delete I<all other
+versions of the module you're installing> (not simply older ones) set the
+C<UNINST> variable.
+
+ make install UNINST=1
+
=head2 PREFIX and LIB attribute
@@ -1991,6 +2005,16 @@ $Config{installprefix} will be used.
Overridable by PREFIX
+=item SIGN
+
+When true, perform the generation and addition to the MANIFEST of
+the SIGNATURE file during 'make distdir', via 'cpansign -s'.
+
+Note that you need to install the Module::Signature module to
+perform this operation.
+
+Defaults to false.
+
=item SKIP
Arrayref. E.g. [qw(name1 name2)] skip (do not write) sections of the
@@ -2040,7 +2064,7 @@ MakeMaker object. The following lines will be parsed o.k.:
$VERSION = '1.00';
*VERSION = \'1.01';
- $VERSION = sprintf "%d.%03d", q$Revision: 1.133 $ =~ /(\d+)/g;
+ $VERSION = sprintf "%d.%03d", q$Revision: 1.142 $ =~ /(\d+)/g;
$FOO::VERSION = '1.10';
*FOO::VERSION = \'1.11';
our $VERSION = 1.2.3; # new for perl5.6.0
@@ -2192,7 +2216,7 @@ for embedding.
If you still need a different solution, try to develop another
subroutine that fits your needs and submit the diffs to
-F<makemaker@perl.org>
+C<makemaker@perl.org>
For a complete description of all MakeMaker methods see
L<ExtUtils::MM_Unix>.
@@ -2440,26 +2464,26 @@ ExtUtils::Embed
=head1 AUTHORS
-Andy Dougherty <F<doughera@lafayette.edu>>, Andreas KE<ouml>nig
-<F<andreas.koenig@mind.de>>, Tim Bunce <F<timb@cpan.org>>. VMS
-support by Charles Bailey <F<bailey@newman.upenn.edu>>. OS/2 support
-by Ilya Zakharevich <F<ilya@math.ohio-state.edu>>.
+Andy Dougherty C<doughera@lafayette.edu>, Andreas KE<ouml>nig
+C<andreas.koenig@mind.de>, Tim Bunce C<timb@cpan.org>. VMS
+support by Charles Bailey C<bailey@newman.upenn.edu>. OS/2 support
+by Ilya Zakharevich C<ilya@math.ohio-state.edu>.
-Currently maintained by Michael G Schwern <F<schwern@pobox.com>>
+Currently maintained by Michael G Schwern C<schwern@pobox.com>
-Send patches and ideas to <F<makemaker@perl.org>>.
+Send patches and ideas to C<makemaker@perl.org>.
Send bug reports via http://rt.cpan.org/. Please send your
generated Makefile along with your report.
-For more up-to-date information, see http://www.makemaker.org.
+For more up-to-date information, see L<http://www.makemaker.org>.
=head1 LICENSE
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
-See F<http://www.perl.com/perl/misc/Artistic.html>
+See L<http://www.perl.com/perl/misc/Artistic.html>
=cut
diff --git a/lib/ExtUtils/Manifest.pm b/lib/ExtUtils/Manifest.pm
index f6dea291d9..b016131779 100644
--- a/lib/ExtUtils/Manifest.pm
+++ b/lib/ExtUtils/Manifest.pm
@@ -12,7 +12,7 @@ use vars qw($VERSION @ISA @EXPORT_OK
$Is_MacOS $Is_VMS
$Debug $Verbose $Quiet $MANIFEST $DEFAULT_MSKIP);
-$VERSION = 1.42;
+$VERSION = 1.43;
@ISA=('Exporter');
@EXPORT_OK = qw(mkmanifest
manicheck filecheck fullcheck skipcheck
@@ -367,17 +367,21 @@ sub _maniskip {
=item manicopy
- manicopy($src, $dest_dir);
- manicopy($src, $dest_dir, $how);
+ manicopy(\%src, $dest_dir);
+ manicopy(\%src, $dest_dir, $how);
-copies the files that are the keys in the HASH I<%$src> to the
-$dest_dir. The HASH reference $read is typically returned by the
-maniread() function. This function is useful for producing a directory
-tree identical to the intended distribution tree. The third parameter
-$how can be used to specify a different methods of "copying". Valid
+Copies the files that are the keys in %src to the $dest_dir. %src is
+typically returned by the maniread() function.
+
+ manicopy( maniread(), $dest_dir );
+
+This function is useful for producing a directory tree identical to the
+intended distribution tree.
+
+$how can be used to specify a different methods of "copying". Valid
values are C<cp>, which actually copies the files, C<ln> which creates
hard links, and C<best> which mostly links the files but copies any
-symbolic link to make a tree without any symbolic link. Best is the
+symbolic link to make a tree without any symbolic link. C<cp> is the
default.
=cut
@@ -442,43 +446,39 @@ sub cp_if_diff {
sub cp {
my ($srcFile, $dstFile) = @_;
- my ($perm,$access,$mod) = (stat $srcFile)[2,8,9];
+ my ($access,$mod) = (stat $srcFile)[8,9];
+
copy($srcFile,$dstFile);
utime $access, $mod + ($Is_VMS ? 1 : 0), $dstFile;
- # chmod a+rX-w,go-w
- chmod( 0444 | ( $perm & 0111 ? 0111 : 0 ), $dstFile )
- unless ($^O eq 'MacOS');
+ _manicopy_chmod($dstFile);
}
+
sub ln {
my ($srcFile, $dstFile) = @_;
return &cp if $Is_VMS or ($^O eq 'MSWin32' and Win32::IsWin95());
link($srcFile, $dstFile);
- # chmod a+r,go-w+X (except "X" only applies to u=x)
- local($_) = $dstFile;
- my $mode= 0444 | (stat)[2] & 0700;
- if (! chmod( $mode | ( $mode & 0100 ? 0111 : 0 ), $_ )) {
+ unless( _manicopy_chmod($dstFile) ) {
unlink $dstFile;
return;
}
1;
}
-unless (defined $Config{d_link}) {
- # Really cool fix from Ilya :)
- local $SIG{__WARN__} = sub {
- warn @_ unless $_[0] =~ /^Subroutine .* redefined/;
- };
- *ln = \&cp;
-}
-
-
+# 1) Strip off all group and world permissions.
+# 2) Let everyone read it.
+# 3) If the owner can execute it, everyone can.
+sub _manicopy_chmod {
+ my($file) = shift;
+ my $perm = 0444 | (stat $file)[2] & 0700;
+ chmod( $perm | ( $perm & 0100 ? 0111 : 0 ), $file );
+}
sub best {
my ($srcFile, $dstFile) = @_;
- if (-l $srcFile) {
+ if (!$Config{d_link} or -l $srcFile) {
cp($srcFile, $dstFile);
} else {
ln($srcFile, $dstFile) or cp($srcFile, $dstFile);
@@ -489,21 +489,21 @@ sub _macify {
my($file) = @_;
return $file unless $Is_MacOS;
-
+
$file =~ s|^\./||;
if ($file =~ m|/|) {
$file =~ s|/+|:|g;
$file = ":$file";
}
-
+
$file;
}
sub _maccat {
my($f1, $f2) = @_;
-
+
return "$f1/$f2" unless $Is_MacOS;
-
+
$f1 .= ":$f2";
$f1 =~ s/([^:]:):/$1/g;
return $f1;
@@ -686,7 +686,9 @@ L<ExtUtils::MakeMaker> which has handy targets for most of the functionality.
=head1 AUTHOR
-Andreas Koenig <F<andreas.koenig@anima.de>>
+Andreas Koenig C<andreas.koenig@anima.de>
+
+Currently maintained by Michael G Schwern C<schwern@pobox.com>
=cut
diff --git a/lib/ExtUtils/README b/lib/ExtUtils/README
index 4d6eed77c5..7c459063b5 100644
--- a/lib/ExtUtils/README
+++ b/lib/ExtUtils/README
@@ -6,17 +6,18 @@ If you do not have a make program, several can be found...
Most Unixen: The make utility which comes with your operating system
should work fine. If you don't have one, GNU make is recommended,
most others (Sun, BSD, etc...) will work fine as well.
+http://www.gnu.org/software/make/make.html GNU make
Windows: nmake or dmake will work. GNU make will *not*.
-ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe
-http://search.cpan.org/author/GSAR/dmake-4.1pl1-win32/
+ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe nmake
+http://search.cpan.org/author/GSAR/dmake-4.1pl1-win32/ dmake
VMS: MMS or the free MadGoat MaKe utility (MMK) will work.
-http://www.madgoat.com/mmk.html
+http://www.madgoat.com/mmk.html MMK
If all else fails there is a pure Perl version of make available on
CPAN which should work on most Unixen.
-http://search.cpan.org/author/NI-S/Make-1.00/
+http://search.cpan.org/author/NI-S/Make-1.00/ pmake
PLEASE NOTE: This distribution does not include the xsubpp or typemap
diff --git a/lib/ExtUtils/TODO b/lib/ExtUtils/TODO
index 3ff020c79a..80c69f6282 100644
--- a/lib/ExtUtils/TODO
+++ b/lib/ExtUtils/TODO
@@ -20,8 +20,6 @@ below the cwd.
Fill in the IMPORTS docs.
-Document "make install UNINST=1"
-
Remove tar -I Sun-ism from instmodsh.
Consider adding a timeout option to prompt() and env variable.
@@ -46,8 +44,6 @@ Finish ExtUtils::MakeMaker::Tutorial
Add 'how to install additional files' to ExtUtils::MakeMaker::FAQ.
-Fix NORECUSE bug continuing to set DIR
-
Give typemap location its own macro.
Merge MM_VMS->tool_xsubpp
diff --git a/lib/ExtUtils/instmodsh b/lib/ExtUtils/instmodsh
index cbf2d01194..f568e88622 100755
--- a/lib/ExtUtils/instmodsh
+++ b/lib/ExtUtils/instmodsh
@@ -7,7 +7,22 @@ use ExtUtils::Installed;
use vars qw($Inst @Modules);
-################################################################################
+
+=head1 NAME
+
+instmodsh - A shell to examine installed modules
+
+=head1 SYNOPSIS
+
+ instmodsh
+
+=head1 DESCRIPTION
+
+A little interface to ExtUtils::Installed to examine installed modules,
+validate your packlists and even create a tarball from an installed module.
+
+=cut
+
sub do_module($)
{
diff --git a/lib/ExtUtils/t/Command.t b/lib/ExtUtils/t/Command.t
index bf7d177889..a937bc3769 100644
--- a/lib/ExtUtils/t/Command.t
+++ b/lib/ExtUtils/t/Command.t
@@ -23,7 +23,7 @@ BEGIN {
}
BEGIN {
- use Test::More tests => 26;
+ use Test::More tests => 34;
use File::Spec;
}
@@ -66,6 +66,7 @@ BEGIN {
@ARGV = ( $Testfile );
ok( test_f(), 'now creating that file' );
+ is_deeply( \@ARGV, [$Testfile], 'test_f preserves @ARGV' );
@ARGV = ( $Testfile );
ok( -e $ARGV[0], 'created!' );
@@ -134,7 +135,9 @@ BEGIN {
# change a file to read-write
@ARGV = ( '0600', $Testfile );
+ my @orig_argv = @ARGV;
ExtUtils::Command::chmod();
+ is_deeply( \@ARGV, \@orig_argv, 'chmod preserves @ARGV' );
is( ((stat($Testfile))[2] & 07777) & 0700,
($^O eq 'vos' ? 0700 : 0600), 'change a file to read-write' );
@@ -148,7 +151,9 @@ BEGIN {
# copy a file to a nested subdirectory
unshift @ARGV, $Testfile;
+ @orig_argv = @ARGV;
cp();
+ is_deeply( \@ARGV, \@orig_argv, 'cp preserves @ARGV' );
ok( -e File::Spec->join( 'ecmddir', 'temp2', $Testfile ), 'copied okay' );
@@ -160,7 +165,9 @@ BEGIN {
# move a file to a subdirectory
@ARGV = ( $Testfile, 'ecmddir' );
- mv();
+ @orig_argv = @ARGV;
+ ok( mv() );
+ is_deeply( \@ARGV, \@orig_argv, 'mv preserves @ARGV' );
ok( ! -e $Testfile, 'moved file away' );
ok( -e File::Spec->join( 'ecmddir', $Testfile ), 'file in new location' );
@@ -208,7 +215,35 @@ BEGIN {
ok( ! -e $dir, "removed $dir successfully" );
}
+{
+ { local @ARGV = 'd2utest'; mkpath; }
+ open(FILE, '>d2utest/foo');
+ print FILE "stuff\015\012and thing\015\012";
+ close FILE;
+
+ open(FILE, '>d2utest/bar');
+ binmode(FILE);
+ my $bin = "\c@\c@\c@\c@\c@\c@\cA\c@\c@\c@\015\012".
+ "\@\c@\cA\c@\c@\c@8__LIN\015\012";
+ print FILE $bin;
+ close FILE;
+
+ local @ARGV = 'd2utest';
+ ExtUtils::Command::dos2unix();
+
+ open(FILE, 'd2utest/foo');
+ is( join('', <FILE>), "stuff\012and thing\012", 'dos2unix' );
+ close FILE;
+
+ open(FILE, 'd2utest/bar');
+ binmode(FILE);
+ ok( -B 'd2utest/bar' );
+ is( join('', <FILE>), $bin, 'dos2unix preserves binaries');
+ close FILE;
+}
+
END {
1 while unlink $Testfile, 'newfile';
File::Path::rmtree( 'ecmddir' );
+ File::Path::rmtree( 'd2utest' );
}
diff --git a/lib/ExtUtils/t/INST.t b/lib/ExtUtils/t/INST.t
index 3639acd11b..49938cb0d0 100644
--- a/lib/ExtUtils/t/INST.t
+++ b/lib/ExtUtils/t/INST.t
@@ -16,8 +16,9 @@ BEGIN {
}
use strict;
-use Test::More tests => 23;
+use Test::More tests => 26;
use MakeMaker::Test::Utils;
+use MakeMaker::Test::Setup::BFD;
use ExtUtils::MakeMaker;
use File::Spec;
use TieOut;
@@ -33,6 +34,12 @@ my $Makefile = makefile_name;
my $Curdir = File::Spec->curdir;
my $Updir = File::Spec->updir;
+ok( setup_recurs(), 'setup' );
+END {
+ ok( chdir File::Spec->updir );
+ ok( teardown_recurs(), 'teardown' );
+}
+
ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
diag("chdir failed: $!");
diff --git a/lib/ExtUtils/t/INST_PREFIX.t b/lib/ExtUtils/t/INST_PREFIX.t
index 2d90a8c472..3c7d922c87 100644
--- a/lib/ExtUtils/t/INST_PREFIX.t
+++ b/lib/ExtUtils/t/INST_PREFIX.t
@@ -16,8 +16,9 @@ BEGIN {
}
use strict;
-use Test::More tests => 36;
+use Test::More tests => 52;
use MakeMaker::Test::Utils;
+use MakeMaker::Test::Setup::BFD;
use ExtUtils::MakeMaker;
use File::Spec;
use TieOut;
@@ -35,6 +36,12 @@ my $Makefile = makefile_name;
my $Curdir = File::Spec->curdir;
my $Updir = File::Spec->updir;
+ok( setup_recurs(), 'setup' );
+END {
+ ok( chdir File::Spec->updir );
+ ok( teardown_recurs(), 'teardown' );
+}
+
ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
diag("chdir failed: $!");
@@ -55,6 +62,8 @@ like( $stdout->read, qr{
Writing\ $Makefile\ for\ Big::Dummy\n
}x );
+is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
+
isa_ok( $mm, 'ExtUtils::MakeMaker' );
is( $mm->{NAME}, 'Big::Dummy', 'NAME' );
@@ -112,18 +121,28 @@ my %Install_Vars = (
);
while( my($type, $vars) = each %Install_Vars) {
-
- SKIP: foreach my $var (@$vars) {
+ SKIP: {
skip "VMS must expand macros in INSTALL* vars", scalar @$vars
- if $Is_VMS;
-
- my $prefix = '$('.$type.'PREFIX)';
-
- # support for man page skipping
- $prefix = 'none' if $type eq 'PERL' &&
- $var =~ /man/ &&
- !$Config{"install$var"};
- like( $mm->{uc "install$var"}, qr/^\Q$prefix\E/, "$prefix + $var" );
+ if $Is_VMS;
+ skip '$Config{usevendorprefix} not set', scalar @$vars
+ if $type eq 'VENDOR' and !$Config{usevendorprefix};
+
+ foreach my $var (@$vars) {
+ my $installvar = "install$var";
+ my $prefix = '$('.$type.'PREFIX)';
+
+ SKIP: {
+ skip uc($installvar).' set to another INSTALL variable', 1
+ if $mm->{uc $installvar} =~ /^\$\(INSTALL.*\)$/;
+
+ # support for man page skipping
+ $prefix = 'none' if $type eq 'PERL' &&
+ $var =~ /man/ &&
+ !$Config{$installvar};
+ like( $mm->{uc $installvar}, qr/^\Q$prefix\E/,
+ "$prefix + $var" );
+ }
+ }
}
}
@@ -135,8 +154,8 @@ while( my($type, $vars) = each %Install_Vars) {
%ExtUtils::MM_Unix::Config = %Config;
*ExtUtils::MM_VMS::Config = \%ExtUtils::MM_Unix::Config;
- $ExtUtils::MM_Unix::Config{installman1dir} = '';
- $ExtUtils::MM_Unix::Config{installman3dir} = '';
+ _set_config(installman1dir => '');
+ _set_config(installman3dir => '');
my $wibble = File::Spec->catdir(qw(wibble and such));
my $stdout = tie *STDOUT, 'TieOut' or die;
@@ -163,11 +182,10 @@ while( my($type, $vars) = each %Install_Vars) {
%ExtUtils::MM_Unix::Config = %Config;
*ExtUtils::MM_VMS::Config = \%ExtUtils::MM_Unix::Config;
- $ExtUtils::MM_Unix::Config{installvendorman1dir} =
- File::Spec->catdir('foo','bar');
- $ExtUtils::MM_Unix::Config{installvendorman3dir} = '';
- $ExtUtils::MM_Unix::Config{usevendorprefix} = 1;
- $ExtUtils::MM_Unix::Config{vendorprefixexp} = 'something';
+ _set_config(installvendorman1dir => File::Spec->catdir('foo','bar') );
+ _set_config(installvendorman3dir => '' );
+ _set_config(usevendorprefix => 1 );
+ _set_config(vendorprefixexp => 'something' );
my $stdout = tie *STDOUT, 'TieOut' or die;
my $mm = WriteMakefile(
@@ -186,3 +204,82 @@ while( my($type, $vars) = each %Install_Vars) {
isnt( $mm->{INSTALLVENDORMAN3DIR}, '',
'installvendorman3dir (not in %Config) set' );
}
+
+# Check that when installsiteman*dir isn't set in Config it falls back
+# to installman*dir
+{
+ undef *ExtUtils::MM_Unix::Config;
+ undef *ExtUtils::MM_Unix::Config_Override;
+ %ExtUtils::MM_Unix::Config = %Config;
+ *ExtUtils::MM_VMS::Config = \%ExtUtils::MM_Unix::Config;
+
+ _set_config(installman1dir => File::Spec->catdir('foo', 'bar') );
+ _set_config(installman3dir => File::Spec->catdir('foo', 'baz') );
+ _set_config(installsiteman1dir => '' );
+ _set_config(installsiteman3dir => '' );
+ _set_config(installvendorman1dir => '' );
+ _set_config(installvendorman3dir => '' );
+ _set_config(usevendorprefix => 'define' );
+ _set_config(vendorprefixexp => 'something' );
+
+ my $wibble = File::Spec->catdir(qw(wibble and such));
+ my $stdout = tie *STDOUT, 'TieOut' or die;
+ my $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ PERL_CORE => $ENV{PERL_CORE},
+ );
+
+ is( $mm->{INSTALLMAN1DIR}, File::Spec->catdir('foo', 'bar') );
+ is( $mm->{INSTALLMAN3DIR}, File::Spec->catdir('foo', 'baz') );
+ is( $mm->{INSTALLSITEMAN1DIR}, '$(INSTALLMAN1DIR)' );
+ is( $mm->{INSTALLSITEMAN3DIR}, '$(INSTALLMAN3DIR)' );
+ is( $mm->{INSTALLVENDORMAN1DIR}, '$(INSTALLMAN1DIR)' );
+ is( $mm->{INSTALLVENDORMAN3DIR}, '$(INSTALLMAN3DIR)' );
+}
+
+
+# Check that when usevendoprefix and installvendorman*dir aren't set in
+# Config it leaves them unset.
+{
+ undef *ExtUtils::MM_Unix::Config;
+ undef *ExtUtils::MM_Unix::Config_Override;
+ %ExtUtils::MM_Unix::Config = %Config;
+ *ExtUtils::MM_VMS::Config = \%ExtUtils::MM_Unix::Config;
+
+ _set_config(installman1dir => File::Spec->catdir('foo', 'bar') );
+ _set_config(installman3dir => File::Spec->catdir('foo', 'baz') );
+ _set_config(installsiteman1dir => '' );
+ _set_config(installsiteman3dir => '' );
+ _set_config(installvendorman1dir => '' );
+ _set_config(installvendorman3dir => '' );
+ _set_config(usevendorprefix => '' );
+ _set_config(vendorprefixexp => '' );
+
+ my $wibble = File::Spec->catdir(qw(wibble and such));
+ my $stdout = tie *STDOUT, 'TieOut' or die;
+ my $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ PERL_CORE => $ENV{PERL_CORE},
+ );
+
+ is( $mm->{INSTALLMAN1DIR}, File::Spec->catdir('foo', 'bar') );
+ is( $mm->{INSTALLMAN3DIR}, File::Spec->catdir('foo', 'baz') );
+ is( $mm->{INSTALLSITEMAN1DIR}, '$(INSTALLMAN1DIR)' );
+ is( $mm->{INSTALLSITEMAN3DIR}, '$(INSTALLMAN3DIR)' );
+ is( $mm->{INSTALLVENDORMAN1DIR}, '' );
+ is( $mm->{INSTALLVENDORMAN3DIR}, '' );
+}
+
+
+sub _set_config {
+ my($k,$v) = @_;
+ (my $k_no_install = $k) =~ s/^install//i;
+ $ExtUtils::MM_Unix::Config{$k} = $v;
+
+ # Because VMS's config has traditionally been underpopulated, it will
+ # fall back to the install-less versions in desperation.
+ $ExtUtils::MM_Unix::Config{$k_no_install} = $v if $Is_VMS;
+ return;
+}
diff --git a/lib/ExtUtils/t/Install.t b/lib/ExtUtils/t/Install.t
index 13b3a6779c..6058811c26 100644
--- a/lib/ExtUtils/t/Install.t
+++ b/lib/ExtUtils/t/Install.t
@@ -17,7 +17,9 @@ use TieOut;
use File::Path;
use File::Spec;
-use Test::More tests => 29;
+use Test::More tests => 32;
+
+use MakeMaker::Test::Setup::BFD;
BEGIN { use_ok('ExtUtils::Install') }
@@ -27,6 +29,12 @@ foreach my $func (qw(install uninstall pm_to_blib install_default)) {
}
+ok( setup_recurs(), 'setup' );
+END {
+ ok( chdir File::Spec->updir );
+ ok( teardown_recurs(), 'teardown' );
+}
+
chdir 'Big-Dummy';
my $stdout = tie *STDOUT, 'TieOut';
diff --git a/lib/ExtUtils/t/MM_Cygwin.t b/lib/ExtUtils/t/MM_Cygwin.t
index 5b0b04f6c6..266c465940 100644
--- a/lib/ExtUtils/t/MM_Cygwin.t
+++ b/lib/ExtUtils/t/MM_Cygwin.t
@@ -85,7 +85,7 @@ like( $res, qr/pure_all.*foo.*foo.1/s, '... should add MAN3PODS targets' );
# init_linker
{
my $libperl = $Config{libperl} || 'libperl.a';
- $libperl =~ s/\.a/.dll.a/ if $] >= 5.007;
+ $libperl =~ s/\.a/.dll.a/ if $] >= 5.006002;
$libperl = "\$(PERL_INC)/$libperl";
my $export = '';
diff --git a/lib/ExtUtils/t/MM_Unix.t b/lib/ExtUtils/t/MM_Unix.t
index 6683761995..197f46a931 100644
--- a/lib/ExtUtils/t/MM_Unix.t
+++ b/lib/ExtUtils/t/MM_Unix.t
@@ -18,14 +18,12 @@ BEGIN {
plan skip_all => 'Non-Unix platform';
}
else {
- plan tests => 115;
+ plan tests => 110;
}
}
BEGIN { use_ok( 'ExtUtils::MM_Unix' ); }
-use vars qw($VERSION);
-$VERSION = '0.02';
use strict;
use File::Spec;
@@ -74,7 +72,6 @@ foreach ( qw /
const_loadlibs
constants
depend
- dir_target
dist
dist_basics
dist_ci
@@ -174,42 +171,23 @@ is ($t->libscan('Fatty'), 'Fatty', 'libscan on something not a VC file' );
###############################################################################
# maybe_command
-is ($t->maybe_command('blargel'),undef,"'blargel' isn't a command");
+open(FILE, ">command"); print FILE "foo"; close FILE;
+ok (!$t->maybe_command('command') ,"non executable file isn't a command");
+chmod 0755, "command";
+ok ($t->maybe_command('command'), "executable file is a command");
+unlink "command";
###############################################################################
# nicetext (dummy method)
is ($t->nicetext('LOTR'),'LOTR','nicetext');
-###############################################################################
-# parse_version
-
-my $self_name = $ENV{PERL_CORE} ? '../lib/ExtUtils/t/MM_Unix.t'
- : 'MM_Unix.t';
-
-is( $t->parse_version($self_name), '0.02', 'parse_version on ourself');
-
-my %versions = (
- '$VERSION = 0.0' => 0.0,
- '$VERSION = -1.0' => -1.0,
- '$VERSION = undef' => 'undef',
- '$wibble = 1.0' => 'undef',
- );
-
-while( my($code, $expect) = each %versions ) {
- open(FILE, ">VERSION.tmp") || die $!;
- print FILE "$code\n";
- close FILE;
-
- is( $t->parse_version('VERSION.tmp'), $expect, $code );
-
- unlink "VERSION.tmp";
-}
-
###############################################################################
# perl_script (on unix any ordinary, readable file)
+my $self_name = $ENV{PERL_CORE} ? '../lib/ExtUtils/t/MM_Unix.t'
+ : 'MM_Unix.t';
is ($t->perl_script($self_name),$self_name, 'we pass as a perl_script()');
###############################################################################
diff --git a/lib/ExtUtils/t/Manifest.t b/lib/ExtUtils/t/Manifest.t
index 215a24b14e..396789e7b5 100644
--- a/lib/ExtUtils/t/Manifest.t
+++ b/lib/ExtUtils/t/Manifest.t
@@ -13,13 +13,14 @@ chdir 't';
use strict;
-# these files help the test run
-use Test::More tests => 41;
+use Test::More tests => 49;
use Cwd;
-# these files are needed for the module itself
use File::Spec;
use File::Path;
+use File::Find;
+
+my $Is_VMS = $^O eq 'VMS';
# We're going to be chdir'ing and modules are sometimes loaded on the
# fly in this test, so we need an absolute @INC.
@@ -38,20 +39,20 @@ sub add_file {
}
sub read_manifest {
- open( M, 'MANIFEST' ) or return;
- chomp( my @files = <M> );
+ open( M, 'MANIFEST' ) or return;
+ chomp( my @files = <M> );
close M;
- return @files;
+ return @files;
}
sub catch_warning {
- my $warn;
- local $SIG{__WARN__} = sub { $warn .= $_[0] };
- return join('', $_[0]->() ), $warn;
+ my $warn;
+ local $SIG{__WARN__} = sub { $warn .= $_[0] };
+ return join('', $_[0]->() ), $warn;
}
sub remove_dir {
- ok( rmdir( $_ ), "remove $_ directory" ) for @_;
+ ok( rmdir( $_ ), "remove $_ directory" ) for @_;
}
# use module, import functions
@@ -134,13 +135,33 @@ is( join(' ', sort { lc($a) cmp lc($b) } keys %$files), 'foo MANIFEST',
'both files found' );
is( $_, 'foo', q{maniread() doesn't clobber $_} );
+ok( mkdir( 'copy', 0777 ), 'made copy directory' );
+
+# Check that manicopy copies files.
+manicopy( $files, 'copy', 'cp' );
+my @copies = ();
+find( sub { push @copies, $_ if -f }, 'copy' );
+@copies = map { s/\.$//; $_ } @copies if $Is_VMS; # VMS likes to put dots on
+ # the end of files.
+# Have to compare insensitively for non-case preserving VMS
+is_deeply( [sort map { lc } @copies], [sort map { lc } keys %$files] );
+
+# cp would leave files readonly, so check permissions.
+foreach my $orig (@copies) {
+ my $copy = "copy/$orig";
+ ok( -r $copy, "$copy: must be readable" );
+ is( -w $copy, -w $orig, " writable if original was" );
+ is( -x $copy, -x $orig, " executable if original was" );
+}
+rmtree('copy');
+
+
# poison the manifest, and add a comment that should be reported
add_file( 'MANIFEST', 'none #none' );
is( ExtUtils::Manifest::maniread()->{none}, '#none',
'maniread found comment' );
ok( mkdir( 'copy', 0777 ), 'made copy directory' );
-
$files = maniread();
eval { (undef, $warn) = catch_warning( sub {
manicopy( $files, 'copy', 'cp' ) })
@@ -220,7 +241,7 @@ SKIP: {
chmod( 0600, 'MANIFEST' );
}
-
+
END {
is( unlink( keys %Files ), keys %Files, 'remove all added files' );
diff --git a/lib/ExtUtils/t/basic.t b/lib/ExtUtils/t/basic.t
index 960a75dfdf..c8c2ad33ba 100644
--- a/lib/ExtUtils/t/basic.t
+++ b/lib/ExtUtils/t/basic.t
@@ -16,8 +16,9 @@ BEGIN {
use strict;
use Config;
-use Test::More tests => 73;
+use Test::More tests => 79;
use MakeMaker::Test::Utils;
+use MakeMaker::Test::Setup::BFD;
use File::Find;
use File::Spec;
use File::Path;
@@ -38,6 +39,12 @@ my $Touch_Time = calibrate_mtime();
$| = 1;
+ok( setup_recurs(), 'setup' );
+END {
+ ok( chdir File::Spec->updir );
+ ok( teardown_recurs(), 'teardown' );
+}
+
ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
diag("chdir failed: $!");
@@ -226,13 +233,20 @@ my $manifest = maniread();
# look like. :(
_normalize($manifest);
is( $manifest->{'meta.yml'}, 'Module meta-data (added by MakeMaker)' );
+my $meta_mtime = (stat('META.yml'))[9];
+
+sleep 1;
+my $metafile_out = run("$make metafile");
+is( $?, 0, 'metafile' ) || diag($metafile_out);
+is( (stat('META.yml'))[9], $meta_mtime, 'META.yml untouched if not changed' );
+ok( !-e 'META_new.yml', 'temp META.yml file not left around' );
# Test NO_META META.yml suppression
unlink 'META.yml';
ok( !-f 'META.yml', 'META.yml deleted' );
@mpl_out = run(qq{$perl Makefile.PL "NO_META=1"});
cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out);
-my $metafile_out = run("$make metafile");
+$metafile_out = run("$make metafile");
is( $?, 0, 'metafile' ) || diag($metafile_out);
ok( !-f 'META.yml', 'META.yml generation suppressed by NO_META' );
diff --git a/lib/ExtUtils/t/parse_version.t b/lib/ExtUtils/t/parse_version.t
new file mode 100644
index 0000000000..9ddc8a09a4
--- /dev/null
+++ b/lib/ExtUtils/t/parse_version.t
@@ -0,0 +1,34 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ chdir 't';
+ @INC = '../lib';
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+chdir 't';
+
+use Test::More 'no_plan';
+use ExtUtils::MakeMaker;
+
+my %versions = ('$VERSION = 0.02' => 0.02,
+ '$VERSION = 0.0' => 0.0,
+ '$VERSION = -1.0' => -1.0,
+ '$VERSION = undef' => 'undef',
+ '$wibble = 1.0' => 'undef',
+ );
+
+while( my($code, $expect) = each %versions ) {
+ open(FILE, ">VERSION.tmp") || die $!;
+ print FILE "$code\n";
+ close FILE;
+
+ $_ = 'foo';
+ is( MM->parse_version('VERSION.tmp'), $expect, $code );
+ is( $_, 'foo', '$_ not leaked by parse_version' );
+
+ unlink "VERSION.tmp";
+}
diff --git a/lib/ExtUtils/t/postamble.t b/lib/ExtUtils/t/postamble.t
index b8c049277f..0fbeabd07b 100644
--- a/lib/ExtUtils/t/postamble.t
+++ b/lib/ExtUtils/t/postamble.t
@@ -13,8 +13,9 @@ BEGIN {
}
use strict;
-use Test::More tests => 5;
+use Test::More tests => 8;
use MakeMaker::Test::Utils;
+use MakeMaker::Test::Setup::BFD;
use ExtUtils::MakeMaker;
use TieOut;
@@ -24,6 +25,12 @@ $| = 1;
my $Makefile = makefile_name;
+ok( setup_recurs(), 'setup' );
+END {
+ ok( chdir File::Spec->updir );
+ ok( teardown_recurs(), 'teardown' );
+}
+
ok( chdir 'Big-Dummy', q{chdir'd to Big-Dummy} ) ||
diag("chdir failed: $!");
@@ -63,3 +70,4 @@ ok( open(MAKEFILE, $Makefile) ) or diag "Can't open $Makefile: $!";
like( <MAKEFILE>, qr/^\# This makes sure the postamble gets written\n/m,
'postamble added to the Makefile' );
}
+close MAKEFILE;
diff --git a/lib/ExtUtils/t/prefixify.t b/lib/ExtUtils/t/prefixify.t
index 644bc00e8a..6faa943ac0 100644
--- a/lib/ExtUtils/t/prefixify.t
+++ b/lib/ExtUtils/t/prefixify.t
@@ -23,6 +23,8 @@ use Config;
use File::Spec;
use ExtUtils::MM;
+my $Is_Dosish = $^O =~ /^(dos|MSWin32)$/;
+
my $mm = bless {}, 'MM';
my $default = File::Spec->catdir(qw(this that));
@@ -36,11 +38,12 @@ $mm->prefixify('installbin', 'wibble', 'something', $default);
is( $mm->{INSTALLBIN}, File::Spec->catdir('something', $default),
'prefixify w/defaults and PREFIX');
-{
+SKIP: {
+ skip "Test for DOSish prefixification", 1 unless $Is_Dosish;
+
undef *ExtUtils::MM_Unix::Config;
$ExtUtils::MM_Unix::Config{wibble} = 'C:\opt\perl\wibble';
$mm->prefixify('wibble', 'C:\opt\perl', 'C:\yarrow');
is( $mm->{WIBBLE}, 'C:\yarrow\wibble', 'prefixify Win32 paths' );
- { package ExtUtils::MM_Unix; Config->import }
}
diff --git a/lib/ExtUtils/t/prereq_print.t b/lib/ExtUtils/t/prereq_print.t
index 78dc6e8e1f..05790e5834 100644
--- a/lib/ExtUtils/t/prereq_print.t
+++ b/lib/ExtUtils/t/prereq_print.t
@@ -13,8 +13,9 @@ BEGIN {
use strict;
use Config;
-use Test::More tests => 8;
+use Test::More tests => 11;
use MakeMaker::Test::Utils;
+use MakeMaker::Test::Setup::BFD;
# 'make disttest' sets a bunch of environment variables which interfere
# with our testing.
@@ -29,6 +30,12 @@ perl_lib;
$| = 1;
+ok( setup_recurs(), 'setup' );
+END {
+ ok( chdir File::Spec->updir );
+ ok( teardown_recurs(), 'teardown' );
+}
+
ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
diag("chdir failed: $!");
diff --git a/lib/ExtUtils/t/problems.t b/lib/ExtUtils/t/problems.t
index e9162d2032..8708532d1b 100644
--- a/lib/ExtUtils/t/problems.t
+++ b/lib/ExtUtils/t/problems.t
@@ -12,12 +12,19 @@ BEGIN {
chdir 't';
use strict;
-use Test::More tests => 3;
+use Test::More tests => 6;
use ExtUtils::MM;
+use MakeMaker::Test::Setup::Problem;
use TieOut;
my $MM = bless { DIR => ['subdir'] }, 'MM';
+ok( setup_recurs(), 'setup' );
+END {
+ ok( chdir File::Spec->updir );
+ ok( teardown_recurs(), 'teardown' );
+}
+
ok( chdir 'Problem-Module', "chdir'd to Problem-Module" ) ||
diag("chdir failed: $!");
diff --git a/lib/ExtUtils/t/writemakefile_args.t b/lib/ExtUtils/t/writemakefile_args.t
index f4b4daf6e3..a19a5ee644 100644
--- a/lib/ExtUtils/t/writemakefile_args.t
+++ b/lib/ExtUtils/t/writemakefile_args.t
@@ -14,10 +14,11 @@ BEGIN {
}
use strict;
-use Test::More tests => 13;
+use Test::More tests => 16;
use TieOut;
use MakeMaker::Test::Utils;
+use MakeMaker::Test::Setup::BFD;
use ExtUtils::MakeMaker;
@@ -25,6 +26,12 @@ chdir 't';
perl_lib();
+ok( setup_recurs(), 'setup' );
+END {
+ ok( chdir File::Spec->updir );
+ ok( teardown_recurs(), 'teardown' );
+}
+
ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
diag("chdir failed: $!");
diff --git a/lib/ExtUtils/t/zz_cleanup_dummy.t b/lib/ExtUtils/t/zz_cleanup_dummy.t
deleted file mode 100644
index 1b01f0a5d0..0000000000
--- a/lib/ExtUtils/t/zz_cleanup_dummy.t
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir($^O eq 'VMS' ? 'BFD_TEST_ROOT:[t]' : 't');
-
-
-use strict;
-use Test::More tests => 3;
-use File::Path;
-
-rmtree('Big-Dummy');
-ok(!-d 'Big-Dummy', 'Big-Dummy cleaned up');
-rmtree('Problem-Module');
-ok(!-d 'Problem-Module', 'Problem-Module cleaned up');
-rmtree('dummy-install');
-ok(!-d 'dummy-install', 'dummy-install cleaned up');
diff --git a/lib/ExtUtils/t/00setup_dummy.t b/t/lib/MakeMaker/Test/Setup/BFD.pm
index 0b9e58d056..2509a2cfb0 100644
--- a/lib/ExtUtils/t/00setup_dummy.t
+++ b/t/lib/MakeMaker/Test/Setup/BFD.pm
@@ -1,36 +1,12 @@
-#!/usr/bin/perl -w
+package MakeMaker::Test::Setup::BFD;
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
+@ISA = qw(Exporter);
+require Exporter;
+@EXPORT = qw(setup_recurs teardown_recurs);
use strict;
-use Test::More tests => 9;
-use File::Basename;
use File::Path;
-use File::Spec;
-
-if( $^O eq 'VMS' ) {
- # On older systems we might exceed the 8-level directory depth limit
- # imposed by RMS. We get around this with a rooted logical, but we
- # can't create logical names with attributes in Perl, so we do it
- # in a DCL subprocess and put it in the job table so the parent sees it.
- open( BFDTMP, '>bfdtesttmp.com' ) || die "Error creating command file; $!";
- print BFDTMP <<'COMMAND';
-$ BFD_TEST_ROOT = F$PARSE("SYS$DISK:[-]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
-$ DEFINE/JOB/NOLOG/TRANSLATION=CONCEALED BFD_TEST_ROOT 'BFD_TEST_ROOT'
-COMMAND
- close BFDTMP;
-
- system '@bfdtesttmp.com';
- 1 while unlink 'bfdtesttmp.com';
-}
+use File::Basename;
my %Files = (
@@ -101,35 +77,54 @@ foreach my $key (qw(INST_LIB INST_ARCHLIB)) {
}
END
- 'Problem-Module/Makefile.PL' => <<'END',
-use ExtUtils::MakeMaker;
+ );
-WriteMakefile(
- NAME => 'Problem::Module',
-);
-END
- 'Problem-Module/subdir/Makefile.PL' => <<'END',
-printf "\@INC %s .\n", (grep { $_ eq '.' } @INC) ? "has" : "doesn't have";
+sub _setup_bfd_test_root {
+ if( $^O eq 'VMS' ) {
+ # On older systems we might exceed the 8-level directory depth limit
+ # imposed by RMS. We get around this with a rooted logical, but we
+ # can't create logical names with attributes in Perl, so we do it
+ # in a DCL subprocess and put it in the job table so the parent sees it.
+ open( BFDTMP, '>bfdtesttmp.com' ) ||
+ die "Error creating command file; $!";
+ print BFDTMP <<'COMMAND';
+$ BFD_TEST_ROOT = F$PARSE("SYS$DISK:[-]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
+$ DEFINE/JOB/NOLOG/TRANSLATION=CONCEALED BFD_TEST_ROOT 'BFD_TEST_ROOT'
+COMMAND
+ close BFDTMP;
-warn "I think I'm going to be sick\n";
-die "YYYAaaaakkk\n";
-END
+ system '@bfdtesttmp.com';
+ 1 while unlink 'bfdtesttmp.com';
+ }
+}
- );
+sub setup_recurs {
+ _setup_bfd_test_root();
+
+ while(my($file, $text) = each %Files) {
+ # Convert to a relative, native file path.
+ $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file);
-while(my($file, $text) = each %Files) {
- # Convert to a relative, native file path.
- $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file);
+ my $dir = dirname($file);
+ mkpath $dir;
+ open(FILE, ">$file") || die "Can't create $file: $!";
+ print FILE $text;
+ close FILE;
+ }
- my $dir = dirname($file);
- mkpath $dir;
- open(FILE, ">$file");
- print FILE $text;
- close FILE;
+ return 1;
+}
- ok( -e $file, "$file created" );
+sub teardown_recurs {
+ foreach my $file (keys %Files) {
+ my $dir = dirname($file);
+ if( -e $dir ) {
+ rmtree($dir) || return;
+ }
+ }
+ return 1;
}
-pass("Setup done");
+1;
diff --git a/t/lib/MakeMaker/Test/Setup/Problem.pm b/t/lib/MakeMaker/Test/Setup/Problem.pm
new file mode 100644
index 0000000000..4cb14b59ac
--- /dev/null
+++ b/t/lib/MakeMaker/Test/Setup/Problem.pm
@@ -0,0 +1,56 @@
+package MakeMaker::Test::Setup::Problem;
+
+@ISA = qw(Exporter);
+require Exporter;
+@EXPORT = qw(setup_recurs teardown_recurs);
+
+use strict;
+use File::Path;
+use File::Basename;
+
+my %Files = (
+ 'Problem-Module/Makefile.PL' => <<'END',
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+ NAME => 'Problem::Module',
+);
+END
+
+ 'Problem-Module/subdir/Makefile.PL' => <<'END',
+printf "\@INC %s .\n", (grep { $_ eq '.' } @INC) ? "has" : "doesn't have";
+
+warn "I think I'm going to be sick\n";
+die "YYYAaaaakkk\n";
+END
+
+);
+
+
+sub setup_recurs {
+ while(my($file, $text) = each %Files) {
+ # Convert to a relative, native file path.
+ $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file);
+
+ my $dir = dirname($file);
+ mkpath $dir;
+ open(FILE, ">$file") || die "Can't create $file: $!";
+ print FILE $text;
+ close FILE;
+ }
+
+ return 1;
+}
+
+sub teardown_recurs {
+ foreach my $file (keys %Files) {
+ my $dir = dirname($file);
+ if( -e $dir ) {
+ rmtree($dir) || return;
+ }
+ }
+ return 1;
+}
+
+
+1;
diff --git a/t/lib/MakeMaker/Test/Setup/Recurs.pm b/t/lib/MakeMaker/Test/Setup/Recurs.pm
index affd870c20..805be94db3 100644
--- a/t/lib/MakeMaker/Test/Setup/Recurs.pm
+++ b/t/lib/MakeMaker/Test/Setup/Recurs.pm
@@ -52,3 +52,6 @@ sub teardown_recurs {
}
return 1;
}
+
+
+1;