[commit: packages/Cabal] ghc-head: Rename 'pref' to 'libTargetDir'. (2d938de)
git at git.haskell.org
git at git.haskell.org
Mon Aug 26 23:31:42 CEST 2013
Repository : ssh://git@git.haskell.org/Cabal
On branch : ghc-head
Link : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=2d938dee64a7616792cce5a0412ee58a59004b36
>---------------------------------------------------------------
commit 2d938dee64a7616792cce5a0412ee58a59004b36
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date: Mon Aug 26 20:41:46 2013 +0200
Rename 'pref' to 'libTargetDir'.
>---------------------------------------------------------------
2d938dee64a7616792cce5a0412ee58a59004b36
Cabal/Distribution/Simple/GHC.hs | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs
index b572fcf..f0d4912 100644
--- a/Cabal/Distribution/Simple/GHC.hs
+++ b/Cabal/Distribution/Simple/GHC.hs
@@ -675,7 +675,7 @@ buildOrReplLib forRepl verbosity pkg_descr lbi lib clbi = do
[] -> die "No library name found when building library"
_ -> die "Multiple library names found when building library"
- let pref = buildDir lbi
+ let libTargetDir = buildDir lbi
pkgid = packageId pkg_descr
whenVanillaLib forceVanilla =
when (not forRepl && (forceVanilla || withVanillaLib lbi))
@@ -695,8 +695,7 @@ buildOrReplLib forRepl verbosity pkg_descr lbi lib clbi = do
isGhcDynamic <- ghcDynamic verbosity ghcProg
dynamicTooSupported <- ghcSupportsDynamicToo verbosity ghcProg
- let libTargetDir = pref
- doingTH = EnableExtension TemplateHaskell `elem` allExtensions libBi
+ let doingTH = EnableExtension TemplateHaskell `elem` allExtensions libBi
forceVanillaLib = doingTH && not isGhcDynamic
forceSharedLib = doingTH && isGhcDynamic
-- TH always needs default libs, even when building for profiling
@@ -731,7 +730,7 @@ buildOrReplLib forRepl verbosity pkg_descr lbi lib clbi = do
ghcOptLinkLibs = extraLibs libBi,
ghcOptLinkLibPath = extraLibDirs libBi,
ghcOptLinkFrameworks = PD.frameworks libBi,
- ghcOptInputFiles = [pref </> x | x <- cObjs]
+ ghcOptInputFiles = [libTargetDir </> x | x <- cObjs]
}
replOpts = vanillaOpts {
ghcOptExtra = filterGhciFlags
@@ -767,7 +766,7 @@ buildOrReplLib forRepl verbosity pkg_descr lbi lib clbi = do
info verbosity "Building C Sources..."
sequence_
[ do let vanillaCcOpts = (componentCcGhcOptions verbosity lbi
- libBi clbi pref filename)
+ libBi clbi libTargetDir filename)
profCcOpts = vanillaCcOpts `mappend` mempty {
ghcOptProfilingMode = toFlag True,
ghcOptObjSuffix = toFlag "p_o"
@@ -822,16 +821,16 @@ buildOrReplLib forRepl verbosity pkg_descr lbi lib clbi = do
, x <- libModules lib ]
hObjs <- getHaskellObjects lib lbi
- pref objExtension True
+ libTargetDir objExtension True
hProfObjs <-
if (withProfLib lbi)
then getHaskellObjects lib lbi
- pref ("p_" ++ objExtension) True
+ libTargetDir ("p_" ++ objExtension) True
else return []
hSharedObjs <-
if (withSharedLib lbi)
then getHaskellObjects lib lbi
- pref ("dyn_" ++ objExtension) False
+ libTargetDir ("dyn_" ++ objExtension) False
else return []
unless (null hObjs && null cObjs && null stubObjs) $ do
@@ -843,19 +842,19 @@ buildOrReplLib forRepl verbosity pkg_descr lbi lib clbi = do
let staticObjectFiles =
hObjs
- ++ map (pref </>) cObjs
+ ++ map (libTargetDir </>) cObjs
++ stubObjs
profObjectFiles =
hProfObjs
- ++ map (pref </>) cProfObjs
+ ++ map (libTargetDir </>) cProfObjs
++ stubProfObjs
ghciObjFiles =
hObjs
- ++ map (pref </>) cObjs
+ ++ map (libTargetDir </>) cObjs
++ stubObjs
dynamicObjectFiles =
hSharedObjs
- ++ map (pref </>) cSharedObjs
+ ++ map (libTargetDir </>) cSharedObjs
++ stubSharedObjs
-- After the relocation lib is created we invoke ghc -shared
-- with the dependencies spelled out as -package arguments
@@ -911,7 +910,6 @@ buildOrReplExe :: Bool -> Verbosity
-> Executable -> ComponentLocalBuildInfo -> IO ()
buildOrReplExe forRepl verbosity _pkg_descr lbi
exe at Executable { exeName = exeName', modulePath = modPath } clbi = do
- let pref = buildDir lbi
(ghcProg, _) <- requireProgram verbosity ghcProgram (withPrograms lbi)
let runGhcProg = runGHC verbosity ghcProg
@@ -925,7 +923,7 @@ buildOrReplExe forRepl verbosity _pkg_descr lbi
then exeExtension
else "")
- let targetDir = pref </> exeName'
+ let targetDir = (buildDir lbi) </> exeName'
let exeDir = targetDir </> (exeName' ++ "-tmp")
createDirectoryIfMissingVerbose verbosity True targetDir
createDirectoryIfMissingVerbose verbosity True exeDir
More information about the ghc-commits
mailing list