Commit a9620bf5 authored by ttuegel's avatar ttuegel Committed by tibbe

Add --enable-executable-profiling for backward compat

(cherry picked from commit f445c3a3)
parent 12c3490c
......@@ -308,6 +308,13 @@ configure (pkg_descr0, pbi) cfg
setupMessage verbosity "Configuring" (packageId pkg_descr0)
unless (configProfExe cfg == NoFlag) $ do
let enable | fromFlag (configProfExe cfg) = "enable"
| otherwise = "disable"
warn verbosity
("The flag --" ++ enable ++ "-executable-profiling is deprecated. "
++ "Please use --" ++ enable ++ "-profiling instead.")
createDirectoryIfMissingVerbose (lessVerbose verbosity) True distPref
let programsConfig = mkProgramsConfig cfg (configPrograms cfg)
......@@ -627,13 +634,19 @@ configure (pkg_descr0, pbi) cfg
++ "is not being built. Linking will fail if any executables "
++ "depend on the library."
let withProfExe_ = fromFlagOrDefault False $ configProfExe cfg
let withProf_ = fromFlagOrDefault False (configProf cfg)
withProfExe_ = fromFlagOrDefault withProf_ $ configProfExe cfg
withProfLib_ = fromFlagOrDefault withProfExe_ $ configProfLib cfg
when (withProfExe_ && not withProfLib_) $ warn verbosity $
"Executables will be built with profiling, but library "
++ "profiling is disabled. Linking will fail if any executables "
++ "depend on the library."
let configCoverage_ =
mappend (configCoverage cfg) (configLibCoverage cfg)
cfg' = cfg { configCoverage = configCoverage_ }
reloc <-
if not (fromFlag $ configRelocatable cfg)
then return False
......
......@@ -287,6 +287,8 @@ data ConfigFlags = ConfigFlags {
-- executables.
configProfExe :: Flag Bool, -- ^Enable profiling in the
-- executables.
configProf :: Flag Bool, -- ^Enable profiling in the library
-- and executables.
configConfigureArgs :: [String], -- ^Extra arguments to @configure@
configOptimization :: Flag OptimisationLevel, -- ^Enable optimization.
configProgPrefix :: Flag PathTemplate, -- ^Installed executable prefix.
......@@ -342,6 +344,7 @@ defaultConfigFlags progConf = emptyConfigFlags {
configSharedLib = NoFlag,
configDynExe = Flag False,
configProfExe = NoFlag,
configProf = NoFlag,
configOptimization = Flag NormalOptimisation,
configProgPrefix = Flag (toPathTemplate ""),
configProgSuffix = Flag (toPathTemplate ""),
......@@ -455,7 +458,7 @@ configureOptions showOrParseArgs =
,option "" ["profiling"]
"Executable profiling (requires library profiling)"
configProfExe (\v flags -> flags { configProfExe = v })
configProf (\v flags -> flags { configProf = v })
(boolOpt [] [])
,option "" ["executable-profiling"]
......@@ -728,6 +731,7 @@ instance Monoid ConfigFlags where
configSharedLib = mempty,
configDynExe = mempty,
configProfExe = mempty,
configProf = mempty,
configConfigureArgs = mempty,
configOptimization = mempty,
configProgPrefix = mempty,
......@@ -770,6 +774,7 @@ instance Monoid ConfigFlags where
configSharedLib = combine configSharedLib,
configDynExe = combine configDynExe,
configProfExe = combine configProfExe,
configProf = combine configProf,
configConfigureArgs = combine configConfigureArgs,
configOptimization = combine configOptimization,
configProgPrefix = combine configProgPrefix,
......
......@@ -255,6 +255,7 @@ instance Monoid SavedConfig where
configHcPkg = combine configHcPkg,
configVanillaLib = combine configVanillaLib,
configProfLib = combine configProfLib,
configProf = combine configProf,
configSharedLib = combine configSharedLib,
configDynExe = combine configDynExe,
configProfExe = combine configProfExe,
......
......@@ -382,7 +382,14 @@ filterConfigureFlags flags cabalLibVersion
flags_latest = flags { configConstraints = [] }
-- Cabal < 1.21.1 doesn't know about 'disable-relocatable'
flags_1_20_0 = flags_latest { configRelocatable = NoFlag }
-- Cabal < 1.21.1 doesn't know about 'enable-profiling'
flags_1_20_0 =
flags_latest { configRelocatable = NoFlag
, configProf = NoFlag
, configProfExe = configProf flags
, configProfLib =
mappend (configProf flags) (configProfLib flags)
}
-- Cabal < 1.19.2 doesn't know about '--exact-configuration'.
flags_1_19_1 = flags_1_20_0 { configExactConfiguration = NoFlag }
-- Cabal < 1.19.1 uses '--constraint' instead of '--dependency'.
......
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