develooper Front page | perl.perl5.porters | Postings from March 2000

[PATCH 5.6.0-rc1] add logic to utils/perlcc.PL for Win32 with a BC++ compiler

Thread Previous
From:
Konovalov, Vadim
Date:
March 13, 2000 22:34
Subject:
[PATCH 5.6.0-rc1] add logic to utils/perlcc.PL for Win32 with a BC++ compiler
Message ID:
402099F49BEED211999700805FC7359F46AFA6@ru0028exch01.spb.lucent.com
This patch affects only perl for Win32 compiled with a BC++ compiler.
Without this patch command line for compiling resulting C code is incorrect
for BC++.

OTOH, I think it's wrong for modules or scripts to create command line for
each supported case. May be lib/Config.pm should provide such methods?

--- d:\WORK\PerlCompile\perl-5.6.0-RC1\utils\perlcc.PL	Fri Feb 18 06:49:22
2000
+++ d:\WORK\PerlCompile\diff\perlcc.PL	Tue Mar 14 01:27:36 2000
@@ -390,10 +390,16 @@
     @$libs = grep { !(/DynaLoader\.a$/ && ($dynaloader = $_)) } @$libs
 	if($^O eq 'cygwin');
 
+    my $args = "@args";
+    if ($^O eq 'MSWin32' && $Config{cc} =~ /\bbcc32\b/i) {
+        # BC++ cmd line syntax does not allow space between -[oexz...] and
arg
+        $args =~ s/(^| )-([oe]) /$1-$2/g;
+    }
+
     my $ccflags = $Config{ccflags};
     $ccflags .= ' -DUSEIMPORTLIB' if $^O eq 'cygwin';
     my $cccmd = "$Config{cc} $ccflags $optimize $incdir "
-		."@args $dynaloader $linkargs @$libs";
+		."$args $dynaloader $linkargs @$libs";
 
     _print ("$cccmd\n", 36);
     _run("$cccmd", 18 );
End of patch.

Good luck,
Vadim Konovalov.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About