commit d41d91ddd851798349f37d9bb75ed2718bbe28f5
parent 36946a5142c40b733d25ea5ca469f7949ee03439
Author: Quentin Carbonneaux <quentin@c9x.me>
Date: Fri, 18 Aug 2023 15:22:27 +0200
test.sh fixes for devuan linux
Diffstat:
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/tools/test.sh b/tools/test.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-dir=`cd $(dirname "$0"); pwd`
+dir=`dirname "$0"`
bin=$dir/../qbe
binref=$dir/../qbe.ref
@@ -12,11 +12,6 @@ asmref=$tmp.ref.s
exe=$tmp.exe
out=$tmp.out
-testcc() {
- echo "int main() { }" | $1 -x c -o /dev/null - >/dev/null 2>&1
- return $?
-}
-
init() {
case "$TARGET" in
arm64)
@@ -79,8 +74,8 @@ init() {
cc="cc -lpthread"
;;
*)
- cc="${CC:-cc} -lpthread"
- testcc "$cc" || cc="${CC:-cc}"
+ cc="${CC:-cc}"
+ ccpost="-lpthread"
;;
esac
TARGET=`$bin -t?`
@@ -154,7 +149,7 @@ once() {
src="$asm"
fi
- if ! $cc -g -o $exe $src
+ if ! $cc -g -o $exe $src $ccpost
then
echo "[cc fail]"
return 1