diff options
author | Gregory Becker <becker33@llnl.gov> | 2016-05-18 16:50:50 -0700 |
---|---|---|
committer | Gregory Becker <becker33@llnl.gov> | 2016-05-18 16:50:50 -0700 |
commit | 80310a3b7c09c8b59b3414b0c20aed6c36620675 (patch) | |
tree | 9edb6fa8302ec6e1510747f7942d64d9b24910c5 /lib/spack/env/cc | |
parent | 9f59c128bec12baede054bf54b9afc69b2130da7 (diff) | |
download | spack-80310a3b7c09c8b59b3414b0c20aed6c36620675.tar.gz spack-80310a3b7c09c8b59b3414b0c20aed6c36620675.tar.bz2 spack-80310a3b7c09c8b59b3414b0c20aed6c36620675.tar.xz spack-80310a3b7c09c8b59b3414b0c20aed6c36620675.zip |
Finished merge on these files
Diffstat (limited to 'lib/spack/env/cc')
-rwxr-xr-x | lib/spack/env/cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/spack/env/cc b/lib/spack/env/cc index 9758b74f37..1e405ae6e9 100755 --- a/lib/spack/env/cc +++ b/lib/spack/env/cc @@ -174,6 +174,28 @@ if [[ -z $command ]]; then die "ERROR: Compiler '$SPACK_COMPILER_SPEC' does not support compiling $language programs." fi +# +# Filter '.' and Spack environment directories out of PATH so that +# this script doesn't just call itself +# +IFS=':' read -ra env_path <<< "$PATH" +IFS=':' read -ra spack_env_dirs <<< "$SPACK_ENV_PATH" +spack_env_dirs+=("" ".") +PATH="" +for dir in "${env_path[@]}"; do + addpath=true + for env_dir in "${spack_env_dirs[@]}"; do + if [[ $dir == $env_dir ]]; then + addpath=false + break + fi + done + if $addpath; then + PATH="${PATH:+$PATH:}$dir" + fi +done +export PATH + if [[ $mode == vcheck ]]; then exec ${command} "$@" fi @@ -286,28 +308,6 @@ unset LD_LIBRARY_PATH unset LD_RUN_PATH unset DYLD_LIBRARY_PATH -# -# Filter '.' and Spack environment directories out of PATH so that -# this script doesn't just call itself -# -IFS=':' read -ra env_path <<< "$PATH" -IFS=':' read -ra spack_env_dirs <<< "$SPACK_ENV_PATH" -spack_env_dirs+=("" ".") -PATH="" -for dir in "${env_path[@]}"; do - addpath=true - for env_dir in "${spack_env_dirs[@]}"; do - if [[ $dir == $env_dir ]]; then - addpath=false - break - fi - done - if $addpath; then - PATH="${PATH:+$PATH:}$dir" - fi -done -export PATH - full_command=("$command" "${args[@]}") # In test command mode, write out full command for Spack tests. |