[commit: ghc] wip/circleci-ben: gmp: Pass include directories to Haskell compiler (cbb553e)

git at git.haskell.org git at git.haskell.org
Sun Nov 12 00:06:57 UTC 2017


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

On branch  : wip/circleci-ben
Link       : http://ghc.haskell.org/trac/ghc/changeset/cbb553edfc0033ca86c109694945ab3ad8d6f034/ghc

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

commit cbb553edfc0033ca86c109694945ab3ad8d6f034
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Thu Oct 12 10:30:31 2017 -0400

    gmp: Pass include directories to Haskell compiler
    
    Previously the include directories weren't being included in the arguments
    used to invoke GHC when building the in-tree GMP. This caused the build to fail
    with missing include files.
    
    I considered for a moment using Cabal's `--extra-include-dirs` flag to pass
    these directories. However, it's important that we
    Instead of duplicating the include directory logic for the Haskell compiler,
    I just use Cabal's --extra-include-dirs flag, ensuring that


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

cbb553edfc0033ca86c109694945ab3ad8d6f034
 hadrian/src/Settings/Packages/IntegerGmp.hs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/hadrian/src/Settings/Packages/IntegerGmp.hs b/hadrian/src/Settings/Packages/IntegerGmp.hs
index 7c2b5f6..d584b60 100644
--- a/hadrian/src/Settings/Packages/IntegerGmp.hs
+++ b/hadrian/src/Settings/Packages/IntegerGmp.hs
@@ -12,13 +12,17 @@ import Rules.Gmp
 integerGmpPackageArgs :: Args
 integerGmpPackageArgs = package integerGmp ? do
     path <- expr gmpBuildPath
+    topDir <- expr topDirectory
     let includeGmp = "-I" ++ path -/- "include"
     gmpIncludeDir <- getSetting GmpIncludeDir
     gmpLibDir     <- getSetting GmpLibDir
+    let -- are we building an in-tree GMP?
+        inTreeGmp = null gmpIncludeDir && null gmpLibDir
     mconcat [ builder Cc ? arg includeGmp
 
             , builder GhcCabal ? mconcat
-              [ (null gmpIncludeDir && null gmpLibDir) ?
+              [ inTreeGmp ?
                 arg "--configure-option=--with-intree-gmp"
               , arg ("--configure-option=CFLAGS=" ++ includeGmp)
-              , arg ("--gcc-options="             ++ includeGmp) ] ]
+              , arg ("--extra-include-dirs="++ topDir -/- path -/- "include")
+              ] ]



More information about the ghc-commits mailing list