configure

changeset 815
b0c4750cecd8
parent 796
fec90b848f4b
child 821
5e6f15005efd
--- a/configure	Wed Jan 17 21:01:50 2024 +0100
+++ b/configure	Sat Jan 20 16:02:04 2024 +0100
@@ -163,17 +163,17 @@
 printf "detect platform... "
 if [ "$OS" = "SunOS" ]; then
     PLATFORM="solaris sunos unix svr4"
-fi
-if [ "$OS" = "Linux" ]; then
+elif [ "$OS" = "Linux" ]; then
     PLATFORM="linux unix"
-fi
-if [ "$OS" = "FreeBSD" ]; then
+elif [ "$OS" = "FreeBSD" ]; then
     PLATFORM="freebsd bsd unix"
-fi
-if [ "$OS" = "Darwin" ]; then
+elif [ "$OS" = "OpenBSD" ]; then
+    PLATFORM="openbsd bsd unix"
+elif [ "$OS" = "NetBSD" ]; then
+    PLATFORM="netbsd bsd unix"
+elif [ "$OS" = "Darwin" ]; then
     PLATFORM="macos osx bsd unix"
-fi
-if echo "$OS" | grep -i "MINGW" > /dev/null; then
+elif echo "$OS" | grep -i "MINGW" > /dev/null; then
     PLATFORM="windows mingw"
 fi
 : ${PLATFORM:="unix"}
@@ -201,6 +201,26 @@
     done
     return 0
 }
+istoolchain()
+{
+    for t in $TOOLCHAIN
+    do
+        if [ "$t" = "$1" ]; then
+            return 0
+        fi
+    done
+    return 1
+}
+notistoolchain()
+{
+    for t in $TOOLCHAIN
+    do
+        if [ "$t" = "$1" ]; then
+            return 1
+        fi
+    done
+    return 0
+}
 
 
 # generate vars.mk
@@ -267,9 +287,12 @@
 dependency_error_coverage()
 {
     print_check_msg "$dep_checked_coverage" "checking for coverage... "
-    # dependency coverage
+    # dependency coverage toolchain="gnuc"
     while true
     do
+        if notistoolchain "gnuc"; then
+            break
+        fi
         TEMP_CFLAGS="$TEMP_CFLAGS \${COVERAGE_CFLAGS}"
         TEMP_LDFLAGS="$TEMP_LDFLAGS \${COVERAGE_LDFLAGS}"
         print_check_msg "$dep_checked_coverage" "yes\n"
@@ -453,10 +476,10 @@
 
 # add general dependency flags to flags.mk
 echo "# general flags" >> "$TEMP_DIR/flags.mk"
-if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then
+if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
     echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
 fi
-if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then
+if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
     echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
 fi
 if [ -n "${TEMP_LDFLAGS}" ]; then
@@ -639,10 +662,10 @@
     fi
 fi
 
-if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then
+if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
     echo "CFLAGS  += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
 fi
-if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then
+if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
     echo "CXXFLAGS  += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
 fi
 if [ "$BUILD_TYPE" = "debug" ]; then
@@ -699,6 +722,3 @@
 write_toolchain_defaults "$TEMP_DIR/toolchain.mk"
 cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk
 rm -Rf "$TEMP_DIR"
-
-
-

mercurial