summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc/5
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2017-06-04 23:55:29 -0400
committerJohn Ericson <Ericson2314@Yahoo.com>2017-06-06 19:28:16 -0400
commit35ed21d09636ea85806685c92723a5ebc2d6bb39 (patch)
treef84839edec85787302de8e6b03a7fac1a9039395 /pkgs/development/compilers/gcc/5
parente854685d65f4f6bf9afe5b34550c15f69afa9247 (diff)
downloadnixlib-35ed21d09636ea85806685c92723a5ebc2d6bb39.tar
nixlib-35ed21d09636ea85806685c92723a5ebc2d6bb39.tar.gz
nixlib-35ed21d09636ea85806685c92723a5ebc2d6bb39.tar.bz2
nixlib-35ed21d09636ea85806685c92723a5ebc2d6bb39.tar.lz
nixlib-35ed21d09636ea85806685c92723a5ebc2d6bb39.tar.xz
nixlib-35ed21d09636ea85806685c92723a5ebc2d6bb39.tar.zst
nixlib-35ed21d09636ea85806685c92723a5ebc2d6bb39.zip
gcc*: Replace stdenv.is* with {host,target}Platform.is*
Host everywhere would be guaranteed to preserve the old semantics,
but in a few places it doesn't matter in practice, target is used
instead for clarity.
Diffstat (limited to 'pkgs/development/compilers/gcc/5')
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix24
1 files changed, 12 insertions, 12 deletions
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index 2569b8c5dc7a..b4a74300d366 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
-, langObjC ? stdenv.isDarwin
-, langObjCpp ? stdenv.isDarwin
+, langObjC ? targetPlatform.isDarwin
+, langObjCpp ? targetPlatform.isDarwin
 , langJava ? false
 , langAda ? false
 , langVhdl ? false
@@ -47,10 +47,10 @@ assert langVhdl     -> gnat != null;
 assert libelf != null -> zlib != null;
 
 # Make sure we get GNU sed.
-assert stdenv.isDarwin -> gnused != null;
+assert hostPlatform.isDarwin -> gnused != null;
 
 # Need c++filt on darwin
-assert stdenv.isDarwin -> binutils != null;
+assert hostPlatform.isDarwin -> binutils != null;
 
 # The go frontend is written in c++
 assert langGo -> langCC;
@@ -234,7 +234,7 @@ stdenv.mkDerivation ({
 
   # This should kill all the stdinc frameworks that gcc and friends like to
   # insert into default search paths.
-  prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  prePatch = stdenv.lib.optionalString hostPlatform.isDarwin ''
     substituteInPlace gcc/config/darwin-c.c \
       --replace 'if (stdinc)' 'if (0)'
 
@@ -246,7 +246,7 @@ stdenv.mkDerivation ({
   '';
 
   postPatch =
-    if (stdenv.isHurd
+    if (hostPlatform.isHurd
         || (libcCross != null                  # e.g., building `gcc.crossDrv'
             && libcCross ? crossConfig
             && libcCross.crossConfig == "i586-pc-gnu")
@@ -317,13 +317,13 @@ stdenv.mkDerivation ({
 
     # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
     # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
-    ++ (optional stdenv.isDarwin gnused)
-    ++ (optional stdenv.isDarwin binutils)
+    ++ (optional hostPlatform.isDarwin gnused)
+    ++ (optional hostPlatform.isDarwin binutils)
     ;
 
-  NIX_LDFLAGS = stdenv.lib.optionalString  stdenv.isSunOS "-lm -ldl";
+  NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
 
-  preConfigure = stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) ''
+  preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
     export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
     export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
     export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
@@ -333,7 +333,7 @@ stdenv.mkDerivation ({
   dontDisableStatic = true;
 
   configureFlags = "
-    ${if stdenv.isSunOS then
+    ${if hostPlatform.isSunOS then
       " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
       # On Illumos/Solaris GNU as is preferred
       " --with-gnu-as --without-gnu-ld "
@@ -378,7 +378,7 @@ stdenv.mkDerivation ({
       )
     }
     ${if targetPlatform == hostPlatform
-      then if stdenv.isDarwin
+      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 ""}