From: Gurusamy Sarathy Date: Sun, 9 May 1999 21:11:51 +0000 (+0000) Subject: perlcc on win32 (correct version of fix suggested by Jean-Louis X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=46a8855a50eb32c89dd161fbf5c3956ca0e452d8;p=p5sagit%2Fp5-mst-13.2.git perlcc on win32 (correct version of fix suggested by Jean-Louis Leroy ) p4raw-id: //depot/perl@3351 --- diff --git a/utils/perlcc.PL b/utils/perlcc.PL index 7aca1d8..afad20a 100644 --- a/utils/perlcc.PL +++ b/utils/perlcc.PL @@ -308,16 +308,18 @@ sub _ccharness if (!grep(/^-[cS]$/, @args)) { - my $lperl = $^O eq 'os2' ? '-llibperl' : '-lperl'; + my $lperl = $^O eq 'os2' ? '-llibperl' + : $^O eq 'MSWin32' ? "$Config{archlibexp}\\CORE\\perl.lib" + : '-lperl'; my $flags = $type eq 'dynamic' ? $Config{lddlflags} : $Config{ldflags}; - $linkargs = "$flags $libdir $lperl @Config{libs}"; + $linkargs = "$flags $libdir $lperl $Config{libs}"; } my @sharedobjects = _getSharedObjects($sourceprog); my $dynaloader = "$Config{'installarchlib'}/auto/DynaLoader/DynaLoader.a"; my $optimize = $Config{'optimize'} =~ /-O\d/ ? '' : $Config{'optimize'}; my $cccmd = - "$Config{cc} @Config{qw(ccflags)} $optimize $incdir @sharedobjects @args $dynaloader $linkargs"; + "$Config{cc} $Config{ccflags} $optimize $incdir @sharedobjects @args $dynaloader $linkargs"; _print ("$cccmd\n", 36); @@ -331,16 +333,16 @@ sub _getSharedObjects my (@return); local($") = " -I"; - if ($Config{'osname'} eq 'MSWin32') { - # _addstuff; - } - else - { - my ($tmpprog); - ($tmpprog = $sourceprog) =~ s"(.*)[\/\\](.*)"$2"; - $tmpfile = "/tmp/$tmpprog.tst"; - $incfile = "/tmp/$tmpprog.val"; + my ($tmpprog); + ($tmpprog = $sourceprog) =~ s"(.*)[\/\\](.*)"$2"; + my $tempdir = '/tmp'; + if ($Config{'osname'} eq 'MSWin32') { + $tempdir = $ENV{TEMP}; + $tempdir =~ s[\\][/]g; + } + $tmpfile = "$tempdir/$tmpprog.tst"; + $incfile = "$tempdir/$tmpprog.val"; } my $fd = new FileHandle("> $tmpfile") || die "Couldn't open $tmpfile!\n";