summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2021-09-17 08:58:34 -0400
committerBen Gamari <ben@smart-cactus.org>2021-09-20 10:25:14 -0400
commit4611341b430576394fe7a253b36c0df288dc1536 (patch)
tree65a9b6a7bd7a855f4bf29fa7ae227aa8c4e8194c
parente7d71b402c31901aad23e46eae9d263857c26c79 (diff)
downloadhaskell-4611341b430576394fe7a253b36c0df288dc1536.tar.gz
hadrian: Pass CFLAGS to gmp configure
-rw-r--r--hadrian/src/Rules/Gmp.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/hadrian/src/Rules/Gmp.hs b/hadrian/src/Rules/Gmp.hs
index 6d89a5b0e9..985f13ef29 100644
--- a/hadrian/src/Rules/Gmp.hs
+++ b/hadrian/src/Rules/Gmp.hs
@@ -8,6 +8,8 @@ import Packages
import Target
import Utilities
import Hadrian.BuildPath
+import Hadrian.Expression
+import Settings.Builders.Common (cArgs)
-- | Build in-tree GMP library objects (if GmpInTree flag is set) and return
-- their paths.
@@ -117,8 +119,10 @@ gmpRules = do
let gmpBuildP = takeDirectory mk
gmpP = takeDirectory gmpBuildP
ctx <- makeGmpPathContext gmpP
+ cFlags <- interpretInContext ctx $ mconcat [ cArgs, getStagedSettingList ConfCcArgs ]
env <- sequence
[ builderEnvironment "CC" $ Cc CompileC (stage ctx)
+ , return . AddEnv "CFLAGS" $ unwords cFlags
, builderEnvironment "AR" (Ar Unpack (stage ctx))
, builderEnvironment "NM" Nm
]