summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--makedef.pl9
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";