darcs patch: Change flags passed to hsc2hs

Isaac Jones ijones at syntaxpolice.org
Tue Jul 4 15:27:20 EDT 2006

Duncan Coutts <duncan.coutts at worc.ox.ac.uk> writes:

> I made this patch after noticing that John Goerzen's ldap-haskell package
> doesn't compile (with recent versions of OpenLDAP) because the hsc2hs call
> fails with a linking error. hsc2hs compiles and links a C program to generate
> the final .hs file. It turned out that the .c file was referencing not just
> constants from the ldap.h file but things which translated into linker symbols.
> So when it linked there were missing symbols. The solution is this case is to
> pass -L-lldap to hsc2hs.
> So this patch does that in the general case, all extra-libaries are passed
> to hsc2hs (prefixed with --lflag=-l).

Sounds good.  Thanks!  Go ahead and apply it.

> It's also arguable that we should pass all cc options and ld options
> using --cflag= and --lflag= . This is what the build system for Gtk2Hs does.

Do you think this will ever cause a problem?  Maybe sending C flags to
hsc2hs which were just meant for other parts of the build?  If not,
I'd say go for it.



More information about the cabal-devel mailing list