Commit 94c5860b authored by Mikhail Glushenkov's avatar Mikhail Glushenkov

filterConfigureFlags: filter more flags.

parent 6de88432
......@@ -266,7 +266,10 @@ instance Monoid GlobalFlags where
-- * Config flags
-- ------------------------------------------------------------
-- | Flags to @configure@ command
-- | Flags to @configure@ command.
--
-- IMPORTANT: every time a new flag is added, 'D.C.Setup.filterConfigureFlags'
-- should be updated.
data ConfigFlags = ConfigFlags {
--FIXME: the configPrograms is only here to pass info through to configure
-- because the type of configure is constrained by the UserHooks.
......@@ -1647,7 +1650,7 @@ instance Monoid ReplFlags where
replCommand :: ProgramConfiguration -> CommandUI ReplFlags
replCommand progConf = CommandUI
{ commandName = "repl"
, commandSynopsis =
, commandSynopsis =
"Open an interpreter session for the given component."
, commandDescription = Just $ \pname -> wrapText $
"If the current directory contains no package, ignores COMPONENT "
......
......@@ -370,7 +370,7 @@ configureOptions = commandOptions configureCommand
filterConfigureFlags :: ConfigFlags -> Version -> ConfigFlags
filterConfigureFlags flags cabalLibVersion
| cabalLibVersion >= Version [1,21,1] [] = flags_latest
| cabalLibVersion >= Version [1,22,0] [] = flags_latest
-- ^ NB: we expect the latest version to be the most common case.
| cabalLibVersion < Version [1,3,10] [] = flags_1_3_10
| cabalLibVersion < Version [1,10,0] [] = flags_1_10_0
......@@ -379,15 +379,19 @@ filterConfigureFlags flags cabalLibVersion
| cabalLibVersion < Version [1,19,1] [] = flags_1_19_0
| cabalLibVersion < Version [1,19,2] [] = flags_1_19_1
| cabalLibVersion < Version [1,21,1] [] = flags_1_20_0
| cabalLibVersion < Version [1,22,0] [] = flags_1_21_0
| otherwise = flags_latest
where
-- Cabal >= 1.19.1 uses '--dependency' and does not need '--constraint'.
flags_latest = flags { configConstraints = [] }
-- Cabal < 1.22 doesn't know about '--disable-debug-info'.
flags_1_21_0 = flags_latest { configDebugInfo = NoFlag }
-- Cabal < 1.21.1 doesn't know about 'disable-relocatable'
-- Cabal < 1.21.1 doesn't know about 'enable-profiling'
flags_1_20_0 =
flags_latest { configRelocatable = NoFlag
flags_1_21_0 { configRelocatable = NoFlag
, configProf = NoFlag
, configProfExe = configProf flags
, configProfLib =
......@@ -395,8 +399,10 @@ filterConfigureFlags flags cabalLibVersion
, configCoverage = NoFlag
, configLibCoverage = configCoverage flags
}
-- Cabal < 1.19.2 doesn't know about '--exact-configuration'.
flags_1_19_1 = flags_1_20_0 { configExactConfiguration = NoFlag }
-- Cabal < 1.19.2 doesn't know about '--exact-configuration' and
-- '--enable-library-stripping'.
flags_1_19_1 = flags_1_20_0 { configExactConfiguration = NoFlag
, configStripLibs = NoFlag }
-- Cabal < 1.19.1 uses '--constraint' instead of '--dependency'.
flags_1_19_0 = flags_1_19_1 { configDependencies = []
, configConstraints = configConstraints flags }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment