improve the latest fix for toolchain.sh

Sat, 29 Nov 2025 13:50:15 +0100

author
Mike Becker <universe@uap-core.de>
date
Sat, 29 Nov 2025 13:50:15 +0100
changeset 164
099448bcc943
parent 163
12a5e64cab34
child 165
f4f11f755ee7

improve the latest fix for 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	Sat Nov 29 12:18:10 2025 +0100
+++ b/src/main/resources/make/toolchain.sh	Sat Nov 29 13:50:15 2025 +0100
@@ -24,8 +24,9 @@
 
 check_c_compiler()
 {
-  command -v "$1" >/dev/null 2>&1
-  if [ $? -ne 0 ] ; then
+  if command -v "$1" >/dev/null 2>&1 ; then
+    :
+  else
     return 1
   fi
   cat > "$TEMP_DIR/test.c" << __EOF__
@@ -56,8 +57,9 @@
 
 check_cpp_compiler()
 {
-  command -v "$1" >/dev/null 2>&1
-  if [ $? -ne 0 ] ; then
+  if command -v "$1" >/dev/null 2>&1 ; then
+    :
+  else
     return 1
   fi
   cat > "$TEMP_DIR/test.cpp" << __EOF__
--- a/test/make/toolchain.sh	Sat Nov 29 12:18:10 2025 +0100
+++ b/test/make/toolchain.sh	Sat Nov 29 13:50:15 2025 +0100
@@ -24,8 +24,9 @@
 
 check_c_compiler()
 {
-  command -v "$1" >/dev/null 2>&1
-  if [ $? -ne 0 ] ; then
+  if command -v "$1" >/dev/null 2>&1 ; then
+    :
+  else
     return 1
   fi
   cat > "$TEMP_DIR/test.c" << __EOF__
@@ -56,8 +57,9 @@
 
 check_cpp_compiler()
 {
-  command -v "$1" >/dev/null 2>&1
-  if [ $? -ne 0 ] ; then
+  if command -v "$1" >/dev/null 2>&1 ; then
+    :
+  else
     return 1
   fi
   cat > "$TEMP_DIR/test.cpp" << __EOF__

mercurial