diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 2001-07-23 14:33:16 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-07-23 22:54:52 +0000 |
commit | a8112c7ffb4b03260b1be74812dc04b1982c5ca1 (patch) | |
tree | 2fc40a7d4485c458a6147d0a25fdf9d20f74da11 /lib | |
parent | 1167a30e646ca68516b6d6fe00c979246aa8df3a (diff) | |
download | perl-a8112c7ffb4b03260b1be74812dc04b1982c5ca1.tar.gz |
MakeMaker subdir
Message-ID: <20010723183316.A14298@math.ohio-state.edu>
p4raw-id: //depot/perl@11460
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ExtUtils/MakeMaker.pm | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index d81cd27d7a..5a27fb4798 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 { |