Cabal and c2hs

Isaac Jones ijones at
Sat Apr 30 11:17:10 EDT 2005

Dominic Steinitz <dominic.steinitz at> writes:

> I've made some progress. I've installed c2hs. I'm still puzzled as to why 
> ./Setup configure didn't complain.
> And cabal magically finds the IP_ICMP.chs file and preprocesses it. However, I 
> need to execute the following:
> c2hs ip_icmp.h IP_ICMP.chs
> not just
> c2hs IP_ICMP.chs
> How do I get cabal to do this? I saw this 
> Does that 
> mean I need to modify cabal? Or can I use UserHooks? Are there any examples?

You can do this in a UserHook by either just calling hsc2hs on your .h
file in the preBuild phase, or you can override the c2hs preprocessor.
As I mention here:

There's an example of using UserHooks to override a preprocessor.
Setup.lhs is the right place for the fix until we add more tags to the
.cabal file for stuff like this.;content-type=text%2Fplain



More information about the Libraries mailing list