More quoting experiments

This commit is contained in:
Erik Schnetter 2016-02-14 10:43:55 -05:00
parent 43670cbbd0
commit a06e29fecb

8
lib/spack/env/cc vendored
View file

@ -175,22 +175,22 @@ while [ -n "$1" ]; do
;; ;;
-Wl,*) -Wl,*)
arg="${1#-Wl,}" arg="${1#-Wl,}"
if [[ $arg = "-rpath=*" ]]; then # TODO: Handle multiple -Wl, continuations of -Wl,-rpath
if [[ $arg == '-rpath='* ]]; then
arg="${arg#-rpath=}" arg="${arg#-rpath=}"
for rpath in ${arg//,/ }; do for rpath in ${arg//,/ }; do
rpaths+=("$rpath") rpaths+=("$rpath")
done done
elif [[ $arg = "-rpath,*" ]]; then elif [[ $arg == '-rpath,'* ]]; then
arg="${arg#-rpath,}" arg="${arg#-rpath,}"
for rpath in ${arg//,/ }; do for rpath in ${arg//,/ }; do
rpaths+=("$rpath") rpaths+=("$rpath")
done done
elif [[ $arg = "-rpath" ]]; then elif [[ $arg == '-rpath' ]]; then
shift; arg="$1" shift; arg="$1"
if [[ $arg != "-Wl,*" ]]; then if [[ $arg != "-Wl,*" ]]; then
die "-Wl,-rpath was not followed by -Wl,*" die "-Wl,-rpath was not followed by -Wl,*"
fi fi
# TODO: Handle multiple -Wl, continuations of -Wl,-rpath
arg="${arg#-Wl,}" arg="${arg#-Wl,}"
for rpath in ${arg//,/ }; do for rpath in ${arg//,/ }; do
rpaths+=("$rpath") rpaths+=("$rpath")