diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-11-26 10:37:36 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-11-26 10:37:36 +0000 |
commit | c8d65f1035cb1d70dc2830289eaeb81b4e0d2ff8 (patch) | |
tree | c9904aa722129ae0eda22d403ee8d88f06f5adbf /lib/ExtUtils/MM_Unix.pm | |
parent | 10fdd3268bfedb0d10912f2f0ba6be13995de3fe (diff) | |
download | perl-c8d65f1035cb1d70dc2830289eaeb81b4e0d2ff8.tar.gz |
Upgrade to ExtUtils::MakeMaker 6.37_02
p4raw-id: //depot/perl@32494
Diffstat (limited to 'lib/ExtUtils/MM_Unix.pm')
-rw-r--r-- | lib/ExtUtils/MM_Unix.pm | 102 |
1 files changed, 57 insertions, 45 deletions
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index 0f1048d563..4d1f6048ca 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -18,7 +18,7 @@ use vars qw($VERSION @ISA use ExtUtils::MakeMaker qw($Verbose neatvalue); -$VERSION = '1.54_02'; +$VERSION = '6.37_02'; require ExtUtils::MM_Any; @ISA = qw(ExtUtils::MM_Any); @@ -35,7 +35,9 @@ BEGIN { $Is_SunOS4 = $^O eq 'sunos'; $Is_Solaris = $^O eq 'solaris'; $Is_SunOS = $Is_SunOS4 || $Is_Solaris; - $Is_BSD = $^O =~ /^(?:(?:free|net|open)bsd|bsdos|interix|dragonfly)$/; + $Is_BSD = ($^O =~ /^(?:free|net|open)bsd$/ or + grep( $^O eq $_, qw(bsdos interix dragonfly) ) + ); } BEGIN { @@ -128,37 +130,42 @@ sub c_o { my($self) = shift; return '' unless $self->needs_linking(); my(@m); + + my $command = '$(CCCMD)'; + my $flags = '$(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE)'; + if (my $cpp = $Config{cpprun}) { my $cpp_cmd = $self->const_cccmd; $cpp_cmd =~ s/^CCCMD\s*=\s*\$\(CC\)/$cpp/; - push @m, ' + push @m, qq{ .c.i: - '. $cpp_cmd . ' $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i -'; + $cpp_cmd $flags \$*.c > \$*.i +}; } - push @m, ' + + push @m, qq{ .c.s: - $(CCCMD) -S $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c -'; - push @m, ' -.c$(OBJ_EXT): - $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c -'; - push @m, ' -.C$(OBJ_EXT): - $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.C -' if !$Is_OS2 and !$Is_Win32 and !$Is_Dos; #Case-specific - push @m, ' -.cpp$(OBJ_EXT): - $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cpp + $command -S $flags \$*.c -.cxx$(OBJ_EXT): - $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cxx +.c\$(OBJ_EXT): + $command $flags \$*.c -.cc$(OBJ_EXT): - $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cc -'; - join "", @m; +.cpp\$(OBJ_EXT): + $command $flags \$*.cpp + +.cxx\$(OBJ_EXT): + $command $flags \$*.cxx + +.cc\$(OBJ_EXT): + $command $flags \$*.cc +}; + + push @m, qq{ +.C\$(OBJ_EXT): + $command \$*.C +} if !$Is_OS2 and !$Is_Win32 and !$Is_Dos; #Case-specific + + return join "", @m; } =item cflags (o) @@ -2707,27 +2714,32 @@ sub parse_version { open(FH,$parsefile) or die "Could not open '$parsefile': $!"; my $inpod = 0; while (<FH>) { - $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod; - next if $inpod || /^\s*#/; - chop; - next unless /(?<!\\)([\$*])(([\w\:\']*)\bVERSION)\b.*\=/; - my $eval = qq{ - package ExtUtils::MakeMaker::_version; - no strict; - BEGIN { eval { - require version; - "version"->import; - } } - - local $1$2; - \$$2=undef; do { - $_ - }; \$$2 - }; + $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod; + next if $inpod || /^\s*#/; + chop; + next unless /(?<!\\)([\$*])(([\w\:\']*)\bVERSION)\b.*\=/; + my $eval = qq{ + package ExtUtils::MakeMaker::_version; + no strict; + BEGIN { eval { + # Ensure any version() routine which might have leaked + # into this package has been deleted. Interferes with + # version->import() + undef *version; + require version; + "version"->import; + } } + + local $1$2; + \$$2=undef; + do { + $_ + }; \$$2 + }; local $^W = 0; - $result = eval($eval); - warn "Could not eval '$eval' in $parsefile: $@" if $@; - last; + $result = eval($eval); + warn "Could not eval '$eval' in $parsefile: $@" if $@; + last; } close FH; |