
On Fri, 2009-01-16 at 21:17 +0000, Chris Kuklewicz wrote:
And regex-posix has a very "old school" Setup.hs file with a small addition:
#!/usr/bin/env runhaskell
-- I usually compile this with "ghc --make -o setup Setup.hs"
import Distribution.Simple(defaultMainWithHooks, defaultUserHooks) main = do putStrLn msg defaultMainWithHooks defaultUserHooks
msg = "This links to the standard c library version of regular expressions.\n\ \The corresponding c header file is regex.h and there is a chance you\n\ \will need to edit the end of the regex-posix.cabal file to find the\n\ \include directory and/or library.\n"
Hmmm...the next version will probably need to mention the cabal command line flags as well.
Perhaps you'd like to help us implement this ticket: Check for required C libraries during configure http://hackage.haskell.org/trac/hackage/ticket/262 As part of that ticket we should make sure the error message explains what it was that the package needed and what to do if they are in a non-standard location. The implementation basically just needs to do exactly what autoconf does in this circumstance, compile a little .c program. We have one advantage which is that we can probably do it faster in the best case since we ought to be able to make one .c program and try linking it against everything, rather than doing one compile for each C lib and C header. Of course if it fails then we have to go and do it for each one individually to figure out which is the cause of the problem. Duncan