|
4 | 4 | # Basic environment variables
|
5 | 5 | test -n "$MAKE" || MAKE="make"
|
6 | 6 | test -n "$CXX" || CXX="c++"
|
7 |
| -test -n "$QTCHOOSER" || QTCHOOSER="$(which qtchooser 2> /dev/null)" |
| 7 | +test -n "$QTCHOOSER" || QTCHOOSER="$(command -v qtchooser 2> /dev/null)" |
| 8 | +test -n "$TMPDIR" || TMPDIR="$PWD" |
8 | 9 |
|
9 |
| -# Use qtchooser if we have it, otherwise use which |
| 10 | +# Use qtchooser if we have it, otherwise use Posix command -v |
10 | 11 | if test -n "$QTCHOOSER"; then
|
11 | 12 | test -n "$QMAKE" || QMAKE="$QTCHOOSER -run-tool=qmake -qt=5"
|
12 | 13 | test -n "$LRELEASE" || LRELEASE="$QTCHOOSER -run-tool=lrelease -qt=5"
|
13 | 14 | else
|
14 |
| - test -n "$QMAKE" || QMAKE="$(which qmake-qt5 2>/dev/null || which qmake 2>/dev/null)" |
15 |
| - test -n "$LRELEASE" || LRELEASE="$(which lrelease-qt5 2>/dev/null || which lrelease 2>/dev/null)" |
| 15 | + test -n "$QMAKE" || QMAKE="$(command -v qmake-qt5 2>/dev/null || command -v qmake 2>/dev/null)" |
| 16 | + test -n "$LRELEASE" || LRELEASE="$(command -v lrelease-qt5 2>/dev/null || command -v lrelease 2>/dev/null)" |
16 | 17 | fi
|
17 | 18 |
|
18 | 19 |
|
|
68 | 69 | check() {
|
69 | 70 | printf "checking for $1... "
|
70 | 71 | t=$(basename $2)
|
71 |
| - which $t 2>/dev/null 1>/dev/null |
72 |
| - test $(echo $?) -eq 0 && echo "$(which $t)" || errorExit "not found!" $3 |
| 72 | + command -v $t 2>/dev/null 1>/dev/null |
| 73 | + test $(echo $?) -eq 0 && echo "$(command -v $t)" || errorExit "not found!" $3 |
73 | 74 | }
|
74 | 75 |
|
75 | 76 |
|
@@ -148,13 +149,13 @@ int main()
|
148 | 149 | }
|
149 | 150 | EOF
|
150 | 151 | printf "checking whether c++ compiler builds test program... "
|
151 |
| -$CXX -o test test.cpp && echo "ok" || errorExit "error!" 1 |
| 152 | +$CXX -o "$TMPDIR/test" test.cpp && echo "ok" || errorExit "error!" 1 |
152 | 153 | printf "checking whether c++ compiler supports -std=c++0x... "
|
153 | 154 | rm -f test
|
154 |
| -$CXX -std=c++0x -o test test.cpp && echo "ok" || errorExit "error!" 1 |
| 155 | +$CXX -std=c++0x -o "$TMPDIR/test" test.cpp && echo "ok" || errorExit "error!" 1 |
155 | 156 | printf "checking whether compiled test program works... "
|
156 |
| -./test 2>/dev/null 1>/dev/null && echo "ok" || errorExit "error!" 1 |
157 |
| -rm -f test test.cpp |
| 157 | +"$TMPDIR/test" 2>/dev/null 1>/dev/null && echo "ok" || errorExit "error!" 1 |
| 158 | +rm -f "$TMPDIR/test" test.cpp |
158 | 159 |
|
159 | 160 | check make "$MAKE" 1
|
160 | 161 | check pkg-config pkg-config 1
|
|
0 commit comments