Hi, there,

In hscpp.prl `gcc' is used literally to find raw cpp, but if I
configure --with-gcc=cc (in Debian cc is symlink to one version of
gcc) and later admin changes this link, ghc will be in one
inconsistent state.

In mkdependHS.prl raw cpp is set at build time, but we can do that
like in hscpp.prl, why not?

But suitable perl variable for gcc is at your decision, I just used
$GHC_OPT_HILEV_ASM temporarily.

The installing rules for scripts in `target.mk' should change
accordingly, I think.

Regards,
        Rui

--- hscpp.prl	Sun Feb  7 23:06:20 1999
+++ hscpp.prl.new	Fri Jun 18 20:42:52 1999
@@ -29,7 +29,7 @@
     if ( -x $cmd ) { # cool
 	$Cpp = $OrigCpp;
     } else { # oops; try to guess
-	$GccV = `gcc -v 2>&1`;
+	$GccV = `$GHC_OPT_HILEV_ASM -v 2>&1`;
 	if ( $GccV =~ /Reading specs from (.*)\/specs/ ) {
 	    $Cpp = "$1/cpp $rest";
 	} else {
--- mkdependHS.prl	Sun Feb  7 23:06:21 1999
+++ mkdependHS.prl.new	Fri Jun 18 20:43:12 1999
@@ -66,7 +66,25 @@
 $Warnings   = 1; # 1 => warn about duplicate interface files
 $Dashdashes_seen = 0;
 
-$Cpp = ${RAWCPP};
+#$Cpp = ${RAWCPP};
+$OrigCpp = ${RAWCPP};
+
+if ( $OrigCpp =~ /(\S+)\s+(.*)/ ) {
+    $cmd  = $1;
+    $rest = $2;
+    if ( -x $cmd ) { # cool
+        $Cpp = $OrigCpp;
+    } else { # oops; try to guess
+        $GccV = `$GHC_OPT_HILEV_ASM -v 2>&1`;
+        if ( $GccV =~ /Reading specs from (.*)\/specs/ ) {
+            $Cpp = "$1/cpp $rest";
+        } else {
+            die "hscpp: don't know how to run cpp: $OrigCpp\n";
+        }
+    }
+} else {
+    $Cpp = $OrigCpp;
+}
 $Cpp_flag_set = 0; # 1 => run cpp over input files.
 
 if ( $ENV{'TMPDIR'} ) { # where to make tmp file names

Reply via email to