summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorVishal Bhatia <vishal@deja.com>1999-09-23 21:45:19 +0900
committerGurusamy Sarathy <gsar@cpan.org>1999-09-23 06:26:54 +0000
commitde0d19685a431728abc301db6a7957ad399d5e5f (patch)
tree431aba4f4e1ea8ec34e8371a904bc82918313a3f /utils
parentb4ba0ab9d629d222dce165e62056ecd7f24e4233 (diff)
downloadperl-de0d19685a431728abc301db6a7957ad399d5e5f.tar.gz
[patch _61] perlcc changes
Message-ID: <Pine.LNX.4.10.9909231218360.3428-100000@localhost.localdomain> p4raw-id: //depot/perl@4221
Diffstat (limited to 'utils')
-rw-r--r--utils/perlcc.PL29
1 files changed, 11 insertions, 18 deletions
diff --git a/utils/perlcc.PL b/utils/perlcc.PL
index 99e9b51851..ad2543afb3 100644
--- a/utils/perlcc.PL
+++ b/utils/perlcc.PL
@@ -2,6 +2,7 @@
use Config;
use File::Basename qw(&basename &dirname);
+use File::Spec;
use Cwd;
# List explicitly here the variables you want Configure to
@@ -270,13 +271,14 @@ sub _createCode
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
@@ -284,7 +286,7 @@ sub _createCode
_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;
}
}
@@ -390,17 +392,8 @@ sub _getSharedObjects
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";
@@ -474,12 +467,12 @@ sub _lookforAuto
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??
@@ -614,7 +607,7 @@ sub _checkopts
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,
@@ -766,7 +759,7 @@ sub _run
sub _interruptrun
{
my ($command) = @_;
- my $pid = open (FD, "$command 2|");
+ my $pid = open (FD, "$command |");
local($SIG{HUP}) = sub {
# kill 9, $pid + 1;