Minor revision
[hadrian.git] / src / Settings / Packages / IntegerGmp.hs
index 657eed0..72a70ce 100644 (file)
@@ -1,11 +1,10 @@
 module Settings.Packages.IntegerGmp (integerGmpPackageArgs, gmpBuildPath) where
 
 import Base
-import Expression
-import GHC (integerGmp)
-import Predicates (builder, builderGcc, package)
-import Settings.Paths
+import GHC
 import Oracles.Config.Setting
+import Predicate
+import Settings.Paths
 
 -- TODO: move build artefacts to buildRootPath, see #113
 -- TODO: Is this needed?
@@ -15,17 +14,15 @@ import Oracles.Config.Setting
 integerGmpPackageArgs :: Args
 integerGmpPackageArgs = package integerGmp ? do
     let includeGmp = "-I" ++ gmpBuildPath -/- "include"
-    gmp_includedir <- getSetting GmpIncludeDir
-    gmp_libdir <- getSetting GmpLibDir
-    let gmp_args = if (gmp_includedir == "" && gmp_libdir == "")
-                   then
-                   [ arg "--configure-option=--with-intree-gmp" ]
-                   else
-                   []
+    gmpIncludeDir <- getSetting GmpIncludeDir
+    gmpLibDir     <- getSetting GmpLibDir
 
-    mconcat [ builder GhcCabal ? mconcat
-              (gmp_args ++
-               [ appendSub "--configure-option=CFLAGS" [includeGmp]
-               , appendSub "--gcc-options"             [includeGmp] ] )
+    mconcat [ builder Cc ? arg includeGmp
 
-            , builderGcc ? arg includeGmp ]
+            , builder GhcCabal ? mconcat
+              [ (null gmpIncludeDir && null gmpLibDir) ?
+                arg "--configure-option=--with-intree-gmp"
+              , appendSub "--configure-option=CFLAGS" [includeGmp]
+              , appendSub "--gcc-options"             [includeGmp]
+              ]
+            ]