HDBC-ODBC compile problem
Bulat Ziganshin
bulat.ziganshin at gmail.com
Mon Jul 17 16:11:50 EDT 2006
Hello John,
Monday, July 17, 2006, 11:40:18 PM, you wrote:
> As you noted, I can't apply this directly as-is because of not being
> cross-platform happy. That is easily enough fixed for the #includes.
> However, for the .cabal file, it's not so easy. Is it really not
> possible to link in odbc -- it has to be odbc32 on Windows?
is not it possible to use the same trick as i used to include Win32
package only in windows builds of Streams library. here is the
Setup.hs that does this trick:
-- This custom Cabal build script adds "Win32" package to the list of
-- dependencies if we build on the Windows platform
import qualified System.Info
import Data.List
import Distribution.Simple
import Distribution.Simple.Utils
import Distribution.PackageDescription
main = do pkg_descr_file <- defaultPackageDesc
pkg_descr <- readPackageDescription pkg_descr_file
let isWindows = "mingw" `isPrefixOf` System.Info.os
config = if isWindows
then pkg_descr { buildDepends = Dependency "Win32" AnyVersion
: buildDepends pkg_descr }
else pkg_descr
defaultMainNoRead config
--
Best regards,
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Libraries
mailing list