src/test/resources/golden-sample/configure2

changeset 63
ac47c2fb2c4a
parent 60
43d6680e6410
child 66
dc758dcd4645
--- a/src/test/resources/golden-sample/configure2	Sun Sep 17 12:40:12 2023 +0200
+++ b/src/test/resources/golden-sample/configure2	Sun Sep 17 13:03:46 2023 +0200
@@ -213,6 +213,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_qt4()
 {
     printf "checking for qt4... "
@@ -272,7 +285,7 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if $PKG_CONFIG libcurl ; then
+        if test_pkg_config "libcurl" "" "" "" ; then
             TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libcurl`"
             TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libcurl`"
         else
@@ -294,7 +307,7 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if $PKG_CONFIG gtk+-2.0 ; then
+        if test_pkg_config "gtk+-2.0" "" "" "" ; then
             TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk+-2.0`"
             TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk+-2.0`"
         else
@@ -316,7 +329,7 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if $PKG_CONFIG sqlite3 ; then
+        if test_pkg_config "sqlite3" "" "" "" ; then
             TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags sqlite3`"
             TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs sqlite3`"
         else
@@ -366,7 +379,7 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if $PKG_CONFIG gtk+-5.0 ; then
+        if test_pkg_config "gtk+-5.0" "" "" "" ; then
             TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk+-5.0`"
             TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk+-5.0`"
         else
@@ -402,7 +415,7 @@
         if [ -z "$PKG_CONFIG" ]; then
             break
         fi
-        if $PKG_CONFIG --atleast-version=2.8 libxml-2.0 ; then
+        if test_pkg_config "libxml-2.0" "2.8" "" "" ; then
             TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`"
             TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`"
         else

mercurial