
From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Duncan Coutts On Thu, 2007-11-29 at 13:51 +1100, Tim Docker wrote:
Is it actually reasonable to expect any cabal packages that
depend on
external c libraries and headers to build out of the box on windows? How can cabal find out where those files are, without requiring a config file to be edited?
It's usually worse than that. The most likely situation is that the C library and header files are not even installed. This is a big problem for all packages that wrap C libs.
It can be done, with a bit of work, luck, and a brittle cabal Setup.hs :-) If you assume that the user has installed the 3rd party library correctly, and you know it's layout and an executable it uses (which is on the PATH), then you can do something like what HSQL does (and Takusen now, which copied HSQL's approach). That is, you ask for the location of the known executable in the PATH, and then build your header (include) and library paths relative to the location of the executable. That's what we've done in Takusen for the Oracle and Sqlite installations. For PostgreSQL there is a program you can run which will emit the installed locations of the include and library files, so that's slightly less brittle. Of course, if the particular libs are not on the PATH then this won't work :-( Alistair ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. *****************************************************************