summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2016-02-12 12:09:29 -0500
committerErik Schnetter <schnetter@gmail.com>2016-02-13 14:54:18 -0500
commitdc6a33b716dd6712da2e65a78a6a3ed98ca72d4d (patch)
tree72dedfab5c810f461087e5d17282e1e2953031fc /lib
parent5038a38e296940f463c13d6fdda728d8673bc95a (diff)
downloadspack-dc6a33b716dd6712da2e65a78a6a3ed98ca72d4d.tar.gz
spack-dc6a33b716dd6712da2e65a78a6a3ed98ca72d4d.tar.bz2
spack-dc6a33b716dd6712da2e65a78a6a3ed98ca72d4d.tar.xz
spack-dc6a33b716dd6712da2e65a78a6a3ed98ca72d4d.zip
Handle multiple -Wl,-rpath,... paths
Diffstat (limited to 'lib')
-rwxr-xr-xlib/spack/env/cc23
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/spack/env/cc b/lib/spack/env/cc
index aacba996b3..c156b7b607 100755
--- a/lib/spack/env/cc
+++ b/lib/spack/env/cc
@@ -176,14 +176,21 @@ while [ -n "$1" ]; do
-Wl,*)
arg="${1#-Wl,}"
if [ -z "$arg" ]; then shift; arg="$1"; fi
- if [[ "$arg" = -rpath=* ]]; then
- rpaths+=("${arg#-rpath=}")
- elif [[ "$arg" = -rpath ]]; then
+ if [[ $arg = -rpath=* ]]; then
+ arg="${arg#-rpath=}"
+ for rpath in ${arg//,/ }; do
+ rpaths+=("$rpath")
+ done
+ elif [[ $arg = -rpath ]]; then
shift; arg="$1"
- if [[ "$arg" != -Wl,* ]]; then
+ if [[ $arg != -Wl,* ]]; then
die "-Wl,-rpath was not followed by -Wl,*"
fi
- rpaths+=("${arg#-Wl,}")
+ # TODO: Handle multiple -Wl, continuations of -Wl,-rpath
+ arg="${arg#-Wl,}"
+ for rpath in ${arg//,/ }; do
+ rpaths+=("$rpath")
+ done
else
other_args+=("-Wl,$arg")
fi
@@ -191,11 +198,11 @@ while [ -n "$1" ]; do
-Xlinker,*)
arg="${1#-Xlinker,}"
if [ -z "$arg" ]; then shift; arg="$1"; fi
- if [[ "$arg" = -rpath=* ]]; then
+ if [[ $arg = -rpath=* ]]; then
rpaths+=("${arg#-rpath=}")
- elif [[ "$arg" = -rpath ]]; then
+ elif [[ $arg = -rpath ]]; then
shift; arg="$1"
- if [[ "$arg" != -Xlinker,* ]]; then
+ if [[ $arg != -Xlinker,* ]]; then
die "-Xlinker,-rpath was not followed by -Xlinker,*"
fi
rpaths+=("${arg#-Xlinker,}")