BEGIN { unshift @INC, "lib" }
+use Config;
use strict;
use vars qw($PLATFORM $CCTYPE $FILETYPE $CONFIG_ARGS $ARCHNAME $PATCHLEVEL);
# 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";