summaryrefslogtreecommitdiff
path: root/src/pal/tools/gen-buildsys-clang.sh
diff options
context:
space:
mode:
authorJürgen Hötzel <juergen@hoetzel.info>2017-01-06 01:15:49 +0100
committerJan Vorlicek <janvorli@microsoft.com>2017-01-06 01:15:49 +0100
commit7f8557fb17c58a093bf54bd17e965b9181bba772 (patch)
tree95b32f51004af7006b1ce7105187f1821e578fcb /src/pal/tools/gen-buildsys-clang.sh
parent1ba20a12ef18140d0ee1867fe5b0c0106bdbaf57 (diff)
downloadcoreclr-7f8557fb17c58a093bf54bd17e965b9181bba772.tar.gz
coreclr-7f8557fb17c58a093bf54bd17e965b9181bba772.tar.bz2
coreclr-7f8557fb17c58a093bf54bd17e965b9181bba772.zip
Use POSIX "command" instead of non-standard "which" (#8823)
GNU which might not be installed on a minimal GNU/Linux installation. Refs #6994 and #7025.
Diffstat (limited to 'src/pal/tools/gen-buildsys-clang.sh')
-rwxr-xr-xsrc/pal/tools/gen-buildsys-clang.sh26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/pal/tools/gen-buildsys-clang.sh b/src/pal/tools/gen-buildsys-clang.sh
index 3386c5d64c..5d4d4c8920 100755
--- a/src/pal/tools/gen-buildsys-clang.sh
+++ b/src/pal/tools/gen-buildsys-clang.sh
@@ -18,18 +18,18 @@ then
fi
# Set up the environment to be used for building with clang.
-if which "clang-$2.$3" > /dev/null 2>&1
+if command -v "clang-$2.$3" > /dev/null
then
- export CC="$(which clang-$2.$3)"
- export CXX="$(which clang++-$2.$3)"
-elif which "clang$2$3" > /dev/null 2>&1
+ export CC="$(command -v clang-$2.$3)"
+ export CXX="$(command -v clang++-$2.$3)"
+elif command -v "clang$2$3" > /dev/null
then
- export CC="$(which clang$2$3)"
- export CXX="$(which clang++$2$3)"
-elif which clang > /dev/null 2>&1
+ export CC="$(command -v clang$2$3)"
+ export CXX="$(command -v clang++$2$3)"
+elif command -v clang > /dev/null
then
- export CC="$(which clang)"
- export CXX="$(which clang++)"
+ export CC="$(command -v clang)"
+ export CXX="$(command -v clang++)"
else
echo "Unable to find Clang Compiler"
exit 1
@@ -97,12 +97,12 @@ else
desired_llvm_version="-$desired_llvm_major_version.$desired_llvm_minor_version"
fi
locate_llvm_exec() {
- if which "$llvm_prefix$1$desired_llvm_version" > /dev/null 2>&1
+ if command -v "$llvm_prefix$1$desired_llvm_version" > /dev/null 2>&1
then
- echo "$(which $llvm_prefix$1$desired_llvm_version)"
- elif which "$llvm_prefix$1" > /dev/null 2>&1
+ echo "$(command -v $llvm_prefix$1$desired_llvm_version)"
+ elif command -v "$llvm_prefix$1" > /dev/null 2>&1
then
- echo "$(which $llvm_prefix$1)"
+ echo "$(command -v $llvm_prefix$1)"
else
exit 1
fi