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.
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$/ ) {