summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-07-18 13:15:55 +0000
committerIan Lynagh <igloo@earth.li>2009-07-18 13:15:55 +0000
commitb0e1adc337081e7736adf4ba37e58832d87cc45d (patch)
treeeb8b5a3dd3634b902c3451ed67c95c878f8f52d4 /utils
parente27c3aa29483ba9be97ba8d967c7ea16de327247 (diff)
downloadhaskell-b0e1adc337081e7736adf4ba37e58832d87cc45d.tar.gz
Make ghc-cabal handle "Custom" Setup.hs files that have a configure script
Diffstat (limited to 'utils')
-rw-r--r--utils/ghc-cabal/ghc-cabal.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/utils/ghc-cabal/ghc-cabal.hs b/utils/ghc-cabal/ghc-cabal.hs
index 851136978b..7d2f522959 100644
--- a/utils/ghc-cabal/ghc-cabal.hs
+++ b/utils/ghc-cabal/ghc-cabal.hs
@@ -158,8 +158,16 @@ generate config_args distdir directory
withArgs (["configure", "--distdir", distdir] ++ config_args)
(case buildType (flattenPackageDescription gpd) of
Just Configure -> defaultMainWithHooks autoconfUserHooks
- _other -> defaultMain)
- -- not quite right, but good enough for us
+ -- time has a "Custom" Setup.hs, but it's actually Configure
+ -- plus a "./Setup test" hook. However, Cabal is also
+ -- "Custom", but doesn't have a configure script.
+ Just Custom ->
+ do configureExists <- doesFileExist "configure"
+ if configureExists
+ then defaultMainWithHooks autoconfUserHooks
+ else defaultMain
+ -- not quite right, but good enough for us:
+ _ -> defaultMain)
lbi <- getPersistBuildConfig distdir
let pd0 = localPkgDescr lbi