summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc/4.8
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2017-12-01 16:21:54 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-12-06 19:12:50 -0500
commitd4595b38e90790a2b8ee01a7127889747ba05bb7 (patch)
tree7c226779f89c8b54220f58748a3e5cc5357e7743 /pkgs/development/compilers/gcc/4.8
parentaeffc007fb3829eab1e3e8f92a6e646f1be71d7a (diff)
downloadnixlib-d4595b38e90790a2b8ee01a7127889747ba05bb7.tar
nixlib-d4595b38e90790a2b8ee01a7127889747ba05bb7.tar.gz
nixlib-d4595b38e90790a2b8ee01a7127889747ba05bb7.tar.bz2
nixlib-d4595b38e90790a2b8ee01a7127889747ba05bb7.tar.lz
nixlib-d4595b38e90790a2b8ee01a7127889747ba05bb7.tar.xz
nixlib-d4595b38e90790a2b8ee01a7127889747ba05bb7.tar.zst
nixlib-d4595b38e90790a2b8ee01a7127889747ba05bb7.zip
gcc: Modernize builder.sh for Cross
Instead of `NIX_CC` vs `NIX_CC_CROSS` spagetti, unconditionally use
`NIX_BUILD_CC` and `NIX_CC` in a consistent manner.
Diffstat (limited to 'pkgs/development/compilers/gcc/4.8')
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix12
1 files changed, 5 insertions, 7 deletions
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index 69348d50d0ac..17965406da05 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -338,11 +338,8 @@ stdenv.mkDerivation ({
         )
       )
     }
-    ${if targetPlatform == hostPlatform
-      then if hostPlatform.isDarwin
-        then " --with-native-system-header-dir=${darwin.usr-include}"
-        else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include"
-      else ""}
+    ${optionalString (!(crossMingw && crossStageStatic))
+      "--with-native-system-header-dir=${getDev (stdenv.ccCross or stdenv.cc).libc}/include"}
     ${if langAda then " --enable-libada" else ""}
     ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""}
     ${if targetPlatform != hostPlatform then crossConfigureFlags else ""}
@@ -402,12 +399,13 @@ stdenv.mkDerivation ({
     STRIP_FOR_TARGET = "${targetPlatform.config}-strip";
     CC_FOR_TARGET = "${targetPlatform.config}-gcc";
     CXX_FOR_TARGET = "${targetPlatform.config}-g++";
-    # If we are making a cross compiler, cross != null
-    NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
+
     dontStrip = true;
     buildFlags = "";
   };
 
+  NIX_BUILD_CC = stdenv.cc;
+  NIX_CC_CROSS = stdenv.ccCross or null;
 
   # Needed for the cross compilation to work
   AR = "ar";