From: Ilya Zakharevich Date: Mon, 23 Jul 2001 18:33:16 +0000 (-0400) Subject: MakeMaker subdir X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a8112c7ffb4b03260b1be74812dc04b1982c5ca1;p=p5sagit%2Fp5-mst-13.2.git MakeMaker subdir Message-ID: <20010723183316.A14298@math.ohio-state.edu> p4raw-id: //depot/perl@11460 --- diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index d81cd27..5a27fb4 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -150,8 +150,9 @@ sub prompt ($;$) { sub eval_in_subdirs { my($self) = @_; my($dir); - use Cwd 'cwd'; + use Cwd qw(cwd abs_path); my $pwd = cwd(); + local @INC = map abs_path($_), @INC; foreach $dir (@{$self->{DIR}}){ my($abs) = $self->catdir($pwd,$dir); @@ -543,14 +544,20 @@ END } sub WriteEmptyMakefile { - if (-f 'Makefile.old') { - chmod 0666, 'Makefile.old'; - unlink 'Makefile.old' or warn "unlink Makefile.old: $!"; - } - rename 'Makefile', 'Makefile.old' or warn "rename Makefile Makefile.old: $!" - if -f 'Makefile'; - open MF, '> Makefile' or die "open Makefile for write: $!"; - print MF <<'EOP'; + Carp::croak "WriteEmptyMakefile: Need even number of args" if @_ % 2; + local $SIG{__WARN__} = \&warnhandler; + + my %att = @_; + my $self = MM->new(\%att); + if (-f "$self->{MAKEFILE}.old") { + chmod 0666, "$self->{MAKEFILE}.old"; + unlink "$self->{MAKEFILE}.old" or warn "unlink $self->{MAKEFILE}.old: $!"; + } + rename $self->{MAKEFILE}, "$self->{MAKEFILE}.old" + or warn "rename $self->{MAKEFILE} $self->{MAKEFILE}.old: $!" + if -f $self->{MAKEFILE}; + open MF, '>', $self->{MAKEFILE} or die "open $self->{MAKEFILE} for write: $!"; + print MF <<'EOP'; all: clean: @@ -562,7 +569,7 @@ makemakerdflt: test: EOP - close MF or die "close Makefile for write: $!"; + close MF or die "close $self->{MAKEFILE} for write: $!"; } sub check_manifest {