diff options
author | Xizhi Zhu <xizhi.zhu@nokia.com> | 2011-06-01 16:12:01 +0300 |
---|---|---|
committer | Xizhi Zhu <xizhi.zhu@nokia.com> | 2011-06-01 16:12:01 +0300 |
commit | 7f5a5646e5e0a79cca17edd6efbf748ebc4d5f8c (patch) | |
tree | 3ab9f4440dc527b7a3c07e933ff4741628b73e8e /config.tests | |
parent | 79456f79b3e688036145da7ccde25ffd269024c2 (diff) |
Check the availability of qmake and make.
Diffstat (limited to 'config.tests')
-rwxr-xr-x | config.tests/tools/which.test | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/config.tests/tools/which.test b/config.tests/tools/which.test new file mode 100755 index 00000000..37c858c2 --- /dev/null +++ b/config.tests/tools/which.test @@ -0,0 +1,39 @@ +#!/bin/sh + +HOME=/dev/null +export HOME + +unset which + +WHICH=`which which 2>/dev/null` +if echo $WHICH | grep 'shell built-in command' >/dev/null 2>&1; then + WHICH=which +elif [ -z "$WHICH" ]; then + if which which >/dev/null 2>&1; then + WHICH=which + else + for a in /usr/ucb /usr/bin /bin /usr/local/bin; do + if [ -x $a/which ]; then + WHICH=$a/which + break; + fi + done + fi +fi + +if [ -z "$WHICH" ]; then + IFS=: + for a in $PATH; do + if [ -x $a/$1 ]; then + echo "$a/$1" + exit 0 + fi + done +else + a=`"$WHICH" "$1" 2>/dev/null` + if [ ! -z "$a" -a -x "$a" ]; then + echo "$a" + exit 0 + fi +fi +exit 1 |