fix minor inaccuracies in toolchain.sh

Wed, 12 Nov 2025 20:15:44 +0100

author
Mike Becker <universe@uap-core.de>
date
Wed, 12 Nov 2025 20:15:44 +0100
changeset 156
75627f46495d
parent 155
64521cedb78e
child 157
eb788903e8c6

fix minor inaccuracies in toolchain.sh

src/main/resources/make/toolchain.sh file | annotate | diff | comparison | revisions
test/make/toolchain.sh file | annotate | diff | comparison | revisions
--- a/src/main/resources/make/toolchain.sh	Tue Nov 04 17:29:25 2025 +0100
+++ b/src/main/resources/make/toolchain.sh	Wed Nov 12 20:15:44 2025 +0100
@@ -3,7 +3,7 @@
 # toolchain detection
 #
 
-TAIL=tail
+TAIL="tail"
 if isplatform "bsd" && notisplatform "openbsd"; then
   C_COMPILERS="clang gcc cc"
   CPP_COMPILERS="clang++ g++ CC"
@@ -24,8 +24,7 @@
 
 check_c_compiler()
 {
-  command -v $1 2>&1 >/dev/null
-  if [ $? -ne 0 ]; then
+  if ! command -v "$1" >/dev/null 2>&1 ; then
     return 1
   fi
   cat > "$TEMP_DIR/test.c" << __EOF__
@@ -56,8 +55,7 @@
 
 check_cpp_compiler()
 {
-  command -v $1 2>&1 >/dev/null
-  if [ $? -ne 0 ]; then
+  if ! command -v "$1" >/dev/null 2>&1 ; then
     return 1
   fi
   cat > "$TEMP_DIR/test.cpp" << __EOF__
--- a/test/make/toolchain.sh	Tue Nov 04 17:29:25 2025 +0100
+++ b/test/make/toolchain.sh	Wed Nov 12 20:15:44 2025 +0100
@@ -3,7 +3,7 @@
 # toolchain detection
 #
 
-TAIL=tail
+TAIL="tail"
 if isplatform "bsd" && notisplatform "openbsd"; then
   C_COMPILERS="clang gcc cc"
   CPP_COMPILERS="clang++ g++ CC"
@@ -24,8 +24,7 @@
 
 check_c_compiler()
 {
-  command -v $1 2>&1 >/dev/null
-  if [ $? -ne 0 ]; then
+  if ! command -v "$1" >/dev/null 2>&1 ; then
     return 1
   fi
   cat > "$TEMP_DIR/test.c" << __EOF__
@@ -56,8 +55,7 @@
 
 check_cpp_compiler()
 {
-  command -v $1 2>&1 >/dev/null
-  if [ $? -ne 0 ]; then
+  if ! command -v "$1" >/dev/null 2>&1 ; then
     return 1
   fi
   cat > "$TEMP_DIR/test.cpp" << __EOF__

mercurial