From 69af3f4a7875087c4659e573488f4a61845cea2f Mon Sep 17 00:00:00 2001 From: Vladimir Still Date: Sun, 26 Jan 2014 22:51:58 +0100 Subject: [PATCH] clang_31: Allow clang to find system includes in gcc dirs. Backported fix. --- pkgs/development/compilers/llvm/3.1/clang.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/llvm/3.1/clang.nix b/pkgs/development/compilers/llvm/3.1/clang.nix index 48e4c4946f30..8e67583c54a6 100644 --- a/pkgs/development/compilers/llvm/3.1/clang.nix +++ b/pkgs/development/compilers/llvm/3.1/clang.nix @@ -1,6 +1,9 @@ { stdenv, fetchurl, perl, groff, llvm, cmake }: -let version = "3.1"; in +let + version = "3.1"; + gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc; +in stdenv.mkDerivation { name = "clang-${version}"; @@ -14,6 +17,7 @@ stdenv.mkDerivation { "-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/" ]; @@ -31,7 +35,7 @@ stdenv.mkDerivation { homepage = http://clang.llvm.org/; description = "A C language family frontend for LLVM"; license = "BSD"; - maintainers = with stdenv.lib.maintainers; [viric shlevy]; + maintainers = with stdenv.lib.maintainers; [viric shlevy vlstill]; platforms = with stdenv.lib.platforms; all; }; }