make isClang work the way a user might expect

This commit is contained in:
Jude Taylor 2015-08-04 09:55:29 -07:00
parent dc74a81129
commit ef95107ddc
5 changed files with 7 additions and 5 deletions

View File

@ -9,7 +9,7 @@
, cc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell , cc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell
, zlib ? null, extraPackages ? [], extraBuildCommands ? "" , zlib ? null, extraPackages ? [], extraBuildCommands ? ""
, dyld ? null # TODO: should this be a setup-hook on dyld? , dyld ? null # TODO: should this be a setup-hook on dyld?
, isGNU ? false, isClang ? false , isGNU ? false, isClang ? cc.isClang or false
}: }:
with stdenv.lib; with stdenv.lib;

View File

@ -253,7 +253,7 @@ stdenv.mkDerivation rec {
# On some ARM platforms --enable-thumb # On some ARM platforms --enable-thumb
"--enable-shared --disable-static" "--enable-shared --disable-static"
(enableFeature true "pic") (enableFeature true "pic")
(if (stdenv.cc.cc.isClang or false) then "--cc=clang" else null) (if stdenv.cc.isClang then "--cc=clang" else null)
(enableFeature smallBuild "small") (enableFeature smallBuild "small")
(enableFeature runtimeCpuDetectBuild "runtime-cpudetect") (enableFeature runtimeCpuDetectBuild "runtime-cpudetect")
(enableFeature grayBuild "gray") (enableFeature grayBuild "gray")

View File

@ -2,7 +2,6 @@
let let
inherit (stdenv.lib) optional; inherit (stdenv.lib) optional;
isClang = (stdenv.cc.cc.isClang or false);
in in
stdenv.mkDerivation rec{ stdenv.mkDerivation rec{
name = "iniparser-3.1"; name = "iniparser-3.1";
@ -15,8 +14,7 @@ stdenv.mkDerivation rec{
patches = ./no-usr.patch; patches = ./no-usr.patch;
# TODO: Build dylib on Darwin # TODO: Build dylib on Darwin
buildFlags = (if stdenv.isDarwin then [ "libiniparser.a" ] else [ "libiniparser.so" ]) buildFlags = (if stdenv.isDarwin then [ "libiniparser.a" ] else [ "libiniparser.so" ]) ++ [ "CC=cc" ];
++ optional isClang "CC=clang";
installPhase = '' installPhase = ''
mkdir -p $out/lib mkdir -p $out/lib

View File

@ -1,5 +1,8 @@
{ stdenv, appleDerivation, icu, dyld, libdispatch, launchd, libclosure }: { stdenv, appleDerivation, icu, dyld, libdispatch, launchd, libclosure }:
# this project uses blocks, a clang-only extension
assert stdenv.cc.isClang;
appleDerivation { appleDerivation {
buildInputs = [ dyld icu libdispatch launchd libclosure ]; buildInputs = [ dyld icu libdispatch launchd libclosure ];

View File

@ -81,6 +81,7 @@ in rec {
nativePrefix = bootstrapTools; nativePrefix = bootstrapTools;
nativeLibc = false; nativeLibc = false;
libc = last.pkgs.darwin.Libsystem; libc = last.pkgs.darwin.Libsystem;
isClang = true;
cc = { name = "clang-9.9.9"; outPath = bootstrapTools; }; cc = { name = "clang-9.9.9"; outPath = bootstrapTools; };
}; };