--- a/test/make/configure.vm Sun Sep 17 12:40:12 2023 +0200 +++ b/test/make/configure.vm Sun Sep 17 13:03:46 2023 +0200 @@ -243,6 +243,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 +} + #foreach( $dependency in $namedDependencies ) dependency_error_${dependency.name}() { @@ -274,7 +287,7 @@ fi #end #foreach( $pkg in $sub.pkgconfig ) - if $pkg.getPkgConfigTestQuery() ; then + if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`" TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`" else @@ -337,7 +350,7 @@ #end #foreach( $pkg in $dependency.pkgconfig ) printf "checking for pkg-config package $pkg.name... " - if $pkg.getPkgConfigTestQuery() ; then + if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then echo yes TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`" TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`"