summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorEric Seidel <gridaphobe@gmail.com>2015-05-11 14:30:13 -0700
committerEric Seidel <gridaphobe@gmail.com>2015-05-11 14:39:36 -0700
commit395829686d0219b3e14fe6ffae60a24b4e50370b (patch)
treed8ec773c31ba34feab780dd688b32cf9de0ce0f9 /pkgs
parentea0c877858e071d2258680cb4779786ff1f0dea0 (diff)
downloadnixpkgs-395829686d0219b3e14fe6ffae60a24b4e50370b.tar
nixpkgs-395829686d0219b3e14fe6ffae60a24b4e50370b.tar.gz
nixpkgs-395829686d0219b3e14fe6ffae60a24b4e50370b.tar.bz2
nixpkgs-395829686d0219b3e14fe6ffae60a24b4e50370b.tar.lz
nixpkgs-395829686d0219b3e14fe6ffae60a24b4e50370b.tar.xz
nixpkgs-395829686d0219b3e14fe6ffae60a24b4e50370b.tar.zst
nixpkgs-395829686d0219b3e14fe6ffae60a24b4e50370b.zip
add is{GNU,Clang} attrs to cc-wrapper.
These will be more pleasant to use than the existing

    (cc.cc.isClang or false)

nonsense we currently do.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/build-support/cc-wrapper/default.nix3
-rw-r--r--pkgs/stdenv/darwin/default.nix14
-rw-r--r--pkgs/stdenv/linux/default.nix2
-rw-r--r--pkgs/stdenv/nix/default.nix1
-rw-r--r--pkgs/top-level/all-packages.nix4
5 files changed, 17 insertions, 7 deletions
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix
index f6826c837ca..c8af548a2ca 100644
--- a/pkgs/build-support/cc-wrapper/default.nix
+++ b/pkgs/build-support/cc-wrapper/default.nix
@@ -10,6 +10,7 @@
 , zlib ? null, extraPackages ? []
 , dyld ? null # TODO: should this be a setup-hook on dyld?
 , setupHook ? ./setup-hook.sh
+, isGNU ? false, isClang ? false
 }:
 
 with stdenv.lib;
@@ -41,7 +42,7 @@ stdenv.mkDerivation {
   # The wrapper scripts use 'cat', so we may need coreutils.
   coreutils = if nativeTools then null else coreutils;
 
-  passthru = { inherit nativeTools nativeLibc nativePrefix; };
+  passthru = { inherit nativeTools nativeLibc nativePrefix isGNU isClang; };
 
   buildCommand =
     ''
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index f06170b5cb1..ac396ecdf12 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -90,6 +90,7 @@ rec {
           cc      = "/usr";
           outPath = nativePrefix;
         };
+        isClang      = true;
       };
     };
     pkgs = allPackages {
@@ -129,13 +130,14 @@ rec {
 
     cc = import ../../build-support/cc-wrapper {
       inherit stdenv;
-      nativeTools  = false;
-      nativeLibc   = true;
-      binutils  = pkgs.darwin.cctools;
-      cc        = pkgs.llvmPackages.clang-unwrapped;
-      coreutils = pkgs.coreutils;
-      shell     = "${pkgs.bash}/bin/bash";
+      nativeTools   = false;
+      nativeLibc    = true;
+      binutils      = pkgs.darwin.cctools;
+      cc            = pkgs.llvmPackages.clang-unwrapped;
+      coreutils     = pkgs.coreutils;
+      shell         = "${pkgs.bash}/bin/bash";
       extraPackages = [ pkgs.libcxx ];
+      isClang       = true;
     };
 
     shell = "${pkgs.bash}/bin/bash";
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index d432206a9e1..722d40bf7fb 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -91,6 +91,7 @@ rec {
           nativeTools = false;
           nativeLibc = false;
           cc = gccPlain;
+          isGNU = true;
           libc = glibc;
           inherit binutils coreutils;
           name = name;
@@ -234,6 +235,7 @@ rec {
       gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) {
         nativeTools = false;
         nativeLibc = false;
+        isGNU = true;
         cc = stage4.stdenv.cc.cc;
         libc = stage4.pkgs.glibc;
         inherit (stage4.pkgs) binutils coreutils;
diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix
index 79c9fb3a137..75e1c3814ed 100644
--- a/pkgs/stdenv/nix/default.nix
+++ b/pkgs/stdenv/nix/default.nix
@@ -20,6 +20,7 @@ import ../generic rec {
     inherit stdenv;
     binutils = pkgs.binutils;
     cc = pkgs.gcc.cc;
+    isGNU = true;
     coreutils = pkgs.coreutils;
     shell = pkgs.bash + "/bin/sh";
   };
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 95eabc5a3c4..5ab8b2fb69f 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3433,6 +3433,7 @@ let
 
   clangWrapSelf = build: (import ../build-support/cc-wrapper) {
     cc = build;
+    isClang = true;
     stdenv = clangStdenv;
     libc = glibc;
     binutils = binutils;
@@ -4479,6 +4480,8 @@ let
     nativePrefix = stdenv.cc.nativePrefix or "";
     cc = baseCC;
     libc = libc;
+    isGNU = baseCC.isGNU or false;
+    isClang = baseCC.isClang or false;
     inherit stdenv binutils coreutils zlib;
   };
 
@@ -4518,6 +4521,7 @@ let
     nativePrefix = stdenv.cc.nativePrefix or "";
     cc = baseGCC;
     libc = glibc;
+    isGNU = true;
     inherit stdenv binutils coreutils zlib;
     setupHook = ../build-support/cc-wrapper/setup-hook-stdinc.sh;
   };