From: Michael G. Schwern Date: Mon, 21 Jul 2003 20:12:25 +0000 (-0700) Subject: ExtUtils::MakeMaker 6.10_08 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5e719f034d6be5248225b2711ae2a1df6aeff23b;p=p5sagit%2Fp5-mst-13.2.git ExtUtils::MakeMaker 6.10_08 Message-ID: <20030722031224.GD12711@windhund.schwern.org> p4raw-id: //depot/perl@20207 --- diff --git a/MANIFEST b/MANIFEST index 6b8f765..5318778 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1144,6 +1144,7 @@ lib/ExtUtils/t/Packlist.t See if Packlist works lib/ExtUtils/t/prefixify.t See if MakeMaker can apply a PREFIX lib/ExtUtils/t/problems.t How MakeMaker reacts to build problems lib/ExtUtils/t/prompt.t See if E::MM::prompt() works +lib/ExtUtils/t/recurs.t See if recursive builds work lib/ExtUtils/t/split_command.t See if MM's xargs-like function works lib/ExtUtils/t/testlib.t See if ExtUtils::testlib works lib/ExtUtils/t/VERSION_FROM.t See if MakeMaker's VERSION_FROM works diff --git a/lib/ExtUtils/META.yml b/lib/ExtUtils/META.yml index 2a36201..d2d083c 100644 --- a/lib/ExtUtils/META.yml +++ b/lib/ExtUtils/META.yml @@ -1,6 +1,6 @@ #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: ExtUtils-MakeMaker -version: 6.10_07 +version: 6.10_08 version_from: lib/ExtUtils/MakeMaker.pm installdirs: perl requires: @@ -10,4 +10,4 @@ requires: Pod::Man: 0 distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.10_07 +generated_by: ExtUtils::MakeMaker version 6.10_08 diff --git a/lib/ExtUtils/MM_Any.pm b/lib/ExtUtils/MM_Any.pm index 6a31d55..13e1daa 100644 --- a/lib/ExtUtils/MM_Any.pm +++ b/lib/ExtUtils/MM_Any.pm @@ -44,6 +44,25 @@ always be cross-platform. =over 4 +=item installvars + + my @installvars = $mm->installvars; + +A list of all the INSTALL* variables without the INSTALL prefix. Useful +for iteration or building related variable sets. + +=cut + +sub installvars { + return qw(PRIVLIB SITELIB VENDORLIB + ARCHLIB SITEARCH VENDORARCH + BIN SITEBIN VENDORBIN + SCRIPT + MAN1DIR SITEMAN1DIR VENDORMAN1DIR + MAN3DIR SITEMAN3DIR VENDORMAN3DIR + ); +} + =item os_flavor_is $mm->os_flavor_is($this_flavor); diff --git a/lib/ExtUtils/MM_MacOS.pm b/lib/ExtUtils/MM_MacOS.pm index 5657d3b..30520ec 100644 --- a/lib/ExtUtils/MM_MacOS.pm +++ b/lib/ExtUtils/MM_MacOS.pm @@ -12,7 +12,7 @@ require ExtUtils::MM_Unix; @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix ); use vars qw($VERSION); -$VERSION = '1.05'; +$VERSION = '1.06'; use Config; use Cwd 'cwd'; @@ -537,6 +537,7 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc) next if ($name =~ /^\./ or $ignore{$name}); next unless $self->libscan($name); if (-d $name){ + next if $self->{NORECURS}; $dir{$name} = $name if (-f ":$name:Makefile.PL"); } elsif ($name =~ /\.xs$/){ my($c); ($c = $name) =~ s/\.xs$/.c/; diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index a25c9f9..51c54cf 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -20,7 +20,7 @@ use vars qw($VERSION @ISA use ExtUtils::MakeMaker qw($Verbose neatvalue); -$VERSION = '1.37'; +$VERSION = '1.38'; require ExtUtils::MM_Any; @ISA = qw(ExtUtils::MM_Any); @@ -432,19 +432,23 @@ sub constants { my($self) = @_; my @m = (); - for my $macro (qw/ + for my $macro (qw( AR_STATIC_ARGS DIRFILESEP NAME NAME_SYM VERSION VERSION_MACRO VERSION_SYM DEFINE_VERSION XS_VERSION XS_VERSION_MACRO XS_DEFINE_VERSION INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB + INST_MAN1DIR INST_MAN3DIR + MAN1EXT MAN3EXT INSTALLDIRS DESTDIR PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX - INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB - INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH - INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN INSTALLSCRIPT + ), + (map { ("INSTALL".$_, + "DESTINSTALL".$_) + } $self->installvars), + qw( PERL_LIB PERL_ARCHLIB LIBPERL_A MYEXTLIB @@ -456,7 +460,7 @@ sub constants { PERL_CORE PERM_RW PERM_RWX - / ) + ) ) { next unless defined $self->{$macro}; @@ -498,17 +502,6 @@ MAN1PODS = ".$self->wraplist(sort keys %{$self->{MAN1PODS}})." MAN3PODS = ".$self->wraplist(sort keys %{$self->{MAN3PODS}})." "; - for my $macro (qw/ - INST_MAN1DIR MAN1EXT - INSTALLMAN1DIR INSTALLSITEMAN1DIR INSTALLVENDORMAN1DIR - INST_MAN3DIR MAN3EXT - INSTALLMAN3DIR INSTALLSITEMAN3DIR INSTALLVENDORMAN3DIR - /) - { - next unless defined $self->{$macro}; - push @m, "$macro = $self->{$macro}\n"; - } - push @m, q{ # Where is the Config information that we are using/depend on @@ -608,6 +601,28 @@ $targ :: $src join "", @m; } +=item init_DEST + + $mm->init_DEST + +Defines the DESTDIR and DEST* variables paralleling the INSTALL*. + +=cut + +sub init_DEST { + my $self = shift; + + # Initialize DESTDIR + $self->{DESTDIR} ||= ''; + + # Make DEST variables. + foreach my $var ($self->installvars) { + my $destvar = 'DESTINSTALL'.$var; + $self->{$destvar} ||= '$(DESTDIR)$(INSTALL'.$var.')'; + } +} + + =item init_dist $mm->init_dist; @@ -1434,6 +1449,7 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc) next unless $self->libscan($name); if (-d $name){ next if -l $name; # We do not support symlinks at all + next if $self->{NORECURS}; $dir{$name} = $name if (-f $self->catfile($name,"Makefile.PL")); } elsif ($name =~ /\.xs\z/){ my($c); ($c = $name) =~ s/\.xs\z/.c/; @@ -2030,15 +2046,15 @@ sub init_INSTALL { $self->init_lib2arch; - if( $Config{usevendorprefix} ) { - $Config_Override{installvendorman1dir} = - $self->catdir($Config{vendorprefixexp}, 'man', 'man1'); - $Config_Override{installvendorman3dir} = - $self->catdir($Config{vendorprefixexp}, 'man', 'man3'); - } - else { - $Config_Override{installvendorman1dir} = ''; - $Config_Override{installvendorman3dir} = ''; + # Initialize installvendorman*dir if necessary + 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") : + ''; + } } my $iprefix = $Config{installprefixexp} || $Config{installprefix} || @@ -2078,12 +2094,6 @@ sub init_INSTALL { $self->{VENDORPREFIX} ||= $vprefix; } - # Add DESTDIR. - $self->{DESTDIR} ||= ''; - foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) { - $self->{$prefix} = '$(DESTDIR)'.$self->{$prefix}; - } - my $arch = $Config{archname}; my $version = $Config{version}; @@ -2481,13 +2491,13 @@ doc__install : doc_site_install pure_perl_install :: $(NOECHO) $(MOD_INSTALL) \ read }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \ - write }.$self->catfile('$(INSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \ - $(INST_LIB) $(INSTALLPRIVLIB) \ - $(INST_ARCHLIB) $(INSTALLARCHLIB) \ - $(INST_BIN) $(INSTALLBIN) \ - $(INST_SCRIPT) $(INSTALLSCRIPT) \ - $(INST_MAN1DIR) $(INSTALLMAN1DIR) \ - $(INST_MAN3DIR) $(INSTALLMAN3DIR) + write }.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \ + $(INST_LIB) $(DESTINSTALLPRIVLIB) \ + $(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \ + $(INST_BIN) $(DESTINSTALLBIN) \ + $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLMAN3DIR) $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ }.$self->catdir('$(SITEARCHEXP)','auto','$(FULLEXT)').q{ @@ -2495,59 +2505,59 @@ pure_perl_install :: pure_site_install :: $(NOECHO) $(MOD_INSTALL) \ read }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \ - write }.$self->catfile('$(INSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{ \ - $(INST_LIB) $(INSTALLSITELIB) \ - $(INST_ARCHLIB) $(INSTALLSITEARCH) \ - $(INST_BIN) $(INSTALLSITEBIN) \ - $(INST_SCRIPT) $(INSTALLSCRIPT) \ - $(INST_MAN1DIR) $(INSTALLSITEMAN1DIR) \ - $(INST_MAN3DIR) $(INSTALLSITEMAN3DIR) + write }.$self->catfile('$(DESTINSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{ \ + $(INST_LIB) $(DESTINSTALLSITELIB) \ + $(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \ + $(INST_BIN) $(DESTINSTALLSITEBIN) \ + $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR) $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ }.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{ pure_vendor_install :: $(NOECHO) $(MOD_INSTALL) \ read }.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \ - write }.$self->catfile('$(INSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{ \ - $(INST_LIB) $(INSTALLVENDORLIB) \ - $(INST_ARCHLIB) $(INSTALLVENDORARCH) \ - $(INST_BIN) $(INSTALLVENDORBIN) \ - $(INST_SCRIPT) $(INSTALLSCRIPT) \ - $(INST_MAN1DIR) $(INSTALLVENDORMAN1DIR) \ - $(INST_MAN3DIR) $(INSTALLVENDORMAN3DIR) + write }.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{ \ + $(INST_LIB) $(DESTINSTALLVENDORLIB) \ + $(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \ + $(INST_BIN) $(DESTINSTALLVENDORBIN) \ + $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) doc_perl_install :: - $(NOECHO) $(ECHO) Appending installation info to $(INSTALLARCHLIB)/perllocal.pod - -$(NOECHO) $(MKPATH) $(INSTALLARCHLIB) + $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod + -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLPRIVLIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ - >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{ + >> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{ doc_site_install :: - $(NOECHO) $(ECHO) Appending installation info to $(INSTALLARCHLIB)/perllocal.pod - -$(NOECHO) $(MKPATH) $(INSTALLARCHLIB) + $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod + -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLSITELIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ - >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{ + >> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{ doc_vendor_install :: - $(NOECHO) $(ECHO) Appending installation info to $(INSTALLARCHLIB)/perllocal.pod - -$(NOECHO) $(MKPATH) $(INSTALLARCHLIB) + $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod + -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLVENDORLIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ - >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{ + >> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{ }; @@ -2888,14 +2898,14 @@ $tmp/perlmain.c: $makefilename}, q{ push @m, q{ doc_inst_perl: - $(NOECHO) $(ECHO) Appending installation info to $(INSTALLARCHLIB)/perllocal.pod - -$(NOECHO) $(MKPATH) $(INSTALLARCHLIB) + $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod + -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ "Perl binary" "$(MAP_TARGET)" \ MAP_STATIC "$(MAP_STATIC)" \ MAP_EXTRA "`cat $(INST_ARCHAUTODIR)/extralibs.all`" \ MAP_LIBPERL "$(MAP_LIBPERL)" \ - >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{ + >> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{ }; @@ -2903,7 +2913,7 @@ doc_inst_perl: inst_perl: pure_inst_perl doc_inst_perl pure_inst_perl: $(MAP_TARGET) - }.$self->{CP}.q{ $(MAP_TARGET) }.$self->catfile('$(INSTALLBIN)','$(MAP_TARGET)').q{ + }.$self->{CP}.q{ $(MAP_TARGET) }.$self->catfile('$(DESTINSTALLBIN)','$(MAP_TARGET)').q{ clean :: map_clean diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index bfdb2a4..02c4669 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -21,7 +21,7 @@ BEGIN { use File::Basename; use vars qw($Revision @ISA $VERSION); ($VERSION) = '5.68'; -($Revision) = q$Revision: 1.101 $ =~ /Revision:\s+(\S+)/; +($Revision) = q$Revision: 1.104 $ =~ /Revision:\s+(\S+)/; require ExtUtils::MM_Any; require ExtUtils::MM_Unix; @@ -302,6 +302,26 @@ sub replace_manpage_separator { $man; } +=item init_DEST + +(override) Because of the difficulty concatenating VMS filepaths we +must pre-expand the DEST* variables. + +=cut + +sub init_DEST { + my $self = shift; + + $self->SUPER::init_DEST; + + # Expand DEST variables. + foreach my $var ($self->installvars) { + my $destvar = 'DESTINSTALL'.$var; + $self->{$destvar} = File::Spec->eliminate_macros($self->{$destvar}); + } +} + + =item init_DIRFILESEP No seperator between a directory path and a filename on VMS. @@ -487,13 +507,10 @@ sub constants { # Cleanup paths for directories in MMS macros. foreach my $macro ( qw [ INST_BIN INST_SCRIPT INST_LIB INST_ARCHLIB - INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB - INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH - INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN INSTALLSCRIPT - INSTALLMAN1DIR INSTALLSITEMAN1DIR INSTALLVENDORMAN1DIR - INSTALLMAN3DIR INSTALLSITEMAN3DIR INSTALLVENDORMAN3DIR PERL_LIB PERL_ARCHLIB - PERL_INC PERL_SRC ] ) + PERL_INC PERL_SRC ], + (map { 'INSTALL'.$_ } $self->installvars) + ) { next unless defined $self->{$macro}; next if $macro =~ /MAN/ && $self->{$macro} eq 'none'; @@ -1531,13 +1548,13 @@ doc__install : doc_site_install # This hack brought to you by DCL's 255-character command line limit pure_perl_install :: $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'read '.File::Spec->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').' '" >.MM_tmp - $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'write '.File::Spec->catfile('$(INSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').' '" >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_LIB) $(INSTALLPRIVLIB) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_ARCHLIB) $(INSTALLARCHLIB) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_BIN) $(INSTALLBIN) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_SCRIPT) $(INSTALLSCRIPT) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR) $(INSTALLMAN1DIR) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR) $(INSTALLMAN3DIR) " >>.MM_tmp + $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'write '.File::Spec->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').' '" >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_LIB) $(DESTINSTALLPRIVLIB) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_ARCHLIB) $(DESTINSTALLARCHLIB) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_BIN) $(DESTINSTALLBIN) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_SCRIPT) $(DESTINSTALLSCRIPT) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR) $(DESTINSTALLMAN3DIR) " >>.MM_tmp $(NOECHO) $(MOD_INSTALL) <.MM_tmp $(NOECHO) $(RM_F) .MM_tmp $(NOECHO) $(WARN_IF_OLD_PACKLIST) ].$self->catfile($self->{SITEARCHEXP},'auto',$self->{FULLEXT},'.packlist').q[ @@ -1545,56 +1562,56 @@ pure_perl_install :: # Likewise pure_site_install :: $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'read '.File::Spec->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').' '" >.MM_tmp - $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'write '.File::Spec->catfile('$(INSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').' '" >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_LIB) $(INSTALLSITELIB) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_ARCHLIB) $(INSTALLSITEARCH) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_BIN) $(INSTALLSITEBIN) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_SCRIPT) $(INSTALLSCRIPT) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR) $(INSTALLSITEMAN1DIR) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR) $(INSTALLSITEMAN3DIR) " >>.MM_tmp + $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'write '.File::Spec->catfile('$(DESTINSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').' '" >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_LIB) $(DESTINSTALLSITELIB) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_ARCHLIB) $(DESTINSTALLSITEARCH) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_BIN) $(DESTINSTALLSITEBIN) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_SCRIPT) $(DESTINSTALLSCRIPT) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR) " >>.MM_tmp $(NOECHO) $(MOD_INSTALL) <.MM_tmp $(NOECHO) $(RM_F) .MM_tmp $(NOECHO) $(WARN_IF_OLD_PACKLIST) ].$self->catfile($self->{PERL_ARCHLIB},'auto',$self->{FULLEXT},'.packlist').q[ pure_vendor_install :: $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'read '.File::Spec->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').' '" >.MM_tmp - $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'write '.File::Spec->catfile('$(INSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').' '" >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_LIB) $(INSTALLVENDORLIB) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_ARCHLIB) $(INSTALLVENDORARCH) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_BIN) $(INSTALLVENDORBIN) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_SCRIPT) $(INSTALLSCRIPT) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR) $(INSTALLVENDORMAN1DIR) " >>.MM_tmp - $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR) $(INSTALLVENDORMAN3DIR) " >>.MM_tmp + $(NOECHO) $(PERLRUN) "-MFile::Spec" -e "print 'write '.File::Spec->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').' '" >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_LIB) $(DESTINSTALLVENDORLIB) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_BIN) $(DESTINSTALLVENDORBIN) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_SCRIPT) $(DESTINSTALLSCRIPT) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) " >>.MM_tmp + $(NOECHO) $(ECHO_N) "$(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) " >>.MM_tmp $(NOECHO) $(MOD_INSTALL) <.MM_tmp $(NOECHO) $(RM_F) .MM_tmp # Ditto doc_perl_install :: - $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{INSTALLARCHLIB}, 'perllocal.pod').q[" - $(NOECHO) $(MKPATH) $(INSTALLARCHLIB) + $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q[" + $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) $(NOECHO) $(ECHO_N) "installed into|$(INSTALLPRIVLIB)|" >.MM_tmp $(NOECHO) $(ECHO_N) "LINKTYPE|$(LINKTYPE)|VERSION|$(VERSION)|EXE_FILES|$(EXE_FILES) " >>.MM_tmp ],@exe_files, -q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{INSTALLARCHLIB},'perllocal.pod').q[ +q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[ $(NOECHO) $(RM_F) .MM_tmp # And again doc_site_install :: - $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{INSTALLARCHLIB}, 'perllocal.pod').q[" - $(NOECHO) $(MKPATH) $(INSTALLARCHLIB) + $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q[" + $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) $(NOECHO) $(ECHO_N) "installed into|$(INSTALLSITELIB)|" >.MM_tmp $(NOECHO) $(ECHO_N) "LINKTYPE|$(LINKTYPE)|VERSION|$(VERSION)|EXE_FILES|$(EXE_FILES) " >>.MM_tmp ],@exe_files, -q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{INSTALLARCHLIB},'perllocal.pod').q[ +q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[ $(NOECHO) $(RM_F) .MM_tmp doc_vendor_install :: - $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{INSTALLARCHLIB}, 'perllocal.pod').q[" - $(NOECHO) $(MKPATH) $(INSTALLARCHLIB) + $(NOECHO) $(ECHO) "Appending installation info to ].$self->catfile($self->{DESTINSTALLARCHLIB}, 'perllocal.pod').q[" + $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) $(NOECHO) $(ECHO_N) "installed into|$(INSTALLVENDORLIB)|" >.MM_tmp $(NOECHO) $(ECHO_N) "LINKTYPE|$(LINKTYPE)|VERSION|$(VERSION)|EXE_FILES|$(EXE_FILES) " >>.MM_tmp ],@exe_files, -q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{INSTALLARCHLIB},'perllocal.pod').q[ +q[ $(NOECHO) $(DOC_INSTALL) "Module" "$(NAME)" <.MM_tmp >>].$self->catfile($self->{DESTINSTALLARCHLIB},'perllocal.pod').q[ $(NOECHO) $(RM_F) .MM_tmp ]; @@ -2013,12 +2030,12 @@ MAKE_FRAG push @m, q[ # Still more from the 255-char line length limit doc_inst_perl : - $(NOECHO) $(MKPATH) $(INSTALLARCHLIB) + $(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) $(NOECHO) $(ECHO) "Perl binary $(MAP_TARGET)|" >.MM_tmp $(NOECHO) $(ECHO) "MAP_STATIC|$(MAP_STATIC)|" >>.MM_tmp $(NOECHO) $(PERL) -pl040 -e " " ].$self->catfile('$(INST_ARCHAUTODIR)','extralibs.all'),q[ >>.MM_tmp $(NOECHO) $(ECHO) -e "MAP_LIBPERL|$(MAP_LIBPERL)|" >>.MM_tmp - $(NOECHO) $(DOC_INSTALL) <.MM_tmp >>].$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q[ + $(NOECHO) $(DOC_INSTALL) <.MM_tmp >>].$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q[ $(NOECHO) $(RM_F) .MM_tmp ]; @@ -2081,13 +2098,15 @@ sub prefixify { # Translate $(PERLPREFIX) to a real path. $rprefix = $self->eliminate_macros($rprefix); $rprefix = VMS::Filespec::vmspath($rprefix) if $rprefix; + $sprefix = VMS::Filespec::vmspath($sprefix) if $sprefix; $default = VMS::Filespec::vmsify($default) unless $default =~ /\[.*\]/; (my $var_no_install = $var) =~ s/^install//; - my $path = $self->{uc $var} || $Config{lc $var} || - $Config{lc $var_no_install}; + my $path = $self->{uc $var} || + $ExtUtils::MM_Unix::Config_Override{lc $var} || + $Config{lc $var} || $Config{lc $var_no_install}; if( !$path ) { print STDERR " no Config found for $var.\n" if $Verbose >= 2; diff --git a/lib/ExtUtils/MakeMaker/FAQ.pod b/lib/ExtUtils/MakeMaker/FAQ.pod index b2a50d4..16a64e0 100644 --- a/lib/ExtUtils/MakeMaker/FAQ.pod +++ b/lib/ExtUtils/MakeMaker/FAQ.pod @@ -1,6 +1,6 @@ package ExtUtils::MakeMaker::FAQ; -(our $VERSION) = sprintf "%03d", q$Revision: 1.8 $ =~ /Revision:\s+(\S+)/; +(our $VERSION) = sprintf "%03d", q$Revision: 1.9 $ =~ /Revision:\s+(\S+)/; 1; __END__ @@ -75,7 +75,7 @@ system's revision number (you are using version control, right?). In CVS and RCS you use $Z<>Revision$ writing it like so: - $VERSION = sprintf "%d.%03d", q$Revision: 1.8 $ =~ /(\d+)/g; + $VERSION = sprintf "%d.%03d", q$Revision: 1.9 $ =~ /(\d+)/g; Every time the file is checked in the $Z<>Revision$ will be updated, updating your $VERSION. @@ -88,7 +88,7 @@ If branches are involved (ie. $Z<>Revision: 1.5.3.4) its a little more complicated. # must be all on one line or MakeMaker will get confused. - $VERSION = do { my @r = (q$Revision: 1.5.3.4 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; + $VERSION = do { my @r = (q$Revision: 1.9 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; =item What's this F thing and how did it get in my F?! diff --git a/lib/ExtUtils/PATCHING b/lib/ExtUtils/PATCHING index fec5c42..9c3da45 100644 --- a/lib/ExtUtils/PATCHING +++ b/lib/ExtUtils/PATCHING @@ -32,6 +32,10 @@ Reporting bugs deliberately. Even if it was done deliberately, we still want to hear if it caused problems. +- If you're testing MakeMaker against a development version of Perl, + please also check it against the latest stable version. This makes it + easier to figure out if its MakeMaker or Perl at fault. + Patching details diff --git a/lib/ExtUtils/t/Command.t b/lib/ExtUtils/t/Command.t index 7f1a97c..bf7d177 100644 --- a/lib/ExtUtils/t/Command.t +++ b/lib/ExtUtils/t/Command.t @@ -12,14 +12,18 @@ BEGIN { chdir 't'; BEGIN { - 1 while unlink 'ecmdfile', 'newfile'; + $Testfile = 'testfile.foo'; +} + +BEGIN { + 1 while unlink $Testfile, 'newfile'; # forcibly remove ecmddir/temp2, but don't import mkpath use File::Path (); File::Path::rmtree( 'ecmddir' ); } BEGIN { - use Test::More tests => 27; + use Test::More tests => 26; use File::Spec; } @@ -31,35 +35,6 @@ BEGIN { } { - # get a file in the current directory, replace last char with wildcard - my $file; - { - local *DIR; - opendir(DIR, File::Spec->curdir()); - while ($file = readdir(DIR)) { - $file =~ s/\.\z// if $^O eq 'VMS'; - last if $file =~ /^\w/; - } - closedir DIR; - } - - - # % means 'match one character' on VMS. Everything else is ? - my $match_char = $^O eq 'VMS' ? '%' : '?'; - ($ARGV[0] = $file) =~ s/.\z/$match_char/; - - # this should find the file - ExtUtils::Command::expand_wildcards(); - - is( scalar @ARGV, 1, 'found one file' ); - like( $ARGV[0], qr/$file/, 'expanded wildcard ? successfully' ); - - # try it with the asterisk now - ($ARGV[0] = $file) =~ s/.{3}\z/\*/; - ExtUtils::Command::expand_wildcards(); - - ok( (grep { qr/$file/ } @ARGV), 'expanded wildcard * successfully' ); - # concatenate this file with itself # be extra careful the regex doesn't match itself use TieOut; @@ -79,20 +54,20 @@ BEGIN { 'concatenation worked' ); # the truth value here is reversed -- Perl true is C false - @ARGV = ( 'ecmdfile' ); + @ARGV = ( $Testfile ); ok( test_f(), 'testing non-existent file' ); - @ARGV = ( 'ecmdfile' ); - cmp_ok( ! test_f(), '==', (-f 'ecmdfile'), 'testing non-existent file' ); + @ARGV = ( $Testfile ); + cmp_ok( ! test_f(), '==', (-f $Testfile), 'testing non-existent file' ); # these are destructive, have to keep setting @ARGV - @ARGV = ( 'ecmdfile' ); + @ARGV = ( $Testfile ); touch(); - @ARGV = ( 'ecmdfile' ); + @ARGV = ( $Testfile ); ok( test_f(), 'now creating that file' ); - @ARGV = ( 'ecmdfile' ); + @ARGV = ( $Testfile ); ok( -e $ARGV[0], 'created!' ); my ($now) = time; @@ -112,20 +87,20 @@ BEGIN { my $new_stamp = (stat('newfile'))[9]; cmp_ok( abs($new_stamp - $stamp), '>=', 2, 'newer file created' ); - @ARGV = qw(newfile ecmdfile); + @ARGV = ('newfile', $Testfile); eqtime(); - $stamp = (stat('ecmdfile'))[9]; + $stamp = (stat($Testfile))[9]; cmp_ok( abs($new_stamp - $stamp), '<=', 1, 'eqtime' ); # eqtime use to clear the contents of the file being equalized! - open(FILE, '>>ecmdfile') || die $!; + open(FILE, ">>$Testfile") || die $!; print FILE "Foo"; close FILE; - @ARGV = qw(newfile ecmdfile); + @ARGV = ('newfile', $Testfile); eqtime(); - ok( -s 'ecmdfile', "eqtime doesn't clear the file being equalized" ); + ok( -s $Testfile, "eqtime doesn't clear the file being equalized" ); SKIP: { if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' || @@ -136,32 +111,32 @@ BEGIN { } # change a file to execute-only - @ARGV = ( '0100', 'ecmdfile' ); + @ARGV = ( '0100', $Testfile ); ExtUtils::Command::chmod(); - is( ((stat('ecmdfile'))[2] & 07777) & 0700, + is( ((stat($Testfile))[2] & 07777) & 0700, 0100, 'change a file to execute-only' ); # change a file to read-only - @ARGV = ( '0400', 'ecmdfile' ); + @ARGV = ( '0400', $Testfile ); ExtUtils::Command::chmod(); - is( ((stat('ecmdfile'))[2] & 07777) & 0700, + is( ((stat($Testfile))[2] & 07777) & 0700, ($^O eq 'vos' ? 0500 : 0400), 'change a file to read-only' ); # change a file to write-only - @ARGV = ( '0200', 'ecmdfile' ); + @ARGV = ( '0200', $Testfile ); ExtUtils::Command::chmod(); - is( ((stat('ecmdfile'))[2] & 07777) & 0700, + is( ((stat($Testfile))[2] & 07777) & 0700, ($^O eq 'vos' ? 0700 : 0200), 'change a file to write-only' ); } # change a file to read-write - @ARGV = ( '0600', 'ecmdfile' ); + @ARGV = ( '0600', $Testfile ); ExtUtils::Command::chmod(); - is( ((stat('ecmdfile'))[2] & 07777) & 0700, + is( ((stat($Testfile))[2] & 07777) & 0700, ($^O eq 'vos' ? 0700 : 0600), 'change a file to read-write' ); # mkpath @@ -172,33 +147,57 @@ BEGIN { ok( -e $ARGV[0], 'temp directory created' ); # copy a file to a nested subdirectory - unshift @ARGV, 'ecmdfile'; + unshift @ARGV, $Testfile; cp(); - ok( -e File::Spec->join( 'ecmddir', 'temp2', 'ecmdfile' ), 'copied okay' ); + ok( -e File::Spec->join( 'ecmddir', 'temp2', $Testfile ), 'copied okay' ); # cp should croak if destination isn't directory (not a great warning) - @ARGV = ( 'ecmdfile' ) x 3; + @ARGV = ( $Testfile ) x 3; eval { cp() }; like( $@, qr/Too many arguments/, 'cp croaks on error' ); # move a file to a subdirectory - @ARGV = ( 'ecmdfile', 'ecmddir' ); + @ARGV = ( $Testfile, 'ecmddir' ); mv(); - ok( ! -e 'ecmdfile', 'moved file away' ); - ok( -e File::Spec->join( 'ecmddir', 'ecmdfile' ), 'file in new location' ); + ok( ! -e $Testfile, 'moved file away' ); + ok( -e File::Spec->join( 'ecmddir', $Testfile ), 'file in new location' ); # mv should also croak with the same wacky warning - @ARGV = ( 'ecmdfile' ) x 3; + @ARGV = ( $Testfile ) x 3; eval { mv() }; like( $@, qr/Too many arguments/, 'mv croaks on error' ); + # Test expand_wildcards() + { + my $file = $Testfile; + @ARGV = (); + chdir 'ecmddir'; + + # % means 'match one character' on VMS. Everything else is ? + my $match_char = $^O eq 'VMS' ? '%' : '?'; + ($ARGV[0] = $file) =~ s/.\z/$match_char/; + + # this should find the file + ExtUtils::Command::expand_wildcards(); + + is_deeply( \@ARGV, [$file], 'expanded wildcard ? successfully' ); + + # try it with the asterisk now + ($ARGV[0] = $file) =~ s/.{3}\z/\*/; + ExtUtils::Command::expand_wildcards(); + + is_deeply( \@ARGV, [$file], 'expanded wildcard * successfully' ); + + chdir File::Spec->updir; + } + # remove some files - my @files = @ARGV = ( File::Spec->catfile( 'ecmddir', 'ecmdfile' ), - File::Spec->catfile( 'ecmddir', 'temp2', 'ecmdfile' ) ); + my @files = @ARGV = ( File::Spec->catfile( 'ecmddir', $Testfile ), + File::Spec->catfile( 'ecmddir', 'temp2', $Testfile ) ); rm_f(); ok( ! -e $_, "removed $_ successfully" ) for (@ARGV); @@ -210,6 +209,6 @@ BEGIN { } END { - 1 while unlink 'ecmdfile', 'newfile'; + 1 while unlink $Testfile, 'newfile'; File::Path::rmtree( 'ecmddir' ); } diff --git a/lib/ExtUtils/t/INST.t b/lib/ExtUtils/t/INST.t index 5c4aaeb..3639acd 100644 --- a/lib/ExtUtils/t/INST.t +++ b/lib/ExtUtils/t/INST.t @@ -60,7 +60,7 @@ is( $mm->{VERSION}, 0.01, 'VERSION' ); my $config_prefix = $Config{installprefixexp} || $Config{installprefix} || $Config{prefixexp} || $Config{prefix}; -is( $mm->{PERLPREFIX}, '$(DESTDIR)'.$config_prefix, 'PERLPREFIX' ); +is( $mm->{PERLPREFIX}, $config_prefix, 'PERLPREFIX' ); is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' ); diff --git a/lib/ExtUtils/t/INST_PREFIX.t b/lib/ExtUtils/t/INST_PREFIX.t index 99c1ae0..2d90a8c 100644 --- a/lib/ExtUtils/t/INST_PREFIX.t +++ b/lib/ExtUtils/t/INST_PREFIX.t @@ -16,7 +16,7 @@ BEGIN { } use strict; -use Test::More tests => 38; +use Test::More tests => 36; use MakeMaker::Test::Utils; use ExtUtils::MakeMaker; use File::Spec; @@ -62,8 +62,6 @@ is( $mm->{VERSION}, 0.01, 'VERSION' ); foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) { unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ ); - like( $mm->{$prefix}, qr/^\$\(DESTDIR\)/, - "\$(DESTDIR) prepended to $prefix" ); } @@ -85,11 +83,10 @@ like( $stdout->read, qr{ undef $stdout; untie *STDOUT; -is( $mm->{PREFIX}, '$(DESTDIR)'.$PREFIX, 'PREFIX' ); +is( $mm->{PREFIX}, $PREFIX, 'PREFIX' ); foreach my $prefix (qw(PERLPREFIX SITEPREFIX VENDORPREFIX)) { - is( $mm->{$prefix}, '$(DESTDIR)$(PREFIX)', - "\$(PREFIX) overrides $prefix" ); + is( $mm->{$prefix}, '$(PREFIX)', "\$(PREFIX) overrides $prefix" ); } is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' ); @@ -134,7 +131,10 @@ while( my($type, $vars) = each %Install_Vars) { # are generated. { undef *ExtUtils::MM_Unix::Config; + undef *ExtUtils::MM_Unix::Config_Override; %ExtUtils::MM_Unix::Config = %Config; + *ExtUtils::MM_VMS::Config = \%ExtUtils::MM_Unix::Config; + $ExtUtils::MM_Unix::Config{installman1dir} = ''; $ExtUtils::MM_Unix::Config{installman3dir} = ''; @@ -152,3 +152,37 @@ while( my($type, $vars) = each %Install_Vars) { is( $mm->{INSTALLMAN1DIR}, $wibble ); is( $mm->{INSTALLMAN3DIR}, 'none' ); } + +# Check that when installvendorman*dir is set in Config it is honored +# [rt.cpan.org 2949] +{ + undef *ExtUtils::MM_Unix::Config; + undef *ExtUtils::MM_Unix::Config_Override; + undef *ExtUtils::MM_VMS::Config; + + %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'; + + my $stdout = tie *STDOUT, 'TieOut' or die; + my $mm = WriteMakefile( + NAME => 'Big::Dummy', + VERSION_FROM => 'lib/Big/Dummy.pm', + PREREQ_PM => {}, + PERL_CORE => $ENV{PERL_CORE}, + + # In case the local installation doesn't have man pages. + INSTALLMAN1DIR=> 'foo/bar/baz', + INSTALLMAN3DIR=> 'foo/bar/baz', + ); + + is( $mm->{INSTALLVENDORMAN1DIR}, File::Spec->catdir('foo','bar'), + 'installvendorman1dir (in %Config) not modified' ); + isnt( $mm->{INSTALLVENDORMAN3DIR}, '', + 'installvendorman3dir (not in %Config) set' ); +} diff --git a/lib/ExtUtils/t/basic.t b/lib/ExtUtils/t/basic.t index f11b551..de38271 100644 --- a/lib/ExtUtils/t/basic.t +++ b/lib/ExtUtils/t/basic.t @@ -16,10 +16,11 @@ BEGIN { use strict; use Config; -use Test::More tests => 54; +use Test::More tests => 73; use MakeMaker::Test::Utils; use File::Find; use File::Spec; +use File::Path; # 'make disttest' sets a bunch of environment variables which interfere # with our testing. @@ -37,7 +38,7 @@ my $Touch_Time = calibrate_mtime(); $| = 1; -ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) || +ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) || diag("chdir failed: $!"); my @mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"}); @@ -132,7 +133,7 @@ ok( $files{'perllocal.pod'},' perllocal.pod created' ); SKIP: { - skip "VMS install targets do not preserve PREFIX", 8 if $Is_VMS; + skip "VMS install targets do not preserve $(PREFIX)", 8 if $Is_VMS; $install_out = run("$make install PREFIX=elsewhere"); is( $?, 0, 'install with PREFIX override' ) || diag $install_out; @@ -146,6 +147,68 @@ SKIP: { ok( $files{'Liar.pm'}, ' Liar.pm installed' ); ok( $files{'.packlist'}, ' packlist created' ); ok( $files{'perllocal.pod'},' perllocal.pod created' ); + rmtree('elsewhere'); +} + + +SKIP: { + skip "VMS install targets do not preserve $(DESTDIR)", 10 if $Is_VMS; + + $install_out = run("$make install PREFIX= DESTDIR=other"); + is( $?, 0, 'install with DESTDIR' ) || + diag $install_out; + like( $install_out, qr/^Installing /m ); + like( $install_out, qr/^Writing /m ); + + ok( -d 'other', ' destdir created' ); + %files = (); + my $perllocal; + find( sub { + $files{$_} = $File::Find::name; + }, 'other' ); + ok( $files{'Dummy.pm'}, ' Dummy.pm installed' ); + ok( $files{'Liar.pm'}, ' Liar.pm installed' ); + ok( $files{'.packlist'}, ' packlist created' ); + ok( $files{'perllocal.pod'},' perllocal.pod created' ); + + ok( open(PERLLOCAL, $files{'perllocal.pod'} ) ) || + diag("Can't open $files{'perllocal.pod'}: $!"); + { local $/; + unlike(, qr/other/, 'DESTDIR should not appear in perllocal'); + } + close PERLLOCAL; + +# TODO not available in the min version of Test::Harness we require +# ok( open(PACKLIST, $files{'.packlist'} ) ) || +# diag("Can't open $files{'.packlist'}: $!"); +# { local $/; +# local $TODO = 'DESTDIR still in .packlist'; +# unlike(, qr/other/, 'DESTDIR should not appear in .packlist'); +# } +# close PACKLIST; + + rmtree('other'); +} + + +SKIP: { + skip "VMS install targets do not preserve $(PREFIX)", 9 if $Is_VMS; + + $install_out = run("$make install PREFIX=elsewhere DESTDIR=other/"); + is( $?, 0, 'install with PREFIX override and DESTDIR' ) || + diag $install_out; + like( $install_out, qr/^Installing /m ); + like( $install_out, qr/^Writing /m ); + + ok( !-d 'elsewhere', ' install dir not created' ); + ok( -d 'other/elsewhere', ' destdir created' ); + %files = (); + find( sub { $files{$_} = $File::Find::name; }, 'other/elsewhere' ); + ok( $files{'Dummy.pm'}, ' Dummy.pm installed' ); + ok( $files{'Liar.pm'}, ' Liar.pm installed' ); + ok( $files{'.packlist'}, ' packlist created' ); + ok( $files{'perllocal.pod'},' perllocal.pod created' ); + rmtree('other'); } diff --git a/lib/ExtUtils/t/recurs.t b/lib/ExtUtils/t/recurs.t new file mode 100644 index 0000000..9ec4f4c --- /dev/null +++ b/lib/ExtUtils/t/recurs.t @@ -0,0 +1,113 @@ +#!/usr/bin/perl -w + +# This tests MakeMaker against recursive builds + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} + +use strict; +use Config; + +use Test::More tests => 25; +use MakeMaker::Test::Utils; +use MakeMaker::Test::Setup::Recurs; + +# 'make disttest' sets a bunch of environment variables which interfere +# with our testing. +delete @ENV{qw(PREFIX LIB MAKEFLAGS)}; + +my $perl = which_perl(); +my $Is_VMS = $^O eq 'VMS'; + +chdir('t'); + +perl_lib; + +my $Touch_Time = calibrate_mtime(); + +$| = 1; + +ok( setup_recurs(), 'setup' ); +END { + ok( chdir File::Spec->updir ); + ok( teardown_recurs(), 'teardown' ); +} + +ok( chdir('Recurs'), q{chdir'd to Recurs} ) || + diag("chdir failed: $!"); + + +# Check recursive Makefile building. +my @mpl_out = run(qq{$perl Makefile.PL}); + +cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || + diag(@mpl_out); + +my $makefile = makefile_name(); + +ok( -e $makefile, 'Makefile written' ); +ok( -e File::Spec->catfile('prj2',$makefile), 'sub Makefile written' ); + +my $make = make_run(); + +run("$make"); +is( $?, 0, 'recursive make exited normally' ); + +ok( chdir File::Spec->updir ); +ok( teardown_recurs(), 'cleaning out recurs' ); +ok( setup_recurs(), ' setting up fresh copy' ); +ok( chdir('Recurs'), q{chdir'd to Recurs} ) || + diag("chdir failed: $!"); + + +# Check NORECURS +@mpl_out = run(qq{$perl Makefile.PL "NORECURS=1"}); + +cmp_ok( $?, '==', 0, 'Makefile.PL NORECURS=1 exited with zero' ) || + diag(@mpl_out); + +$makefile = makefile_name(); + +ok( -e $makefile, 'Makefile written' ); +ok( !-e File::Spec->catfile('prj2',$makefile), 'sub Makefile not written' ); + +$make = make_run(); + +run("$make"); +is( $?, 0, 'recursive make exited normally' ); + + +ok( chdir File::Spec->updir ); +ok( teardown_recurs(), 'cleaning out recurs' ); +ok( setup_recurs(), ' setting up fresh copy' ); +ok( chdir('Recurs'), q{chdir'd to Recurs} ) || + diag("chdir failed: $!"); + + +# Check that arguments aren't stomped when they have .. prepended +# [rt.perl.org 4345] +@mpl_out = run(qq{$perl Makefile.PL "INST_SCRIPT=cgi"}); + +cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || + diag(@mpl_out); + +$makefile = makefile_name(); +my $submakefile = File::Spec->catfile('prj2',$makefile); + +ok( -e $makefile, 'Makefile written' ); +ok( -e $submakefile, 'sub Makefile written' ); + +my $inst_script = File::Spec->catdir(File::Spec->updir, 'cgi'); +ok( open(MAKEFILE, $submakefile) ) || diag("Can't open $submakefile: $!"); +{ local $/; + like( , qr/^\s*INST_SCRIPT\s*=\s*\Q$inst_script\E/m, + 'prepend .. not stomping WriteMakefile args' ) +} +close MAKEFILE;