gcc-wrapper: Style fix

This commit is contained in:
Eelco Dolstra 2014-10-10 14:25:23 +02:00
parent ffbdcbfe29
commit 02122ccfd0
7 changed files with 94 additions and 94 deletions

View File

@ -1,27 +1,27 @@
# `-B@out@/bin' forces gcc to use ld-wrapper.sh when calling ld. # `-B@out@/bin' forces gcc to use ld-wrapper.sh when calling ld.
export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE" export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE"
if test -e @out@/nix-support/libc-cflags; then if [ -e @out@/nix-support/libc-cflags ]; then
export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE" export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE"
fi fi
if test -e @out@/nix-support/gcc-cflags; then if [ -e @out@/nix-support/gcc-cflags ]; then
export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE" export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE"
fi fi
if test -e @out@/nix-support/gnat-cflags; then if [ -e @out@/nix-support/gnat-cflags ]; then
export NIX_GNATFLAGS_COMPILE="$(cat @out@/nix-support/gnat-cflags) $NIX_GNATFLAGS_COMPILE" export NIX_GNATFLAGS_COMPILE="$(cat @out@/nix-support/gnat-cflags) $NIX_GNATFLAGS_COMPILE"
fi fi
if test -e @out@/nix-support/libc-ldflags; then if [ -e @out@/nix-support/libc-ldflags ]; then
export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/libc-ldflags)" export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/libc-ldflags)"
fi fi
if test -e @out@/nix-support/gcc-ldflags; then if [ -e @out@/nix-support/gcc-ldflags ]; then
export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/gcc-ldflags)" export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/gcc-ldflags)"
fi fi
if test -e @out@/nix-support/libc-ldflags-before; then if [ -e @out@/nix-support/libc-ldflags-before ]; then
export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE" export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE"
fi fi

View File

