dumb cabal question

Isaac Jones ijones at syntaxpolice.org
Mon Sep 5 13:42:27 EDT 2005


dons at cse.unsw.edu.au (Donald Bruce Stewart) writes:

> Sven.Panne:
>> Am Montag, 5. September 2005 08:13 schrieb Frederik Eaton:
>> > On Sun, Sep 04, 2005 at 08:01:48PM -0700, Isaac Jones wrote:
>> > > The reason to combine them is that the point of abstraction between
>> > > the compilers / interpreters lives in areas like "preprocess this
>> > > file", "build this file", "install this library", not in operations
>> > > like you mentioned:
>> >
>> > I mentioned the second two of those, but not the first one.
>> > Preprocessing files, however, doesn't sound like an operation that
>> > needs to be done in a compiler/interpreter-specific way.
>> > [...]
>> 
>> At least in a restricted sense it i*is* compiler/interpreter-specific, because 
>> one has to #define some magic things like __HUGS__, __GLASGOW_HASKELL__, etc. 
>> to get conditional compilation right.
>
> Which reminds me, 'runhaskell Setup.hs haddock' doesn't seem to generate
> output for code inside #if defined(__GLASGOW_HASKELL__). Poking around
> in the source I see:
>
> Distribution.PreProcess:
>     hcDefines :: Compiler -> [String]
>     hcDefines Compiler { compilerFlavor=NHC, compilerVersion=version }
>       = ["-D__NHC__=" ++ versionInt version]
>     hcDefines Compiler { compilerFlavor=Hugs }
>       = ["-D__HUGS__"]
>     hcDefines _ = []

I'm guessing this is because usually cpp is run w/ ghc -cpp, so
there's no need for this case.  Probably the haddock generator uses
hscpp or something, and so this case should be added.  Any objections?

peace,

  isaac


More information about the Libraries mailing list