cc-wrapper: Unconditionally use @infixSalt@ accross the board

This is basically a sed job, in preparation of the next commit. The
rules are more or less:

  - s"NIX_(.._WRAPPER_)?([a-zA-Z0-9@]*)"NIX_\1@infixSalt@_\2"g

  - except for non-cc-wrapper-specific vars like `NIX_DEBUG`
This commit is contained in:
John Ericson
2017-08-07 03:05:50 -04:00
parent 5ba3972add
commit 9f1e009975
6 changed files with 63 additions and 63 deletions
+12 -12
View File
@@ -10,11 +10,11 @@ if [ -n "@coreutils_bin@" ]; then
PATH="@coreutils_bin@/bin"
fi
if [ -n "$NIX_GNAT_WRAPPER_START_HOOK" ]; then
source "$NIX_GNAT_WRAPPER_START_HOOK"
if [ -n "$NIX_@infixSalt@_GNAT_WRAPPER_START_HOOK" ]; then
source "$NIX_@infixSalt@_GNAT_WRAPPER_START_HOOK"
fi
if [ -z "$NIX_GNAT_WRAPPER_FLAGS_SET" ]; then
if [ -z "$NIX_@infixSalt@_GNAT_WRAPPER_FLAGS_SET" ]; then
source @out@/nix-support/add-flags.sh
fi
@@ -35,7 +35,7 @@ for i in "$@"; do
nonFlagArgs=1
elif [ "$i" = -m32 ]; then
if [ -e @out@/nix-support/dynamic-linker-m32 ]; then
NIX_LDFLAGS+=" -dynamic-linker $(< @out@/nix-support/dynamic-linker-m32)"
NIX_@infixSalt@_LDFLAGS+=" -dynamic-linker $(< @out@/nix-support/dynamic-linker-m32)"
fi
fi
done
@@ -72,7 +72,7 @@ fi
# Clear march/mtune=native -- they bring impurity.
if [ "$NIX_ENFORCE_NO_NATIVE" = 1 ]; then
if [ "$NIX_@infixSalt@_ENFORCE_NO_NATIVE" = 1 ]; then
rest=()
for p in "${params[@]}"; do
if [[ "$p" = -m*=native ]]; then
@@ -86,7 +86,7 @@ fi
# Add the flags for the GNAT compiler proper.
extraAfter=($NIX_GNATFLAGS_COMPILE)
extraAfter=($NIX_@infixSalt@_GNATFLAGS_COMPILE)
extraBefore=()
if [ "$(basename "$0")x" = "gnatmakex" ]; then
@@ -95,18 +95,18 @@ fi
#if [ "$dontLink" != 1 ]; then
# # Add the flags that should be passed to the linker (and prevent
# # `ld-wrapper' from adding NIX_LDFLAGS again).
# for i in $NIX_LDFLAGS_BEFORE; do
# # `ld-wrapper' from adding NIX_@infixSalt@_LDFLAGS again).
# for i in $NIX_@infixSalt@_LDFLAGS_BEFORE; do
# extraBefore+=("-largs" "$i")
# done
# for i in $NIX_LDFLAGS; do
# for i in $NIX_@infixSalt@_LDFLAGS; do
# if [ "${i:0:3}" = -L/ ]; then
# extraAfter+=("$i")
# else
# extraAfter+=("-largs" "$i")
# fi
# done
# export NIX_LDFLAGS_SET=1
# export NIX_@infixSalt@_LDFLAGS_SET=1
#fi
# Optionally print debug info.
@@ -119,8 +119,8 @@ if [ -n "$NIX_DEBUG" ]; then
printf " %q\n" "${extraAfter[@]}" >&2
fi
if [ -n "$NIX_GNAT_WRAPPER_EXEC_HOOK" ]; then
source "$NIX_GNAT_WRAPPER_EXEC_HOOK"
if [ -n "$NIX_@infixSalt@_GNAT_WRAPPER_EXEC_HOOK" ]; then
source "$NIX_@infixSalt@_GNAT_WRAPPER_EXEC_HOOK"
fi
PATH="$path_backup"