#!./miniperl
use strict;
use warnings;
+use Config;
# This script acts as a simple interface for building extensions.
# It primarily used by the perl Makefile:
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 '';;
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);
}
) 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;
-}