summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@googlemail.com>2016-02-23 16:57:19 +0100
committerMassimiliano Culpo <massimiliano.culpo@googlemail.com>2016-02-23 16:57:19 +0100
commit4316f1cd31afd18e35b5ebd9852a156d2c68c8df (patch)
treeb77383266c86e6314318dabf00cddaa1693bae9d /lib
parent97c3854c4044a71cf756d9164684fa553915f6ab (diff)
downloadspack-4316f1cd31afd18e35b5ebd9852a156d2c68c8df.tar.gz
spack-4316f1cd31afd18e35b5ebd9852a156d2c68c8df.tar.bz2
spack-4316f1cd31afd18e35b5ebd9852a156d2c68c8df.tar.xz
spack-4316f1cd31afd18e35b5ebd9852a156d2c68c8df.zip
Modified wrapper to have a different behavior when modeis vcheck
Diffstat (limited to 'lib')
-rwxr-xr-xlib/spack/env/cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/spack/env/cc b/lib/spack/env/cc
index aacba996b3..dfb0801c56 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,11 @@ fi
# Save original command for debug logging
input_command="$@"
+if [ "$mode" == vcheck ] ; then
+ exec "${input_command}"
+ exit
+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
@@ -330,3 +343,5 @@ if [ "$SPACK_DEBUG" = "TRUE" ]; then
fi
exec "${full_command[@]}"
+
+