From 7dc57a389e3d3eb5b5e8de3b02dfe469496fad1a Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 16 Jan 2015 10:50:53 -0500 Subject: [PATCH] cc-wrapper: Set CC/CXX more specifically if possible --- pkgs/build-support/cc-wrapper/default.nix | 6 ++++++ pkgs/build-support/cc-wrapper/setup-hook.sh | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index abbba31641b3..3f8c3de6a2f3 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -160,12 +160,18 @@ stdenv.mkDerivation { wrap ld.bfd ${./ld-wrapper.sh} $binutils/bin/ld.bfd fi + export real_cc=cc + export real_cxx=c++ if [ -e $ccPath/gcc ]; then wrap gcc ${./cc-wrapper.sh} $ccPath/gcc ln -s gcc $out/bin/cc + export real_cc=gcc + export real_cxx=g++ elif [ -e $ccPath/clang ]; then wrap clang ${./cc-wrapper.sh} $ccPath/clang ln -s clang $out/bin/cc + export real_cc=clang + export real_cxx=clang++ fi if [ -e $ccPath/g++ ]; then diff --git a/pkgs/build-support/cc-wrapper/setup-hook.sh b/pkgs/build-support/cc-wrapper/setup-hook.sh index 218899e9d8fc..cd98f57ee937 100644 --- a/pkgs/build-support/cc-wrapper/setup-hook.sh +++ b/pkgs/build-support/cc-wrapper/setup-hook.sh @@ -34,5 +34,5 @@ if [ -n "@coreutils@" ]; then addToSearchPath PATH @coreutils@/bin fi -export CC=cc -export CXX=c++ +export CC=@real_cc@ +export CXX=@real_cxx@