use Config;
use File::Basename qw(&basename &dirname);
+use File::Spec;
use Cwd;
# List explicitly here the variables you want Configure to
if (@_ == 3) # compiling a program
{
chmod $generated_file, 0777 & ~umask if $backend eq "Bytecode";
-
+ my $null=File::Spec->devnull;
_print( "$^X -I@INC -MB::Stash -c $file\n", 36);
- my $stash=`$^X -I@INC -MB::Stash -c $file 2>/dev/null|tail -1`;
+ my @stash=`$^X -I@INC -MB::Stash -c $file 2>$null`;
+ my $stash=$stash[-1];
chomp $stash;
_print( "$^X -I@INC -MO=$backend,$stash $file\n", 36);
- $return = _run("$^X -I@INC -MO=$backend,$stash $file >> $generated_file", 9);
+ $return = _run("$^X -I@INC -MO=$backend,$stash,-o$generated_file $file", 9);
$return;
}
else # compiling a shared object
_print(
"$^X -I@INC -MO=$backend,-m$final_output $file\n", 36);
$return =
- _run("$^X -I@INC -MO=$backend,-m$final_output $file >> $generated_file", 9);
+ _run("$^X -I@INC -MO=$backend,-m$final_output,-o$generated_file $file ", 9);
$return;
}
}
my ($tmpprog);
($tmpprog = $sourceprog) =~ s"(.*)[\\/](.*)"$2";
- my $tempdir;
+ my $tempdir= File::Spec->tmpdir;
- if ($Config{'osname'} eq 'MSWin32')
- {
- $tempdir = $ENV{TEMP};
- $tempdir =~ s[\\][/]g;
- }
- else
- {
- $tempdir = "/tmp";
- }
$tmpfile = "$tempdir/$tmpprog.tst";
$incfile = "$tempdir/$tmpprog.val";
my ($relabs, $relshared);
my ($prefix);
my $return;
-
+ my $sharedextension=$^O eq 'MSWin32' ? '.lib':$Config{so};
($prefix = $file) =~ s"(.*)\.pm"$1";
my ($tmp, $modname) = ($prefix =~ m"(?:(.*)[\\/]){0,1}(.*)"s);
- $relshared = "$pathsep$prefix$pathsep$modname.$Config{so}";
+ $relshared = "$pathsep$prefix$pathsep$modname$sharedextension";
$relabs = "$pathsep$prefix$pathsep$modname$Config{_a}";
# HACK . WHY DOES _a HAVE A '.'
# AND so HAVE NONE??
one file the names clash)\n");
}
- if ($options->{'e'} && ($options->{'sav'} || $options->{'gen'}) && ò0
+ if ($options->{'e'} && ($options->{'sav'} || $options->{'gen'}) &&
!$options->{'C'})
{
push(@errors,
sub _interruptrun
{
my ($command) = @_;
- my $pid = open (FD, "$command 2|");
+ my $pid = open (FD, "$command |");
local($SIG{HUP}) = sub {
# kill 9, $pid + 1;