Avoid "pkg-config --atleast-version"

AM_PATH_GTK_3_0([3.4], [], [], [gthread]) results in calling
"pkg-config --atleast-version 3.4 gtk+-3.0 gthread-2.0".

With pkg-config 0.28, that test fails, because the version of
gthread-2.0 is smaller than 3.4. This appears to be a behaviour
change since 0.26, but matches what the documentation said in 0.26.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=641638
Bug-Debian: https://bugs.debian.org/756476
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
This commit is contained in:
Simon McVittie 2014-08-09 15:17:44 +01:00
parent b535dd0671
commit 82cf89deb9

View File

@ -11,8 +11,9 @@ dnl Get the cflags and libraries from pkg-config
dnl dnl
AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
, enable_gtktest=yes) , enable_gtktest=yes)
min_gtk_version=ifelse([$1], [], [3.0.0], [$1])
pkg_config_args=gtk+-3.0 pkg_config_args="gtk+-3.0 >= $min_gtk_version"
for module in . $4 for module in . $4
do do
case "$module" in case "$module" in
@ -38,7 +39,6 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run
no_gtk=yes no_gtk=yes
fi fi
min_gtk_version=ifelse([$1], ,3.0.0,$1)
AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
if test x$PKG_CONFIG != xno ; then if test x$PKG_CONFIG != xno ; then
@ -48,7 +48,7 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run
enable_gtktest=no enable_gtktest=no
fi fi
if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then if $PKG_CONFIG $pkg_config_args; then
: :
else else
no_gtk=yes no_gtk=yes
@ -202,10 +202,11 @@ AC_DEFUN([GTK_CHECK_BACKEND],
[ [
pkg_config_args=ifelse([$1],,gtk+-3.0, gtk+-$1-3.0) pkg_config_args=ifelse([$1],,gtk+-3.0, gtk+-$1-3.0)
min_gtk_version=ifelse([$2],,3.0.0,$2) min_gtk_version=ifelse([$2],,3.0.0,$2)
pkg_config_args="$pkg_config_args >= $min_gtk_version"
AC_PATH_PROG(PKG_CONFIG, [pkg-config], [AC_MSG_ERROR([No pkg-config found])]) AC_PATH_PROG(PKG_CONFIG, [pkg-config], [AC_MSG_ERROR([No pkg-config found])])
if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args ; then if $PKG_CONFIG $pkg_config_args ; then
target_found=yes target_found=yes
else else
target_found=no target_found=no