forked from mirrors/nixpkgs
clang: Use configureFlags instead of env vars to tell which compiler to use
svn path=/nixpkgs/trunk/; revision=29922
This commit is contained in:
parent
1d7f2e1e90
commit
188df14951
|
@ -12,15 +12,16 @@ in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "clang-${version}";
|
name = "clang-${version}";
|
||||||
|
|
||||||
CC = if stdenv.gcc ? clang then "clang" else "gcc";
|
|
||||||
|
|
||||||
CXX = if stdenv.gcc ? clang then "clang++" else "g++";
|
|
||||||
|
|
||||||
src = llvm.src;
|
src = llvm.src;
|
||||||
|
|
||||||
buildInputs = [ perl llvm groff ];
|
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 {
|
srcClang = fetchurl {
|
||||||
url = "http://llvm.org/releases/${version}/clang-${version}.tgz";
|
url = "http://llvm.org/releases/${version}/clang-${version}.tgz";
|
||||||
sha256 = "1pq9g7qxw761dp6gx3amx39kl9p4zhlymmn8gfmcnw9ag0zizi3h";
|
sha256 = "1pq9g7qxw761dp6gx3amx39kl9p4zhlymmn8gfmcnw9ag0zizi3h";
|
||||||
|
|
|
@ -5,10 +5,6 @@ let version = "2.9"; in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "llvm-${version}";
|
name = "llvm-${version}";
|
||||||
|
|
||||||
CC = if stdenv.gcc ? clang then "clang" else "gcc";
|
|
||||||
|
|
||||||
CXX = if stdenv.gcc ? clang then "clang++" else "g++";
|
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://llvm.org/releases/${version}/llvm-${version}.tgz";
|
url = "http://llvm.org/releases/${version}/llvm-${version}.tgz";
|
||||||
sha256 = "0y9pgdakn3n0vf8zs6fjxjw6972nyw4rkfwwza6b8a3ll77kc4k6";
|
sha256 = "0y9pgdakn3n0vf8zs6fjxjw6972nyw4rkfwwza6b8a3ll77kc4k6";
|
||||||
|
@ -16,7 +12,11 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
buildInputs = [ perl groff ];
|
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 = {
|
meta = {
|
||||||
homepage = http://llvm.org/;
|
homepage = http://llvm.org/;
|
||||||
|
|
Loading…
Reference in a new issue