Commit f445c3a3 authored by ttuegel's avatar ttuegel
Browse files

Add --enable-executable-profiling for backward compat

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