darcs patch: Change flags passed to hsc2hs

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Mon Jul 3 20:37:48 EDT 2006


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 at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-darcs-patch
Size: 14600 bytes
Desc: A darcs patch for your repository!
Url : http://www.haskell.org//pipermail/cabal-devel/attachments/20060704/6923437b/attachment.bin


More information about the cabal-devel mailing list