[Haskell] cabal and ghcconfigure.h

Robert Dockins robdockins at fastmail.fm
Wed Dec 7 18:08:47 EST 2005


> So you are listing extensions in the source files rather than the
> .cabal file, which should be OK (except that it's non-portable, of
> course).  So cabal really shouldn't have anything to do with it.  So
> it _should_ be all about how cabal is calling GHC... The question is,
> if the cpp flag is getting to ghc, why isn't ghc itself looking for
> the ghcconfig.h file?  Looks like the difference is here:
> >  /opt/local/bin/ghc -package-name Cmm -odir dist/build/src -hidir
> >dist/build/src --make -isrc Language.Cmm.Frontend Language.Cmm.Datatypes
>  (...)
> >  /usr/bin/ghc -package-name Cmm -odir dist/build -hidir dist/build
> >-hide-all-packages --make -i -isrc Language.Cmm.Frontend
>  (...)

Removing the -hide-all-packages flag from the command line causes the package 
to compile.  Apparently if package "base" is not in scope, then GHC won't 
find ghcconfig.h in the preprocess phase.  Is there ever a reason for the 
base package not to be in scope?  If cabal is going to add the 
-hide-all-packages flag, then perhaps it should also add -package base?

Adding a Build-Depends clause to my cabal file with all my dependencies fixes 
the problem.

More information about the Haskell mailing list