diff options
Diffstat (limited to 'pkgs/build-support/gcc-wrapper/builder.sh')
-rw-r--r-- | pkgs/build-support/gcc-wrapper/builder.sh | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh index f9dbc0e784f..7a2f9c20f27 100644 --- a/pkgs/build-support/gcc-wrapper/builder.sh +++ b/pkgs/build-support/gcc-wrapper/builder.sh @@ -50,14 +50,17 @@ fi doSubstitute() { local src=$1 local dst=$2 - substitute "$src" "$dst" \ - --subst-var "out" \ - --subst-var "shell" \ - --subst-var "gcc" \ - --subst-var "gccProg" \ - --subst-var "binutils" \ - --subst-var "libc" \ - --subst-var-by "ld" "$ldPath/ld" + # 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^@gcc@^$gcc^g" \ + -e "s^@gccProg@^$gccProg^g" \ + -e "s^@binutils@^$binutils^g" \ + -e "s^@libc@^$libc^g" \ + -e "s^@ld@^$ldPath/ld^g" \ + < "$src" > "$dst" } @@ -108,3 +111,11 @@ doSubstitute "$addFlags" "$out/nix-support/add-flags.sh" doSubstitute "$setupHook" "$out/nix-support/setup-hook" cp -p $utils $out/nix-support/utils.sh + + +# Propagate the wrapped gcc so that if you install the wrapper, you get +# tools like gcov, the manpages, etc. as well (including for binutils +# and Glibc). +if test -z "$nativeTools"; then + echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages +fi |