Setup.hs: import configure

Rather than running make, which runs configure, let Setup.hs just include
the configure code. The standalone configure is retained for use by the
Makefile.

This may work better with cabal-dev, since it avoids the Makefile running
ghc, and lets cabal handle all the compiler running, with whatever
flags it uses to expose dependencies.
This commit is contained in:
Joey Hess 2012-03-10 14:00:26 -04:00
parent eaa80be917
commit 468fecc315
3 changed files with 119 additions and 109 deletions

View file

@ -3,15 +3,10 @@
import Distribution.Simple
import System.Cmd
main = defaultMainWithHooks simpleUserHooks {
preConf = makeSources,
postClean = makeClean
}
import qualified Build.Configure as Configure
makeSources _ _ = do
system "make sources"
main = defaultMainWithHooks simpleUserHooks { preConf = configure }
configure _ _ = do
Configure.run Configure.tests
return (Nothing, [])
makeClean _ _ _ _ = do
system "make clean"
return ()