summary refs log tree commit diff
path: root/pkgs/development/libraries/gmp
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-08-03 11:58:20 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-08-03 17:06:03 -0400
commitf92ed87372042fa2ee4c2048ae47c511c9285a1b (patch)
treeefc58ffa4da66215bd085fe45a83b406bbf09de8 /pkgs/development/libraries/gmp
parentdb965063b346a33cc3f6363a40cbde2658d2cd23 (diff)
downloadnixpkgs-f92ed87372042fa2ee4c2048ae47c511c9285a1b.tar
nixpkgs-f92ed87372042fa2ee4c2048ae47c511c9285a1b.tar.gz
nixpkgs-f92ed87372042fa2ee4c2048ae47c511c9285a1b.tar.bz2
nixpkgs-f92ed87372042fa2ee4c2048ae47c511c9285a1b.tar.lz
nixpkgs-f92ed87372042fa2ee4c2048ae47c511c9285a1b.tar.xz
nixpkgs-f92ed87372042fa2ee4c2048ae47c511c9285a1b.tar.zst
nixpkgs-f92ed87372042fa2ee4c2048ae47c511c9285a1b.zip
gmp-*: Clean up configureFlags
Diffstat (limited to 'pkgs/development/libraries/gmp')
-rw-r--r--pkgs/development/libraries/gmp/4.3.2.nix8
-rw-r--r--pkgs/development/libraries/gmp/5.1.x.nix13
-rw-r--r--pkgs/development/libraries/gmp/6.x.nix11
3 files changed, 17 insertions, 15 deletions
diff --git a/pkgs/development/libraries/gmp/4.3.2.nix b/pkgs/development/libraries/gmp/4.3.2.nix
index 36067cc0786..939f769b457 100644
--- a/pkgs/development/libraries/gmp/4.3.2.nix
+++ b/pkgs/development/libraries/gmp/4.3.2.nix
@@ -27,8 +27,12 @@ let self = stdenv.mkDerivation rec {
     then "ln -sf configfsf.guess config.guess"
     else ''echo "Darwin host is `./config.guess`."'';
 
-  configureFlags = (if cxx then "--enable-cxx" else "--disable-cxx") +
-    stdenv.lib.optionalString stdenv.isDarwin " ac_cv_build=x86_64-apple-darwin13.4.0 ac_cv_host=x86_64-apple-darwin13.4.0";
+  configureFlags = [
+    (stdenv.lib.enableFeature cxx "cxx")
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    "ac_cv_build=x86_64-apple-darwin13.4.0"
+    "ac_cv_host=x86_64-apple-darwin13.4.0"
+  ];
 
   # The test t-lucnum_ui fails (on Linux/x86_64) when built with GCC 4.8.
   # Newer versions of GMP don't have that issue anymore.
diff --git a/pkgs/development/libraries/gmp/5.1.x.nix b/pkgs/development/libraries/gmp/5.1.x.nix
index 57204776dec..3b9fbc35a76 100644
--- a/pkgs/development/libraries/gmp/5.1.x.nix
+++ b/pkgs/development/libraries/gmp/5.1.x.nix
@@ -20,18 +20,17 @@ let self = stdenv.mkDerivation rec {
 
   patches = if stdenv.isDarwin then [ ./need-size-t.patch ] else null;
 
-  configureFlags =
+  configureFlags = [
+    "--with-pic"
+    (stdenv.lib.enableFeature cxx "cxx")
     # Build a "fat binary", with routines for several sub-architectures
     # (x86), except on Solaris where some tests crash with "Memory fault".
     # See <http://hydra.nixos.org/build/2760931>, for instance.
     #
     # no darwin because gmp uses ASM that clang doesn't like
-    optional (!stdenv.isSunOS) "--enable-fat"
-    ++ (if cxx then [ "--enable-cxx"  ]
-               else [ "--disable-cxx" ])
-    ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions"
-    ++ optional stdenv.isDarwin "ABI=64"
-    ++ optional stdenv.is64bit "--with-pic"
+    (stdenv.lib.enableFeature (!stdenv.isSunOS && stdenv.hostPlatform.isx86) "fat")
+  ] ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions"
+    ++ optional (stdenv.isDarwin && stdenv.is64bit) "ABI=64"
     ;
 
   # The config.guess in GMP tries to runtime-detect various
diff --git a/pkgs/development/libraries/gmp/6.x.nix b/pkgs/development/libraries/gmp/6.x.nix
index f62883529fc..04c57d94666 100644
--- a/pkgs/development/libraries/gmp/6.x.nix
+++ b/pkgs/development/libraries/gmp/6.x.nix
@@ -21,18 +21,17 @@ let self = stdenv.mkDerivation rec {
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ m4 ];
 
-  configureFlags =
+  configureFlags = [
+    "--with-pic"
+    (stdenv.lib.enableFeature cxx "cxx")
     # Build a "fat binary", with routines for several sub-architectures
     # (x86), except on Solaris where some tests crash with "Memory fault".
     # See <http://hydra.nixos.org/build/2760931>, for instance.
     #
     # no darwin because gmp uses ASM that clang doesn't like
-    optional (!stdenv.isSunOS && stdenv.hostPlatform.isx86) "--enable-fat"
-    ++ (if cxx then [ "--enable-cxx"  ]
-               else [ "--disable-cxx" ])
-    ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions"
+    (stdenv.lib.enableFeature (!stdenv.isSunOS && stdenv.hostPlatform.isx86) "fat")
+  ] ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions"
     ++ optional (stdenv.isDarwin && stdenv.is64bit) "ABI=64"
-    ++ optional stdenv.is64bit "--with-pic"
     ++ optional (with stdenv.hostPlatform; useAndroidPrebuilt || useiOSPrebuilt) "--disable-assembly"
     ;