mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
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.
This commit is contained in:
parent
ea0c877858
commit
395829686d
@ -10,6 +10,7 @@
|
|||||||
, zlib ? null, extraPackages ? []
|
, zlib ? null, extraPackages ? []
|
||||||
, dyld ? null # TODO: should this be a setup-hook on dyld?
|
, dyld ? null # TODO: should this be a setup-hook on dyld?
|
||||||
, setupHook ? ./setup-hook.sh
|
, setupHook ? ./setup-hook.sh
|
||||||
|
, isGNU ? false, isClang ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
@ -41,7 +42,7 @@ stdenv.mkDerivation {
|
|||||||
# The wrapper scripts use 'cat', so we may need coreutils.
|
# The wrapper scripts use 'cat', so we may need coreutils.
|
||||||
coreutils = if nativeTools then null else coreutils;
|
coreutils = if nativeTools then null else coreutils;
|
||||||
|
|
||||||
passthru = { inherit nativeTools nativeLibc nativePrefix; };
|
passthru = { inherit nativeTools nativeLibc nativePrefix isGNU isClang; };
|
||||||
|
|
||||||
buildCommand =
|
buildCommand =
|
||||||
''
|
''
|
||||||
|
@ -90,6 +90,7 @@ rec {
|
|||||||
cc = "/usr";
|
cc = "/usr";
|
||||||
outPath = nativePrefix;
|
outPath = nativePrefix;
|
||||||
};
|
};
|
||||||
|
isClang = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
pkgs = allPackages {
|
pkgs = allPackages {
|
||||||
@ -129,13 +130,14 @@ rec {
|
|||||||
|
|
||||||
cc = import ../../build-support/cc-wrapper {
|
cc = import ../../build-support/cc-wrapper {
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
nativeTools = false;
|
nativeTools = false;
|
||||||
nativeLibc = true;
|
nativeLibc = true;
|
||||||
binutils = pkgs.darwin.cctools;
|
binutils = pkgs.darwin.cctools;
|
||||||
cc = pkgs.llvmPackages.clang-unwrapped;
|
cc = pkgs.llvmPackages.clang-unwrapped;
|
||||||
coreutils = pkgs.coreutils;
|
coreutils = pkgs.coreutils;
|
||||||
shell = "${pkgs.bash}/bin/bash";
|
shell = "${pkgs.bash}/bin/bash";
|
||||||
extraPackages = [ pkgs.libcxx ];
|
extraPackages = [ pkgs.libcxx ];
|
||||||
|
isClang = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
shell = "${pkgs.bash}/bin/bash";
|
shell = "${pkgs.bash}/bin/bash";
|
||||||
|
@ -91,6 +91,7 @@ rec {
|
|||||||
nativeTools = false;
|
nativeTools = false;
|
||||||
nativeLibc = false;
|
nativeLibc = false;
|
||||||
cc = gccPlain;
|
cc = gccPlain;
|
||||||
|
isGNU = true;
|
||||||
libc = glibc;
|
libc = glibc;
|
||||||
inherit binutils coreutils;
|
inherit binutils coreutils;
|
||||||
name = name;
|
name = name;
|
||||||
@ -234,6 +235,7 @@ rec {
|
|||||||
gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) {
|
gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) {
|
||||||
nativeTools = false;
|
nativeTools = false;
|
||||||
nativeLibc = false;
|
nativeLibc = false;
|
||||||
|
isGNU = true;
|
||||||
cc = stage4.stdenv.cc.cc;
|
cc = stage4.stdenv.cc.cc;
|
||||||
libc = stage4.pkgs.glibc;
|
libc = stage4.pkgs.glibc;
|
||||||
inherit (stage4.pkgs) binutils coreutils;
|
inherit (stage4.pkgs) binutils coreutils;
|
||||||
|
@ -20,6 +20,7 @@ import ../generic rec {
|
|||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
binutils = pkgs.binutils;
|
binutils = pkgs.binutils;
|
||||||
cc = pkgs.gcc.cc;
|
cc = pkgs.gcc.cc;
|
||||||
|
isGNU = true;
|
||||||
coreutils = pkgs.coreutils;
|
coreutils = pkgs.coreutils;
|
||||||
shell = pkgs.bash + "/bin/sh";
|
shell = pkgs.bash + "/bin/sh";
|
||||||
};
|
};
|
||||||
|
@ -3433,6 +3433,7 @@ let
|
|||||||
|
|
||||||
clangWrapSelf = build: (import ../build-support/cc-wrapper) {
|
clangWrapSelf = build: (import ../build-support/cc-wrapper) {
|
||||||
cc = build;
|
cc = build;
|
||||||
|
isClang = true;
|
||||||
stdenv = clangStdenv;
|
stdenv = clangStdenv;
|
||||||
libc = glibc;
|
libc = glibc;
|
||||||
binutils = binutils;
|
binutils = binutils;
|
||||||
@ -4479,6 +4480,8 @@ let
|
|||||||
nativePrefix = stdenv.cc.nativePrefix or "";
|
nativePrefix = stdenv.cc.nativePrefix or "";
|
||||||
cc = baseCC;
|
cc = baseCC;
|
||||||
libc = libc;
|
libc = libc;
|
||||||
|
isGNU = baseCC.isGNU or false;
|
||||||
|
isClang = baseCC.isClang or false;
|
||||||
inherit stdenv binutils coreutils zlib;
|
inherit stdenv binutils coreutils zlib;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -4518,6 +4521,7 @@ let
|
|||||||
nativePrefix = stdenv.cc.nativePrefix or "";
|
nativePrefix = stdenv.cc.nativePrefix or "";
|
||||||
cc = baseGCC;
|
cc = baseGCC;
|
||||||
libc = glibc;
|
libc = glibc;
|
||||||
|
isGNU = true;
|
||||||
inherit stdenv binutils coreutils zlib;
|
inherit stdenv binutils coreutils zlib;
|
||||||
setupHook = ../build-support/cc-wrapper/setup-hook-stdinc.sh;
|
setupHook = ../build-support/cc-wrapper/setup-hook-stdinc.sh;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user