[project @ 2001-08-07 17:05:35 by ken]
authorken <unknown>
Tue, 7 Aug 2001 17:05:35 +0000 (17:05 +0000)
committerken <unknown>
Tue, 7 Aug 2001 17:05:35 +0000 (17:05 +0000)
Allow (and ignore, i.e., strip away) "-optc" prefix in command-line options.
This is for mkdependC-ing and compiling C code under ghc/rts, where we
use ghc-inplace as CC and give -optc-Dxxx options in CC_OPTS.  We used to
generate inaccurate (insufficient) dependencies.

glafp-utils/mkdependC/mkdependC.prl

index d4837e8..26ce208 100644 (file)
@@ -100,10 +100,10 @@ sub mangle_command_line_args {
        if ( /^--$/ ) {
            $Dashdashes_seen++;
 
-       } elsif ( /^-D(.*)/ ) { # recognized wherever they occur
-           push(@Defines, $_);
-       } elsif ( /^-I/ ) {
-           $Include_dirs .= " $_";
+       } elsif ( /^(-optc)?(-D.*)/ ) { # recognized wherever they occur
+           push(@Defines, $2);
+       } elsif ( /^(-optc)?(-I.*)/ ) {
+           $Include_dirs .= " $2";
 
        } elsif ($Dashdashes_seen != 1) { # not between -- ... --
            if ( /^-v$/ ) {