clang-wrapper: Remove explicit dependency on libc++
Now libc++ is just another build input propagated from clang-wrapper.
This commit is contained in:
parent
84a586fa9e
commit
1e6dfdf29c
6 changed files with 14 additions and 20 deletions
|
@ -70,17 +70,11 @@ fi
|
|||
doSubstitute() {
|
||||
local src=$1
|
||||
local dst=$2
|
||||
local uselibcxx=
|
||||
local uselibcxxabi=
|
||||
if test -n "$libcxx" && echo $dst | fgrep ++; then uselibcxx=$libcxx; fi
|
||||
if test -n "$libcxxabi" && echo $dst | fgrep ++; then uselibcxxabi=$libcxxabi; fi
|
||||
# Can't use substitute() here, because replace may not have been
|
||||
# built yet (in the bootstrap).
|
||||
sed \
|
||||
-e "s^@out@^$out^g" \
|
||||
-e "s^@shell@^$shell^g" \
|
||||
-e "s^@libcxx@^$uselibcxx^g" \
|
||||
-e "s^@libcxxabi@^$uselibcxxabi^g" \
|
||||
-e "s^@clang@^$clang^g" \
|
||||
-e "s^@clangProg@^$clangProg^g" \
|
||||
-e "s^@binutils@^$binutils^g" \
|
||||
|
@ -151,3 +145,5 @@ cp -p $utils $out/nix-support/utils.sh
|
|||
if test -z "$nativeTools"; then
|
||||
echo $clang $binutils $libc > $out/nix-support/propagated-user-env-packages
|
||||
fi
|
||||
|
||||
echo $extraPackages > $out/nix-support/propagated-native-build-inputs
|
||||
|
|
|
@ -79,11 +79,6 @@ if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then
|
|||
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE --sysroot=/var/empty"
|
||||
fi
|
||||
|
||||
if test -n "@libcxx@"; then
|
||||
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem@libcxx@/include/c++/v1 -stdlib=libc++"
|
||||
NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L@libcxx@/lib -stdlib=libc++ -L@libcxxabi@/lib"
|
||||
fi
|
||||
|
||||
# Add the flags for the C compiler proper.
|
||||
extraAfter=($NIX_CFLAGS_COMPILE)
|
||||
extraBefore=()
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
|
||||
, clang ? null, libc ? null, binutils ? null, coreutils ? null, shell ? ""
|
||||
, zlib ? null, libcxx ? null
|
||||
, zlib ? null, extraPackages ? []
|
||||
}:
|
||||
|
||||
assert nativeTools -> nativePrefix != "";
|
||||
|
@ -35,9 +35,7 @@ stdenv.mkDerivation {
|
|||
utils = ../gcc-wrapper/utils.sh;
|
||||
addFlags = ./add-flags;
|
||||
|
||||
inherit nativeTools nativeLibc nativePrefix clang clangVersion libcxx;
|
||||
|
||||
libcxxabi = libcxx.abi or null;
|
||||
inherit nativeTools nativeLibc nativePrefix clang clangVersion extraPackages;
|
||||
|
||||
gcc = clang.gcc;
|
||||
libc = if nativeLibc then null else libc;
|
||||
|
|
|
@ -29,6 +29,8 @@ stdenv.mkDerivation rec {
|
|||
# Remove a Makefile that causes many retained dependencies.
|
||||
postInstall = "rm $out/include/c++/v1/Makefile";
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
meta = {
|
||||
homepage = http://libcxx.llvm.org/;
|
||||
description = "A new implementation of the C++ standard library, targeting C++11";
|
||||
|
|
2
pkgs/development/libraries/libc++/setup-hook.sh
Normal file
2
pkgs/development/libraries/libc++/setup-hook.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem @out@/include/c++/v1 -stdlib=libc++"
|
||||
NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -stdlib=libc++"
|
|
@ -28,11 +28,12 @@ import ../generic rec {
|
|||
nativeTools = false;
|
||||
nativeLibc = true;
|
||||
inherit stdenv;
|
||||
libcxx = if haveLibCxx then pkgs.libcxx.override {
|
||||
libcxxabi = pkgs.libcxxabi.override {
|
||||
libunwind = pkgs.libunwindNative;
|
||||
};
|
||||
} else null;
|
||||
extraPackages =
|
||||
stdenv.lib.optional haveLibCxx (pkgs.libcxx.override {
|
||||
libcxxabi = pkgs.libcxxabi.override {
|
||||
libunwind = pkgs.libunwindNative;
|
||||
};
|
||||
});
|
||||
binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;};
|
||||
clang = if useClang33 then pkgs.clang_33.clang else pkgs.clang.clang;
|
||||
coreutils = pkgs.coreutils;
|
||||
|
|
Loading…
Reference in a new issue