Convert =
to ==
in tests; untabify
This commit is contained in:
parent
7bc28cc334
commit
83d6e04d39
34
lib/spack/env/cc
vendored
34
lib/spack/env/cc
vendored
@ -119,7 +119,7 @@ esac
|
|||||||
# libraries.
|
# libraries.
|
||||||
if [[ -z $mode ]]; then
|
if [[ -z $mode ]]; then
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
if [[ $arg = -v || $arg = -V || $arg = --version || $arg = -dumpversion ]]; then
|
if [[ $arg == -v || $arg == -V || $arg == --version || $arg == -dumpversion ]]; then
|
||||||
mode=vcheck
|
mode=vcheck
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -130,13 +130,13 @@ fi
|
|||||||
if [[ -z $mode ]]; then
|
if [[ -z $mode ]]; then
|
||||||
mode=ccld
|
mode=ccld
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
if [[ $arg = -E ]]; then
|
if [[ $arg == -E ]]; then
|
||||||
mode=cpp
|
mode=cpp
|
||||||
break
|
break
|
||||||
elif [[ $arg = -S ]]; then
|
elif [[ $arg == -S ]]; then
|
||||||
mode=as
|
mode=as
|
||||||
break
|
break
|
||||||
elif [[ $arg = -c ]]; then
|
elif [[ $arg == -c ]]; then
|
||||||
mode=cc
|
mode=cc
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -144,7 +144,7 @@ if [[ -z $mode ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Dump the version and exit if we're in testing mode.
|
# Dump the version and exit if we're in testing mode.
|
||||||
if [[ $SPACK_TEST_COMMAND = dump-mode ]]; then
|
if [[ $SPACK_TEST_COMMAND == dump-mode ]]; then
|
||||||
echo "$mode"
|
echo "$mode"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
@ -163,9 +163,9 @@ fi
|
|||||||
# It doesn't work with -rpath.
|
# It doesn't work with -rpath.
|
||||||
# This variable controls whether they are added.
|
# This variable controls whether they are added.
|
||||||
add_rpaths=true
|
add_rpaths=true
|
||||||
if [[ mode = ld && $OSTYPE = darwin* ]]; then
|
if [[ mode == ld && $OSTYPE == darwin* ]]; then
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
if [[ $arg = -r ]]; then
|
if [[ $arg == -r ]]; then
|
||||||
add_rpaths=false
|
add_rpaths=false
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -181,17 +181,17 @@ IFS=':' read -ra deps <<< "$SPACK_DEPENDENCIES"
|
|||||||
for dep in "${deps[@]}"; do
|
for dep in "${deps[@]}"; do
|
||||||
# Prepend include directories
|
# Prepend include directories
|
||||||
if [[ -d $dep/include ]]; then
|
if [[ -d $dep/include ]]; then
|
||||||
if [[ $mode = cpp || $mode = cc || $mode = as || $mode = ccld ]]; then
|
if [[ $mode == cpp || $mode == cc || $mode == as || $mode == ccld ]]; then
|
||||||
args=("-I$dep/include" "${args[@]}")
|
args=("-I$dep/include" "${args[@]}")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prepend lib and RPATH directories
|
# Prepend lib and RPATH directories
|
||||||
if [[ -d $dep/lib ]]; then
|
if [[ -d $dep/lib ]]; then
|
||||||
if [[ $mode = ccld ]]; then
|
if [[ $mode == ccld ]]; then
|
||||||
$add_rpaths && args=("-Wl,-rpath,$dep/lib" "${args[@]}")
|
$add_rpaths && args=("-Wl,-rpath,$dep/lib" "${args[@]}")
|
||||||
args=("-L$dep/lib" "${args[@]}")
|
args=("-L$dep/lib" "${args[@]}")
|
||||||
elif [[ $mode = ld ]]; then
|
elif [[ $mode == ld ]]; then
|
||||||
$add_rpaths && args=("-rpath" "$dep/lib" "${args[@]}")
|
$add_rpaths && args=("-rpath" "$dep/lib" "${args[@]}")
|
||||||
args=("-L$dep/lib" "${args[@]}")
|
args=("-L$dep/lib" "${args[@]}")
|
||||||
fi
|
fi
|
||||||
@ -199,10 +199,10 @@ for dep in "${deps[@]}"; do
|
|||||||
|
|
||||||
# Prepend lib64 and RPATH directories
|
# Prepend lib64 and RPATH directories
|
||||||
if [[ -d $dep/lib64 ]]; then
|
if [[ -d $dep/lib64 ]]; then
|
||||||
if [[ $mode = ccld ]]; then
|
if [[ $mode == ccld ]]; then
|
||||||
$add_rpaths && args=("-Wl,-rpath,$dep/lib64" "${args[@]}")
|
$add_rpaths && args=("-Wl,-rpath,$dep/lib64" "${args[@]}")
|
||||||
args=("-L$dep/lib64" "${args[@]}")
|
args=("-L$dep/lib64" "${args[@]}")
|
||||||
elif [[ $mode = ld ]]; then
|
elif [[ $mode == ld ]]; then
|
||||||
$add_rpaths && args=("-rpath" "$dep/lib64" "${args[@]}")
|
$add_rpaths && args=("-rpath" "$dep/lib64" "${args[@]}")
|
||||||
args=("-L$dep/lib64" "${args[@]}")
|
args=("-L$dep/lib64" "${args[@]}")
|
||||||
fi
|
fi
|
||||||
@ -210,9 +210,9 @@ for dep in "${deps[@]}"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Include all -L's and prefix/whatever dirs in rpath
|
# Include all -L's and prefix/whatever dirs in rpath
|
||||||
if [[ $mode = ccld ]]; then
|
if [[ $mode == ccld ]]; then
|
||||||
$add_rpaths && args=("-Wl,-rpath,$SPACK_PREFIX/lib" "-Wl,-rpath,$SPACK_PREFIX/lib64" "${args[@]}")
|
$add_rpaths && args=("-Wl,-rpath,$SPACK_PREFIX/lib" "-Wl,-rpath,$SPACK_PREFIX/lib64" "${args[@]}")
|
||||||
elif [[ $mode = ld ]]; then
|
elif [[ $mode == ld ]]; then
|
||||||
$add_rpaths && args=("-rpath" "$SPACK_PREFIX/lib" "-rpath" "$SPACK_PREFIX/lib64" "${args[@]}")
|
$add_rpaths && args=("-rpath" "$SPACK_PREFIX/lib" "-rpath" "$SPACK_PREFIX/lib64" "${args[@]}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ PATH=""
|
|||||||
for dir in "${env_path[@]}"; do
|
for dir in "${env_path[@]}"; do
|
||||||
addpath=true
|
addpath=true
|
||||||
for env_dir in "${spack_env_dirs[@]}"; do
|
for env_dir in "${spack_env_dirs[@]}"; do
|
||||||
if [[ $dir = $env_dir ]]; then
|
if [[ $dir == $env_dir ]]; then
|
||||||
addpath=false
|
addpath=false
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -248,7 +248,7 @@ export PATH
|
|||||||
full_command=("$command" "${args[@]}")
|
full_command=("$command" "${args[@]}")
|
||||||
|
|
||||||
# In test command mode, write out full command for Spack tests.
|
# In test command mode, write out full command for Spack tests.
|
||||||
if [[ $SPACK_TEST_COMMAND = dump-args ]]; then
|
if [[ $SPACK_TEST_COMMAND == dump-args ]]; then
|
||||||
echo "${full_command[@]}"
|
echo "${full_command[@]}"
|
||||||
exit
|
exit
|
||||||
elif [[ -n $SPACK_TEST_COMMAND ]]; then
|
elif [[ -n $SPACK_TEST_COMMAND ]]; then
|
||||||
@ -258,7 +258,7 @@ fi
|
|||||||
#
|
#
|
||||||
# Write the input and output commands to debug logs if it's asked for.
|
# Write the input and output commands to debug logs if it's asked for.
|
||||||
#
|
#
|
||||||
if [[ $SPACK_DEBUG = TRUE ]]; then
|
if [[ $SPACK_DEBUG == TRUE ]]; then
|
||||||
input_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.in.log"
|
input_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.in.log"
|
||||||
output_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.out.log"
|
output_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_SHORT_SPEC.out.log"
|
||||||
echo "[$mode] $command $input_command" >> $input_log
|
echo "[$mode] $command $input_command" >> $input_log
|
||||||
|
Loading…
Reference in New Issue
Block a user