@ -1,10 +1,10 @@
#! @shell@ -e #! @shell@ -e
if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then if [ -n "$NIX_GCC_WRAPPER_START_HOOK" ]; then
source "$NIX_GCC_WRAPPER_START_HOOK" source "$NIX_GCC_WRAPPER_START_HOOK"
fi fi
if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then if [ -z "$NIX_GCC_WRAPPER_FLAGS_SET" ]; then
source @out@/nix-support/add-flags.sh source @out@/nix-support/add-flags.sh
fi fi
@ -18,26 +18,26 @@ getVersion=0
nonFlagArgs=0 nonFlagArgs=0
for i in "$@"; do for i in "$@"; do
if test "$i" = "-c"; then if [ "$i" = -c ]; then
dontLink=1 dontLink=1
elif test "$i" = "-S"; then elif [ "$i" = -S ]; then
dontLink=1 dontLink=1
elif test "$i" = "-E"; then elif [ "$i" = -E ]; then
dontLink=1 dontLink=1
elif test "$i" = "-E"; then elif [ "$i" = -E ]; then
dontLink=1 dontLink=1
elif test "$i" = "-M"; then elif [ "$i" = -M ]; then
dontLink=1 dontLink=1
elif test "$i" = "-MM"; then elif [ "$i" = -MM ]; then
dontLink=1 dontLink=1
elif test "$i" = "-x"; then elif [ "$i" = -x ]; then
# At least for the cases c-header or c++-header we should set dontLink. # At least for the cases c-header or c++-header we should set dontLink.
# I expect no one use -x other than making precompiled headers. # I expect no one use -x other than making precompiled headers.
dontLink=1 dontLink=1
elif test "${i:0:1}" != "-"; then elif [ "${i:0:1}" != - ]; then
nonFlagArgs=1 nonFlagArgs=1
elif test "$i" = "-m32"; then elif [ "$i" = -m32 ]; then
if test -e @out@/nix-support/dynamic-linker-m32; then if [ -e @out@/nix-support/dynamic-linker-m32 ]; then
NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)"
fi fi
fi fi
@ -48,28 +48,28 @@ done
# "-c" flag). So if no non-flag arguments are given, don't pass any # "-c" flag). So if no non-flag arguments are given, don't pass any
# linker flags. This catches cases like "gcc" (should just print # linker flags. This catches cases like "gcc" (should just print
# "gcc: no input files") and "gcc -v" (should print the version). # "gcc: no input files") and "gcc -v" (should print the version).
if test "$nonFlagArgs" = "0"; then if [ "$nonFlagArgs" = 0 ]; then
dontLink=1 dontLink=1
fi fi
# Optionally filter out paths not refering to the store. # Optionally filter out paths not refering to the store.
params=("$@") params=("$@")
if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then
rest=() rest=()
n=0 n=0
while test $n -lt ${#params[*]}; do while [ $n -lt ${#params[*]} ]; do
p=${params[n]} p=${params[n]}
p2=${params[$((n+1))]} p2=${params[$((n+1))]}
if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then
skip $p skip $p
elif test "$p" = "-L" && badPath "$p2"; then elif [ "$p" = -L ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then elif [ "${p:0:3}" = -I/ ] && badPath "${p:2}"; then
skip $p skip $p
elif test "$p" = "-I" && badPath "$p2"; then elif [ "$p" = -I ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
elif test "$p" = "-isystem" && badPath "$p2"; then elif [ "$p" = -isystem ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
else else
rest=("${rest[@]}" "$p") rest=("${rest[@]}" "$p")
@ -86,14 +86,14 @@ extraBefore=()
# When enforcing purity, pretend gcc can't find the current date and # When enforcing purity, pretend gcc can't find the current date and
# time # time
if test "$NIX_ENFORCE_PURITY" = "1"; then if [ "$NIX_ENFORCE_PURITY" = 1 ]; then
extraAfter+=('-D__DATE__="Jan 01 1970"' extraAfter+=('-D__DATE__="Jan 01 1970"'
'-D__TIME__="00:00:01"' '-D__TIME__="00:00:01"'
-Wno-builtin-macro-redefined) -Wno-builtin-macro-redefined)
fi fi
if test "$dontLink" != "1"; then if [ "$dontLink" != 1 ]; then
# Add the flags that should only be passed to the compiler when # Add the flags that should only be passed to the compiler when
# linking. # linking.
@ -105,11 +105,11 @@ if test "$dontLink" != "1"; then
extraBefore=(${extraBefore[@]} "-Wl,$i") extraBefore=(${extraBefore[@]} "-Wl,$i")
done done
for i in $NIX_LDFLAGS; do for i in $NIX_LDFLAGS; do
if test "${i:0:3}" = "-L/"; then if [ "${i:0:3}" = -L/ ]; then
extraAfter+=("$i") extraAfter+=("$i")
else else
extraAfter+=("-Wl,$i") extraAfter+=("-Wl,$i")
fi fi
done done
export NIX_LDFLAGS_SET=1 export NIX_LDFLAGS_SET=1
fi fi
@ -118,13 +118,13 @@ fi
# add anything. This is to prevent `gcc -v' (which normally prints # add anything. This is to prevent `gcc -v' (which normally prints
# out the version number and returns exit code 0) from printing out # out the version number and returns exit code 0) from printing out
# `No input files specified' and returning exit code 1. # `No input files specified' and returning exit code 1.
if test "$*" = "-v"; then if [ "$*" = -v ]; then
extraAfter=() extraAfter=()
extraBefore=() extraBefore=()
fi fi
# Optionally print debug info. # Optionally print debug info.
if test "$NIX_DEBUG" = "1"; then if [ -n "$NIX_DEBUG" ]; then
echo "original flags to @prog@:" >&2 echo "original flags to @prog@:" >&2
for i in "${params[@]}"; do for i in "${params[@]}"; do
echo " $i" >&2 echo " $i" >&2
@ -139,7 +139,7 @@ if test "$NIX_DEBUG" = "1"; then
done done
fi fi
if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then if [ -n "$NIX_GCC_WRAPPER_EXEC_HOOK" ]; then
source "$NIX_GCC_WRAPPER_EXEC_HOOK" source "$NIX_GCC_WRAPPER_EXEC_HOOK"
fi fi

View File

@ -1,10 +1,10 @@
#! @shell@ -e #! @shell@ -e
if test -n "$NIX_GNAT_WRAPPER_START_HOOK"; then if [ -n "$NIX_GNAT_WRAPPER_START_HOOK" ]; then
source "$NIX_GNAT_WRAPPER_START_HOOK" source "$NIX_GNAT_WRAPPER_START_HOOK"
fi fi
if test -z "$NIX_GNAT_WRAPPER_FLAGS_SET"; then if [ -z "$NIX_GNAT_WRAPPER_FLAGS_SET" ]; then
source @out@/nix-support/add-flags.sh source @out@/nix-support/add-flags.sh
fi fi
@ -18,14 +18,14 @@ getVersion=0
nonFlagArgs=0 nonFlagArgs=0
for i in "$@"; do for i in "$@"; do
if test "$i" = "-c"; then if [ "$i" = -c ]; then
dontLink=1 dontLink=1
elif test "$i" = "-M"; then elif [ "$i" = -M ]; then
dontLink=1 dontLink=1
elif test "${i:0:1}" != "-"; then elif [ "${i:0:1}" != - ]; then
nonFlagArgs=1 nonFlagArgs=1
elif test "$i" = "-m32"; then elif [ "$i" = -m32 ]; then
if test -e @out@/nix-support/dynamic-linker-m32; then if [ -e @out@/nix-support/dynamic-linker-m32 ]; then
NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)"
fi fi
fi fi
@ -36,26 +36,26 @@ done
# "-c" flag). So if no non-flag arguments are given, don't pass any # "-c" flag). So if no non-flag arguments are given, don't pass any
# linker flags. This catches cases like "gcc" (should just print # linker flags. This catches cases like "gcc" (should just print
# "gcc: no input files") and "gcc -v" (should print the version). # "gcc: no input files") and "gcc -v" (should print the version).
if test "$nonFlagArgs" = "0"; then if [ "$nonFlagArgs" = 0 ]; then
dontLink=1 dontLink=1
fi fi
# Optionally filter out paths not refering to the store. # Optionally filter out paths not refering to the store.
params=("$@") params=("$@")
if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then
rest=() rest=()
n=0 n=0
while test $n -lt ${#params[*]}; do while [ $n -lt ${#params[*]} ]; do
p=${params[n]} p=${params[n]}
p2=${params[$((n+1))]} p2=${params[$((n+1))]}
if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then
skip $p skip $p
elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then elif [ "${p:0:3}" = -I/ ] && badPath "${p:2}"; then
skip $p skip $p
elif test "${p:0:4}" = "-aI/" && badPath "${p:3}"; then elif [ "${p:0:4}" = -aI/ ] && badPath "${p:3}"; then
skip $p skip $p
elif test "${p:0:4}" = "-aO/" && badPath "${p:3}"; then elif [ "${p:0:4}" = -aO/ ] && badPath "${p:3}"; then
skip $p skip $p
else else
rest=("${rest[@]}" "$p") rest=("${rest[@]}" "$p")
@ -81,7 +81,7 @@ fi
#done #done
# Optionally print debug info. # Optionally print debug info.
if test "$NIX_DEBUG" = "1"; then if [ -n "$NIX_DEBUG" ]; then
echo "original flags to @prog@:" >&2 echo "original flags to @prog@:" >&2
for i in "${params[@]}"; do for i in "${params[@]}"; do
echo " $i" >&2 echo " $i" >&2
@ -96,7 +96,7 @@ if test "$NIX_DEBUG" = "1"; then
done done
fi fi
if test -n "$NIX_GNAT_WRAPPER_EXEC_HOOK"; then if [ -n "$NIX_GNAT_WRAPPER_EXEC_HOOK" ]; then
source "$NIX_GNAT_WRAPPER_EXEC_HOOK" source "$NIX_GNAT_WRAPPER_EXEC_HOOK"
fi fi

View File

@ -11,7 +11,7 @@ extraBefore=()
#done #done
# Optionally print debug info. # Optionally print debug info.
if test "$NIX_DEBUG" = "1"; then if [ -n "$NIX_DEBUG" ]; then
echo "original flags to @prog@:" >&2 echo "original flags to @prog@:" >&2
for i in "$@"; do for i in "$@"; do
echo " $i" >&2 echo " $i" >&2
@ -26,7 +26,7 @@ if test "$NIX_DEBUG" = "1"; then
done done
fi fi
if test -n "$NIX_GNAT_WRAPPER_EXEC_HOOK"; then if [ -n "$NIX_GNAT_WRAPPER_EXEC_HOOK" ]; then
source "$NIX_GNAT_WRAPPER_EXEC_HOOK" source "$NIX_GNAT_WRAPPER_EXEC_HOOK"
fi fi

View File

@ -1,10 +1,10 @@
#! @shell@ -e #! @shell@ -e
if test -n "$NIX_LD_WRAPPER_START_HOOK"; then if [ -n "$NIX_LD_WRAPPER_START_HOOK" ]; then
source "$NIX_LD_WRAPPER_START_HOOK" source "$NIX_LD_WRAPPER_START_HOOK"
fi fi
if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then if [ -z "$NIX_GCC_WRAPPER_FLAGS_SET" ]; then
source @out@/nix-support/add-flags.sh source @out@/nix-support/add-flags.sh
fi fi
@ -13,26 +13,26 @@ source @out@/nix-support/utils.sh
# Optionally filter out paths not refering to the store. # Optionally filter out paths not refering to the store.
params=("$@") params=("$@")
if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \ if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" \
-a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \); then -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \) ]; then
rest=() rest=()
n=0 n=0
while test $n -lt ${#params[*]}; do while [ $n -lt ${#params[*]} ]; do
p=${params[n]} p=${params[n]}
p2=${params[$((n+1))]} p2=${params[$((n+1))]}
if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then
skip $p skip $p
elif test "$p" = "-L" && badPath "$p2"; then elif [ "$p" = -L ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
elif test "$p" = "-rpath" && badPath "$p2"; then elif [ "$p" = -rpath ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
elif test "$p" = "-dynamic-linker" && badPath "$p2"; then elif [ "$p" = -dynamic-linker ] && badPath "$p2"; then
n=$((n + 1)); skip $p2 n=$((n + 1)); skip $p2
elif test "${p:0:1}" = "/" && badPath "$p"; then elif [ "${p:0:1}" = / ] && badPath "$p"; then
# We cannot skip this; barf. # We cannot skip this; barf.
echo "impure path \`$p' used in link" >&2 echo "impure path \`$p' used in link" >&2
exit 1 exit 1
elif test "${p:0:9}" = "--sysroot"; then elif [ "${p:0:9}" = --sysroot ]; then
# Our ld is not built with sysroot support (Can we fix that?) # Our ld is not built with sysroot support (Can we fix that?)
: :
else else
@ -47,7 +47,7 @@ fi
extra=() extra=()
extraBefore=() extraBefore=()
if test -z "$NIX_LDFLAGS_SET"; then if [ -z "$NIX_LDFLAGS_SET" ]; then
extra+=($NIX_LDFLAGS) extra+=($NIX_LDFLAGS)
extraBefore+=($NIX_LDFLAGS_BEFORE) extraBefore+=($NIX_LDFLAGS_BEFORE)
fi fi
@ -56,12 +56,12 @@ extra+=($NIX_LDFLAGS_AFTER)
# Add all used dynamic libraries to the rpath. # Add all used dynamic libraries to the rpath.
if test "$NIX_DONT_SET_RPATH" != "1"; then if [ "$NIX_DONT_SET_RPATH" != 1 ]; then
libPath="" libPath=""
addToLibPath() { addToLibPath() {
local path="$1" local path="$1"
if test "${path:0:1}" != "/"; then return 0; fi if [ "${path:0:1}" != / ]; then return 0; fi
case "$path" in case "$path" in
*..*|*./*|*/.*|*//*) *..*|*./*|*/.*|*//*)
local path2 local path2
@ -75,12 +75,12 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then
esac esac
libPath="$libPath $path " libPath="$libPath $path "
} }
addToRPath() { addToRPath() {
# If the path is not in the store, don't add it to the rpath. # If the path is not in the store, don't add it to the rpath.
# This typically happens for libraries in /tmp that are later # This typically happens for libraries in /tmp that are later
# copied to $out/lib. If not, we're screwed. # copied to $out/lib. If not, we're screwed.
if test "${1:0:${#NIX_STORE}}" != "$NIX_STORE"; then return 0; fi if [ "${1:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then return 0; fi
case $rpath in case $rpath in
*\ $1\ *) return 0 ;; *\ $1\ *) return 0 ;;
esac esac
@ -97,21 +97,21 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then
# First, find all -L... switches. # First, find all -L... switches.
allParams=("${params[@]}" ${extra[@]}) allParams=("${params[@]}" ${extra[@]})
n=0 n=0
while test $n -lt ${#allParams[*]}; do while [ $n -lt ${#allParams[*]} ]; do
p=${allParams[n]} p=${allParams[n]}
p2=${allParams[$((n+1))]} p2=${allParams[$((n+1))]}
if test "${p:0:3}" = "-L/"; then if [ "${p:0:3}" = -L/ ]; then
addToLibPath ${p:2} addToLibPath ${p:2}
elif test "$p" = "-L"; then elif [ "$p" = -L ]; then
addToLibPath ${p2} addToLibPath ${p2}
n=$((n + 1)) n=$((n + 1))
elif test "$p" = "-l"; then elif [ "$p" = -l ]; then
addToLibs ${p2} addToLibs ${p2}
n=$((n + 1)) n=$((n + 1))
elif test "${p:0:2}" = "-l"; then elif [ "${p:0:2}" = -l ]; then
addToLibs ${p:2} addToLibs ${p:2}
elif test "$p" = "-dynamic-linker"; then elif [ "$p" = -dynamic-linker ]; then
# Ignore the dynamic linker argument, or it # Ignore the dynamic linker argument, or it
# will get into the next 'elif'. We don't want # will get into the next 'elif'. We don't want
# the dynamic linker path rpath to go always first. # the dynamic linker path rpath to go always first.
n=$((n + 1)) n=$((n + 1))
@ -129,16 +129,16 @@ if test "$NIX_DONT_SET_RPATH" != "1"; then
# so, add the directory to the rpath. # so, add the directory to the rpath.
# It's important to add the rpath in the order of -L..., so # It's important to add the rpath in the order of -L..., so
# the link time chosen objects will be those of runtime linking. # the link time chosen objects will be those of runtime linking.
for i in $libPath; do for i in $libPath; do
for j in $libs; do for j in $libs; do
if test -f "$i/lib$j.so"; then if [ -f "$i/lib$j.so" ]; then
addToRPath $i addToRPath $i
break break
fi fi
done done
done done
# Finally, add `-rpath' switches. # Finally, add `-rpath' switches.
for i in $rpath; do for i in $rpath; do
@ -148,7 +148,7 @@ fi
# Optionally print debug info. # Optionally print debug info.
if test "$NIX_DEBUG" = "1"; then if [ -n "$NIX_DEBUG" ]; then
echo "original flags to @prog@:" >&2 echo "original flags to @prog@:" >&2
for i in "${params[@]}"; do for i in "${params[@]}"; do
echo " $i" >&2 echo " $i" >&2
@ -159,7 +159,7 @@ if test "$NIX_DEBUG" = "1"; then
done done
fi fi
if test -n "$NIX_LD_WRAPPER_EXEC_HOOK"; then if [ -n "$NIX_LD_WRAPPER_EXEC_HOOK" ]; then
source "$NIX_LD_WRAPPER_EXEC_HOOK" source "$NIX_LD_WRAPPER_EXEC_HOOK"
fi fi

View File

@ -1,15 +1,15 @@
export NIX_GCC=@out@ export NIX_GCC=@out@
addCVars () { addCVars () {
if test -d $1/include; then if [ -d $1/include ]; then
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include" export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include"
fi fi
if test -d $1/lib64; then if [ -d $1/lib64 -a ! -L $1/lib64 ]; then
export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64" export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64"
fi fi
if test -d $1/lib; then if [ -d $1/lib ]; then
export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib" export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib"
fi fi
} }
@ -18,18 +18,18 @@ envHooks+=(addCVars)
# Note: these come *after* $out in the PATH (see setup.sh). # Note: these come *after* $out in the PATH (see setup.sh).
if test -n "@gcc@"; then if [ -n "@gcc@" ]; then
addToSearchPath PATH @gcc@/bin addToSearchPath PATH @gcc@/bin
fi fi
if test -n "@binutils@"; then if [ -n "@binutils@" ]; then
addToSearchPath PATH @binutils@/bin addToSearchPath PATH @binutils@/bin
fi fi
if test -n "@libc@"; then if [ -n "@libc@" ]; then
addToSearchPath PATH @libc@/bin addToSearchPath PATH @libc@/bin
fi fi
if test -n "@coreutils@"; then if [ -n "@coreutils@" ]; then
addToSearchPath PATH @coreutils@/bin addToSearchPath PATH @coreutils@/bin
fi fi

View File

@ -1,5 +1,5 @@
skip () { skip () {
if test "$NIX_DEBUG" = "1"; then if [ -n "$NIX_DEBUG" ]; then
echo "skipping impure path $1" >&2 echo "skipping impure path $1" >&2
fi fi
} }
@ -9,11 +9,11 @@ skip () {
# `/nix/store/.../lib/foo.so' isn't. # `/nix/store/.../lib/foo.so' isn't.
badPath() { badPath() {
local p=$1 local p=$1
# Relative paths are okay (since they're presumably relative to # Relative paths are okay (since they're presumably relative to
# the temporary build directory). # the temporary build directory).
if test "${p:0:1}" != "/"; then return 1; fi if [ "${p:0:1}" != / ]; then return 1; fi
# Otherwise, the path should refer to the store or some temporary # Otherwise, the path should refer to the store or some temporary
# directory (including the build directory). # directory (including the build directory).
test \ test \