(Imported from Trac #238, reported by ross on 2008-02-13)
With haddock-1, Cabal invokes cpp, passing it ARCH and OS defines, -DHADDOCK and the contents of cpp-options. However haddock-2 invokes cpp itself via the GHC API, which passes this cpp the ARCH and OS defines, but it doesn't get the others.
It might also be a good idea to give HADDOCK a numeric value, because GHC extensions need not be hidden from the new one.
(Imported comment by @dcoutts on 2008-02-13)
I thought we wanted to avoid using -DHADDOCK precisely because haddock-2.0 can parse everything that ghc can, and so people should not need cpp hacks. Even if we use -DHADDOCK=2 we'll end up seeing the old workaround code that people show to haddock-0.x.
We should be passing the cpp-options of course.
IMHO, we should still make Cabal do the pre-processing rather than have ghc do it, but that's part of a larger task.
Fixed ages ago by:
Thu Aug 28 15:23:03 BST 2008 Ian Lynagh <email@example.com>
* We need to pass the CPP options to haddock 2
hunk ./Distribution/Simple/Haddock.hs 355
+ ++ ["-optP" ++ opt | opt <- cppOptions bi]