> Please, can somebody explain, why the preprocessor is
> hardcoded in the GHC
> perl scripts? IIRC ghc (the perlscript itself) doesn't even reference
> $RAWCPP. mkdependHS and hscpp do, but why an absolute path
> and this obscure
> "-iprefix" parameter? Again, "-iwithprefix" is never used...
>
> Would it break things, if there is '$RAWCPP = "cpp
> -traditional"' only?
It isn't strictly speaking hardcoded, it's set up when you configure a
binary distribution. So if you move gcc or install a new version, you need
to re-install ghc.
The reasons are pretty boring -
- mkdependHS and friends need a cpp that accepts input on
stdin, and files that don't end in ".c". That rules out
'gcc -E'.
- many systems don't have a /lib/cpp (or any other easy way
to get at cpp), or if they do it is just a synonym for
'gcc -E', which is no good. On some systems it lives somewhere
else (eg. /usr/libexec/cpp on BSD4.4-derived systems).
I suppose we can put in a configure test for known locations of cpp
(/lib/cpp, /usr/libexec/cpp, /usr/lib/cpp) and use that in preference to
anything else if it works.
If anyone sends me a *complete* patch which does the right thing, then I'll
incorporate it.
Cheers,
Simon