In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/b8d39eba9160d9d827fe1bd336e755657f56fc04?hp=222046efb22c183703fea2b30db76296ab782e89>
- Log ----------------------------------------------------------------- commit b8d39eba9160d9d827fe1bd336e755657f56fc04 Author: Nicholas Clark <n...@ccl4.org> Date: Fri Jan 30 20:45:48 2009 +0000 Use Config; rather than parsing config.sh and pushing it into %ENV, a literal transcription of the make_ext shell script. (We'll soon see if anything we called was using its environment rather than Config.pm) ----------------------------------------------------------------------- Summary of changes: make_ext.pl | 35 +++++------------------------------ 1 files changed, 5 insertions(+), 30 deletions(-) diff --git a/make_ext.pl b/make_ext.pl index 2f648e9..ce63523 100644 --- a/make_ext.pl +++ b/make_ext.pl @@ -1,6 +1,7 @@ #!./miniperl use strict; use warnings; +use Config; # This script acts as a simple interface for building extensions. # It primarily used by the perl Makefile: @@ -54,23 +55,9 @@ else { exit(1); } -# search config.sh for inclusion -$ENV{CONFIG} = '' if not defined $ENV{CONFIG}; -if ($ENV{CONFIG} eq '') { - my $config; - foreach my $depth (0..4) { - my $file = ('../' x $depth) . 'config.sh'; - $config = $file, last if -f $file; - } - print("Can't find config.sh generated by Configure"), exit(1) - unless defined $config; - - load_config_sh($config); -} - # fallback to config.sh's MAKE -$make ||= $ENV{make} || $ENV{MAKE}; -my $run = $ENV{run}; +$make ||= $Config{make} || $ENV{MAKE}; +my $run = $Config{run}; $run = '' if not defined $run; $run .= ' ' if $run ne '';; @@ -118,9 +105,9 @@ if (not -d "ext/$pname") { exit(0); # not an error ? } -if ($ENV{osname} eq 'catamount') { +if ($Config{osname} eq 'catamount') { # Snowball's chance of building extensions. - print "This is $ENV{osname}, not building $mname, sorry.\n"; + print "This is $Config{osname}, not building $mname, sorry.\n"; exit(0); } @@ -233,15 +220,3 @@ system( ) or exit(); exit($?); - -# read config.sh and add its keys to our %ENV -sub load_config_sh { - my $file = shift; - open my $fh, '<', $file or die "Could not open file '$file' as a 'config.sh': $!"; - while (<$fh>) { - chomp; - next if /^\s*#/; - $ENV{$1} = $3 if /^(?!:)([^\s=]+)=('?)(.*?)\2$/; - } - close $fh; -} -- Perl5 Master Repository