src/test/resources/golden-sample/configure

changeset 67
e43d30273f74
parent 66
dc758dcd4645
child 68
c997c0978665
--- a/src/test/resources/golden-sample/configure	Mon Sep 18 23:20:29 2023 +0200
+++ b/src/test/resources/golden-sample/configure	Tue Sep 19 19:29:19 2023 +0200
@@ -196,6 +196,16 @@
 # DEPENDENCIES
 #
 
+# check languages
+lang_c=
+lang_cpp=
+if detect_c_compiler ; then
+    lang_c=1
+fi
+if detect_cpp_compiler ; then
+    lang_cpp=1
+fi
+
 # create buffer for make variables required by dependencies
 echo > "$TEMP_DIR/make.mk"
 
@@ -212,6 +222,22 @@
     return 0
 }
 
+dependency_error_cpp()
+{
+    printf "checking for cpp... "
+    # dependency cpp
+    while true
+    do
+        if [ -z "$lang_cpp" ] ; then
+            break
+        fi
+        echo yes
+        return 1
+    done
+
+    echo no
+    return 0
+}
 dependency_error_libpq()
 {
     printf "checking for libpq... "
@@ -240,6 +266,9 @@
     # dependency openssl
     while true
     do
+        if [ -z "$lang_c" ] ; then
+            break
+        fi
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
@@ -293,6 +322,9 @@
     # dependency libxml2
     while true
     do
+        if [ -z "$lang_c" ] ; then
+            break
+        fi
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
@@ -310,6 +342,9 @@
     return 0
 }
 
+
+
+
 # start collecting dependency information
 echo > "$TEMP_DIR/flags.mk"
 
@@ -323,9 +358,7 @@
 do
     while true
     do
-        if detect_cpp_compiler ; then
-            :
-        else
+        if [ -z "$lang_c" ] ; then
             ERROR=1
             break
         fi
@@ -370,6 +403,10 @@
     DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl "
     ERROR=1
 fi
+if dependency_error_libpq; then
+    DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq "
+    ERROR=1
+fi
 
 # Features
 if [ -n "$FEATURE_PG" ]; then
@@ -383,6 +420,16 @@
             ERROR=1
         fi
     fi
+    # check dependency
+    if dependency_error_cpp ; then
+        # "auto" features can fail and are just disabled in this case
+        if [ "$FEATURE_PG" = "auto" ]; then
+            unset FEATURE_PG
+		else
+            DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED cpp "
+            ERROR=1
+        fi
+    fi
 fi
 
 

mercurial