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).
Tue Jul 4 01:19:26 BST 2006 Duncan Coutts <duncan.coutts(a)worc.ox.ac.uk>
* Change flags passed to hsc2hs
The extra-libraries must be passed as -L-l${lib} or linking the C prog
that hsc2hs generates may fail if any symbols are referenced.
Also can't use cppOptions function since hsc2hs doesn't support -U.
Need to do -U flags in ccOptions seperately.
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.
Opinions?
Duncan