Change occurrences of gcc to the more general cc

This is done for the sake of Yosemite, which does not have gcc, and yet
this change is also compatible with Linux.
This commit is contained in:
John Wiegley
2014-12-26 11:06:21 -06:00
parent ce100a5d58
commit 28b6fb61e6
252 changed files with 553 additions and 540 deletions
@@ -2,7 +2,7 @@
let
version = "3.3";
gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc;
gccReal = if (stdenv.cc.gcc or null) == null then stdenv.cc else stdenv.cc.gcc;
in
stdenv.mkDerivation {
@@ -11,15 +11,15 @@ stdenv.mkDerivation {
buildInputs = [ perl llvm groff cmake libxml2 python ];
patches = [ ./clang-tablegen-dir.patch ] ++
stdenv.lib.optional (stdenv.gcc.libc != null) ./clang-purity.patch;
stdenv.lib.optional (stdenv.cc.libc != null) ./clang-purity.patch;
cmakeFlags = [
"-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
"-DCMAKE_BUILD_TYPE=Release"
"-DLLVM_TARGETS_TO_BUILD=all"
"-DGCC_INSTALL_PREFIX=${gccReal}"
] ++ stdenv.lib.optionals (stdenv.gcc.libc != null) [
"-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include/"
] ++ stdenv.lib.optionals (stdenv.cc.libc != null) [
"-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include/"
];
enableParallelBuilding = true;
@@ -29,7 +29,7 @@ stdenv.mkDerivation {
sha256 = "15mrvw43s4frk1j49qr4v5viq68h8qlf10qs6ghd6mrsmgj5vddi";
};
passthru = { gcc = stdenv.gcc.gcc; };
passthru = { gcc = stdenv.cc.gcc; };
meta = {
homepage = http://clang.llvm.org/;
@@ -1,9 +1,5 @@
{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src }:
# be sure not to rebuild clang on darwin; some packages request it specifically
# we need to fix those
assert stdenv.isDarwin -> stdenv.gcc.nativeTools;
stdenv.mkDerivation {
name = "clang-${version}";
@@ -28,8 +24,8 @@ stdenv.mkDerivation {
"-DCMAKE_CXX_FLAGS=-std=c++11"
"-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
] ++
(stdenv.lib.optional (stdenv.gcc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include") ++
(stdenv.lib.optional (stdenv.gcc.gcc != null) "-DGCC_INSTALL_PREFIX=${stdenv.gcc.gcc}");
(stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include") ++
(stdenv.lib.optional (stdenv.cc.gcc != null) "-DGCC_INSTALL_PREFIX=${stdenv.cc.gcc}");
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
@@ -38,7 +34,7 @@ stdenv.mkDerivation {
ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
'';
passthru.gcc = stdenv.gcc.gcc;
passthru.gcc = stdenv.cc.gcc;
enableParallelBuilding = true;