summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/spack/env/cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/spack/env/cc b/lib/spack/env/cc
index a19346ce97..6b6073db43 100755
--- a/lib/spack/env/cc
+++ b/lib/spack/env/cc
@@ -113,14 +113,22 @@ case "$command" in
;;
esac
-# Finish setting up the mode.
+# If any of the arguments below is present then the mode is vcheck. In vcheck mode nothing is added in terms of extra search paths or libraries
if [ -z "$mode" ]; then
- mode=ccld
for arg in "$@"; do
if [ "$arg" = -v -o "$arg" = -V -o "$arg" = --version -o "$arg" = -dumpversion ]; then
mode=vcheck
break
- elif [ "$arg" = -E ]; then
+ fi
+ done
+fi
+
+# Finish setting up the mode.
+
+if [ -z "$mode" ]; then
+ mode=ccld
+ for arg in "$@"; do
+ if [ "$arg" = -E ]; then
mode=cpp
break
elif [ "$arg" = -c ]; then
@@ -145,6 +153,10 @@ fi
# Save original command for debug logging
input_command="$@"
+if [ "$mode" == vcheck ] ; then
+ exec "${input_command}"
+fi
+
#
# Now do real parsing of the command line args, trying hard to keep
# non-rpath linker arguments in the proper order w.r.t. other command