Cabal fix.

This commit is contained in:
lemmih 2005-10-07 10:22:09 +00:00
parent 1acd230b94
commit c8da903578

View File

@ -1,2 +1,16 @@
import Distribution.Simple
main = defaultMainWithHooks defaultUserHooks
import Distribution.Setup ( ConfigFlags (..) )
import System.Directory ( findExecutable )
main = defaultMainWithHooks (defaultUserHooks { postConf = defaultPostConf })
where defaultPostConf args flags lbi
= do args' <- fmap (args++) (configToArgs flags)
(postConf defaultUserHooks) args' flags lbi
configToArgs :: ConfigFlags -> IO [String]
configToArgs (ConfigFlags { configHcPath = Just hcPath })
= do exec <- findExecutable hcPath
case exec of
Just realPath -> return ["--with-ghc="++realPath]
Nothing -> return ["--with-ghc="++hcPath]
configToArgs _ = return []