src/test/resources/golden-sample/configure

changeset 63
ac47c2fb2c4a
parent 60
43d6680e6410
child 66
dc758dcd4645
--- a/src/test/resources/golden-sample/configure	Sun Sep 17 12:40:12 2023 +0200
+++ b/src/test/resources/golden-sample/configure	Sun Sep 17 13:03:46 2023 +0200
@@ -210,6 +210,19 @@
 # create buffer for make variables required by dependencies
 echo > "$TEMP_DIR/make.mk"
 
+test_pkg_config()
+{
+    if "$PKG_CONFIG" --exists "$1" ; then :
+    else return 1 ; fi
+    if [ -n "$2" ] && "$PKG_CONFIG" --atleast-version="$2" "$1" ; then :
+    else return 1 ; fi
+    if [ -n "$3" ] && "$PKG_CONFIG" --exact-version="$3" "$1" ; then :
+    else return 1 ; fi
+    if [ -n "$4" ] && "$PKG_CONFIG" --max-version="$4" "$1" ; then :
+    else return 1 ; fi
+    return 0
+}
+
 dependency_error_libpq()
 {
     printf "checking for libpq... "
@@ -219,7 +232,7 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if $PKG_CONFIG libpq ; then
+        if test_pkg_config "libpq" "" "" "" ; then
             TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libpq`"
             TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libpq`"
         else
@@ -241,7 +254,7 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if $PKG_CONFIG openssl ; then
+        if test_pkg_config "openssl" "" "" "" ; then
             TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`"
             TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`"
         else
@@ -294,7 +307,7 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if $PKG_CONFIG libxml-2.0 ; then
+        if test_pkg_config "libxml-2.0" "" "" "" ; then
             TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`"
             TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`"
         else

mercurial