[commit: ghc] wip/nfs-locking: Extract gmpLibs from integer-gmp.buildinfo directly. (aafa9ad)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:01:52 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/aafa9add2e1c98059b7ffa6ded7c86195f9967e1/ghc

>---------------------------------------------------------------

commit aafa9add2e1c98059b7ffa6ded7c86195f9967e1
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Thu Feb 11 01:52:55 2016 +0000

    Extract gmpLibs from integer-gmp.buildinfo directly.
    
    See #159, #206.


>---------------------------------------------------------------

aafa9add2e1c98059b7ffa6ded7c86195f9967e1
 src/Settings/Builders/Ghc.hs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/Settings/Builders/Ghc.hs b/src/Settings/Builders/Ghc.hs
index c9f8ddc..b7aef56 100644
--- a/src/Settings/Builders/Ghc.hs
+++ b/src/Settings/Builders/Ghc.hs
@@ -12,6 +12,9 @@ import Settings
 import Settings.Builders.GhcCabal (bootPackageDbArgs)
 import Settings.Builders.Common (cIncludeArgs)
 
+buildInfoPath :: FilePath
+buildInfoPath = pkgPath integerGmp -/- "integer-gmp.buildinfo"
+
 -- TODO: add support for -dyno
 -- $1/$2/build/%.$$($3_o-bootsuf) : $1/$4/%.hs-boot
 --     $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
@@ -28,7 +31,12 @@ ghcBuilderArgs = stagedBuilder Ghc ? do
         buildProg = not (buildObj || buildHi)
     libs    <- getPkgDataList DepExtraLibs
     gmpLibs <- if stage > Stage0 && buildProg
-               then words <$> getSetting GmpLibDir
+               then do -- TODO: get this data more gracefully
+                   buildInfo <- lift $ readFileLines buildInfoPath
+                   let extract s = case stripPrefix "extra-libraries: " s of
+                           Nothing    -> []
+                           Just value -> words value
+                   return $ concatMap extract buildInfo
                else return []
     libDirs <- getPkgDataList DepLibDirs
     mconcat [ commonGhcArgs



More information about the ghc-commits mailing list