test/configure

changeset 103
01ec9f32835e
parent 102
bc7837852b7c
child 105
4b3e655339cb
--- a/test/configure	Fri Jan 19 21:23:56 2024 +0100
+++ b/test/configure	Sat Jan 20 14:56:50 2024 +0100
@@ -176,6 +176,8 @@
 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -`
 echo "$PLATFORM_NAME"
 
+TOOLCHAIN=
+
 isplatform()
 {
     for p in $PLATFORM
@@ -196,6 +198,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
@@ -237,6 +259,7 @@
 if detect_c_compiler ; then
     lang_c=1
 fi
+TOOLCHAIN=$TOOLCHAIN_NAME
 
 # create buffer for make variables required by dependencies
 echo > "$TEMP_DIR/make.mk"
@@ -307,6 +330,42 @@
 dependency_error_openssl()
 {
     print_check_msg "$dep_checked_openssl" "checking for openssl... "
+    # dependency openssl toolchain="clang"
+    while true
+    do
+        if notistoolchain "clang"; then
+            break
+        fi
+        if [ -z "$lang_c" ] ; then
+            break
+        fi
+        if [ -z "$PKG_CONFIG" ]; then
+            break
+        fi
+        if test_pkg_config "openssl" "" "" "" ; then
+            TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`"
+            TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`"
+        else
+            break
+        fi
+        TEMP_CFLAGS="$TEMP_CFLAGS -DOPENSSL_CLANG"
+        print_check_msg "$dep_checked_openssl" "yes\n"
+        dep_checked_openssl=1
+        return 1
+    done
+
+    # dependency openssl platform="bsd"
+    while true
+    do
+        if notisplatform "bsd"; then
+            break
+        fi
+        TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto"
+        print_check_msg "$dep_checked_openssl" "yes\n"
+        dep_checked_openssl=1
+        return 1
+    done
+
     # dependency openssl
     while true
     do
@@ -327,18 +386,6 @@
         return 1
     done
 
-    # dependency openssl platform="bsd"
-    while true
-    do
-        if notisplatform "bsd"; then
-            break
-        fi
-        TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto"
-        print_check_msg "$dep_checked_openssl" "yes\n"
-        dep_checked_openssl=1
-        return 1
-    done
-
     print_check_msg "$dep_checked_openssl" "no\n"
     dep_checked_openssl=1
     return 0
@@ -411,6 +458,58 @@
     done
     break
 done
+while true
+do
+    if notistoolchain "gcc"; then
+        break
+    fi
+    while true
+    do
+
+        TEMP_CFLAGS="$TEMP_CFLAGS -DTOOLCHAIN_GCC"
+        break
+    done
+    break
+done
+while true
+do
+    if notistoolchain "clang"; then
+        break
+    fi
+    while true
+    do
+
+        TEMP_CFLAGS="$TEMP_CFLAGS -DTOOLCHAIN_CLANG"
+        break
+    done
+    break
+done
+while true
+do
+    if isplatform "gcc" || istoolchain "gcc"; then
+        break
+    fi
+    while true
+    do
+
+        TEMP_CFLAGS="$TEMP_CFLAGS -DNOT_TOOLCHAIN_GCC"
+        break
+    done
+    break
+done
+while true
+do
+    if isplatform "clang" || istoolchain "clang"; then
+        break
+    fi
+    while true
+    do
+
+        TEMP_CFLAGS="$TEMP_CFLAGS -DNOT_TOOLCHAIN_CLANG"
+        break
+    done
+    break
+done
 
 # add general dependency flags to flags.mk
 echo "# general flags" >> "$TEMP_DIR/flags.mk"

mercurial