--- a/make/toolchain.sh Tue Nov 04 22:37:18 2025 +0100 +++ b/make/toolchain.sh Sun Nov 30 22:16:31 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,14 +24,15 @@ check_c_compiler() { - command -v $1 2>&1 >/dev/null - if [ $? -ne 0 ]; then + if command -v "$1" >/dev/null 2>&1 ; then + : + else return 1 fi cat > "$TEMP_DIR/test.c" << __EOF__ /* test file */ #include <stdio.h> -int main(int argc, char **argv) { +int main(void) { #if defined(_MSC_VER) printf("toolchain:msc\n"); #elif defined(__clang__) @@ -45,7 +46,7 @@ #endif printf("wsize:%d\n", (int)sizeof(void*)*8); #ifdef __STDC_VERSION__ - printf("stdcversion:%d\n", __STDC_VERSION__); + printf("stdcversion:%ld\n", (long int)__STDC_VERSION__); #endif return 0; } @@ -56,14 +57,15 @@ check_cpp_compiler() { - command -v $1 2>&1 >/dev/null - if [ $? -ne 0 ]; then + if command -v "$1" >/dev/null 2>&1 ; then + : + else return 1 fi cat > "$TEMP_DIR/test.cpp" << __EOF__ /* test file */ #include <iostream> -int main(int argc, char **argv) { +int main(void) { #if defined(_MSC_VER) std::cout << "toolchain:msc" << std::endl; #elif defined(__clang__) @@ -83,21 +85,6 @@ $1 -o "$TEMP_DIR/checkcc" $CXXFLAGS $LDFLAGS "$TEMP_DIR/test.cpp" 2> /dev/null } -create_libtest_source() -{ - # $1: filename - # $2: optional include - cat > "$TEMP_DIR/$1" << __EOF__ -/* libtest file */ -int main(int argc, char **argv) { - return 0; -} -__EOF__ - if [ -n "$2" ]; then - echo "#include <$2>" >> "$TEMP_DIR/$1" - fi -} - parse_toolchain_properties() { info_file="$1"