clang: Use configureFlags instead of env vars to tell which compiler to use

svn path=/nixpkgs/trunk/; revision=29922
This commit is contained in:
Shea Levy 2011-10-19 23:49:22 +00:00
parent 1d7f2e1e90
commit 188df14951
2 changed files with 11 additions and 10 deletions

View file

@ -12,15 +12,16 @@ in
stdenv.mkDerivation {
name = "clang-${version}";
CC = if stdenv.gcc ? clang then "clang" else "gcc";
CXX = if stdenv.gcc ? clang then "clang++" else "g++";
src = llvm.src;
buildInputs = [ perl llvm groff ];
configureFlags = [ "--enable-optimized" "--enable-shared" "--disable-static" ];
configureFlags = [ "--enable-optimized" "--enable-shared" "--disable-static" ]
++ stdenv.lib.optionals (stdenv.gcc ? clang) [
"--with-built-clang=yes"
"CXX=clang++"
];
srcClang = fetchurl {
url = "http://llvm.org/releases/${version}/clang-${version}.tgz";
sha256 = "1pq9g7qxw761dp6gx3amx39kl9p4zhlymmn8gfmcnw9ag0zizi3h";

View file

@ -5,10 +5,6 @@ let version = "2.9"; in
stdenv.mkDerivation {
name = "llvm-${version}";
CC = if stdenv.gcc ? clang then "clang" else "gcc";
CXX = if stdenv.gcc ? clang then "clang++" else "g++";
src = fetchurl {
url = "http://llvm.org/releases/${version}/llvm-${version}.tgz";
sha256 = "0y9pgdakn3n0vf8zs6fjxjw6972nyw4rkfwwza6b8a3ll77kc4k6";
@ -16,7 +12,11 @@ stdenv.mkDerivation {
buildInputs = [ perl groff ];
configureFlags = [ "--enable-optimized" "--enable-shared" "--disable-static" ];
configureFlags = [ "--enable-optimized" "--enable-shared" "--disable-static" ]
++ stdenv.lib.optionals (stdenv.gcc ? clang) [
"--with-built-clang=yes"
"CXX=clang++"
];
meta = {
homepage = http://llvm.org/;