- | otherwise -> runSetup verbosity ghc packageConf args
-
-runSetup :: Verbosity -> FilePath -> FilePath -> [String] -> IO ()
-runSetup verbosity ghc packageConf args = do
- rawSystemExit verbosity ghc ["-package-conf", packageConf,
- "--make", "Setup", "-o", "Setup"]
+ | otherwise ->
+ runSetup verbosity ghc packageConf useCabalVersion args
+
+runSetup :: Verbosity -> FilePath -> FilePath -> String -> [String] -> IO ()
+runSetup verbosity ghc packageConf useCabalVersion args = do
+ -- Don't bother building Setup if we are cleaning. If we need to
+ -- build Setup in order to build, and Setup isn't built already,
+ -- then there shouldn't be anything to clean anyway.
+ unless cleaning $
+ rawSystemExit verbosity ghc ["-package-conf", packageConf,
+ "--make", "Setup",
+ "-package", "Cabal-" ++ useCabalVersion,
+ "-o", "Setup"]