summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc/6/default.nix
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2017-12-05 14:01:18 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-12-05 14:01:18 -0500
commita3e35fbbe1fe9a3d117de69fb50f000ef5f4b312 (patch)
tree9ac2c59eb92c08b9281ddba7014f85770e05fc11 /pkgs/development/compilers/gcc/6/default.nix
parent1fe9798ac23e9be70553ba20a37fc32aa4f98f7f (diff)
downloadnixpkgs-a3e35fbbe1fe9a3d117de69fb50f000ef5f4b312.tar
nixpkgs-a3e35fbbe1fe9a3d117de69fb50f000ef5f4b312.tar.gz
nixpkgs-a3e35fbbe1fe9a3d117de69fb50f000ef5f4b312.tar.bz2
nixpkgs-a3e35fbbe1fe9a3d117de69fb50f000ef5f4b312.tar.lz
nixpkgs-a3e35fbbe1fe9a3d117de69fb50f000ef5f4b312.tar.xz
nixpkgs-a3e35fbbe1fe9a3d117de69fb50f000ef5f4b312.tar.zst
nixpkgs-a3e35fbbe1fe9a3d117de69fb50f000ef5f4b312.zip
gcc: Use platformFlags in crossConfigureFlags
A nice code deduplication
Diffstat (limited to 'pkgs/development/compilers/gcc/6/default.nix')
-rw-r--r--pkgs/development/compilers/gcc/6/default.nix22
1 files changed, 2 insertions, 20 deletions
diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix
index 947017343e2..fe308b77167 100644
--- a/pkgs/development/compilers/gcc/6/default.nix
+++ b/pkgs/development/compilers/gcc/6/default.nix
@@ -123,27 +123,9 @@ let version = "6.3.0";
     /* Cross-gcc settings */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
-    crossConfigureFlags = let
-        gccArch = targetPlatform.platform.gcc.arch or null;
-        gccCpu = targetPlatform.platform.gcc.cpu or null;
-        gccAbi = targetPlatform.platform.gcc.abi or null;
-        gccFpu = targetPlatform.platform.gcc.fpu or null;
-        gccFloat = targetPlatform.platform.gcc.float or null;
-        gccMode = targetPlatform.platform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
+    crossConfigureFlags =
         "--target=${targetPlatform.config}" +
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode +
+        platformFlags +
         # Ensure that -print-prog-name is able to find the correct programs.
         " --with-as=${binutils}/bin/${targetPlatform.config}-as" +
         " --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +