diff options
author | Max Maischein <corion@corion.net> | 2009-09-24 21:18:07 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-09-24 21:19:08 +0100 |
commit | 9d6c7f2eccef26a6d6eb46a8192949a88c6aaf8f (patch) | |
tree | 0dc93af202d3d3869469bd5968ca5986c520834d /makedef.pl | |
parent | 83d5895a155b275741e82edebaa0001c30f04f4d (diff) | |
download | perl-9d6c7f2eccef26a6d6eb46a8192949a88c6aaf8f.tar.gz |
Make makedef.pl more robust
Diffstat (limited to 'makedef.pl')
-rw-r--r-- | makedef.pl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/makedef.pl b/makedef.pl index 1b3c2b5fe5..65c2e28ee4 100644 --- a/makedef.pl +++ b/makedef.pl @@ -34,6 +34,7 @@ BEGIN { unshift @INC, "lib" } +use Config; use strict; use vars qw($PLATFORM $CCTYPE $FILETYPE $CONFIG_ARGS $ARCHNAME $PATCHLEVEL); @@ -75,7 +76,13 @@ if ($PLATFORM eq 'win32' or $PLATFORM eq 'wince' or $PLATFORM eq "aix") { # the user might have chosen to disable because the canned configs are # minimal configs that don't include any of those options. my $opts = ($PLATFORM eq 'wince' ? '-MCross' : ''); # for wince need Cross.pm to get Config.pm - my $config = `$^X $opts -Ilib -V`; + + $ENV{PERL5LIB} = join $Config{path_sep}, @INC; + my $cmd = "$^X $opts -V"; + my $config = `$cmd`; + if (! $config) { + die "Couldn't run [$cmd]: $!"; + }; my($options) = $config =~ /^ Compile-time options: (.*?)\n^ \S/ms; $options =~ s/\s+/ /g; print STDERR "Options: ($options)\n"; |