darcs patch: added cppOptions and c2hsOptions

Ross Paterson ross at soi.city.ac.uk
Sat Apr 21 17:35:55 EDT 2007


On Sat, Apr 21, 2007 at 10:32:08PM +1000, Duncan Coutts wrote:
> I have a patch, I'll send it soonish (probably Monday) for other people
> to review and test.
> 
> It's a general change to the way Cabal does pre-processing. Instead of
> generating the .hs files in place in the source tree we put them all in
> a special build tree in the dist dir (like where we put the .o and .hi
> files, but not actually the same directory).

I've been meaning to do something like that, to get the generated files
under dist, and to separate out the compiler-independent part of the code.
There should be no need for the compiler-specific parts to worry about
main-is or hs-source-dirs, when the first phase can handle those.

Another benefit is that we could include compiler-independent preprocessor
output (where possible) in source distributions.  If the package is
built in an environment lacking that preprocessor, it can use the
shipped output.  If the preprocessor is available, it can run it with
compiler-specific flags (e.g. happy -agc).  Not all preprocessors can
produce compiler-independent output, though.



More information about the cabal-devel mailing list