From 5b99710042e812d294f571ad6d86fb003a8071e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Mon, 23 Aug 2010 09:27:38 -0400 Subject: [PATCH] Be more paranoid about checking for GTK+ From time to time people run into issues where the configure script detects GTK+ when it is either not installed, or not functional due to a missing pixman. Most recently: https://bugs.freedesktop.org/show_bug.cgi?id=29736 This patch makes the configure script more paranoid by - always using PKG_CHECK_MODULES and not PKG_CHECK_EXISTS, since it seems PKG_CHECK_EXISTS will sometimes return true even if a dependency of GTK+, such as pixman-1, is missing. - explicitly checking that pixman-1 is installed before enabling GTK+. Cc: my.somewhat.lengthy.loginname@gmail.com --- configure.ac | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index d8a8999..dbff2a6 100644 --- a/configure.ac +++ b/configure.ac @@ -178,7 +178,6 @@ AC_SUBST(PIXMAN_VERSION_MICRO) AC_SUBST(LT_VERSION_INFO) # Check for dependencies -#PKG_CHECK_MODULES(DEP, x11) PIXMAN_CHECK_CFLAG([-Wall]) PIXMAN_CHECK_CFLAG([-fno-strict-aliasing]) @@ -585,11 +584,18 @@ AC_ARG_ENABLE(gtk, [enable_gtk=$enableval], [enable_gtk=auto]) PKG_PROG_PKG_CONFIG + +if test $enable_gtk = yes ; then + AC_CHECK_LIB([pixman-1], [pixman_version_string]) + PKG_CHECK_MODULES(GTK, [gtk+-2.0 pixman-1]) +fi + if test $enable_gtk = auto ; then - PKG_CHECK_EXISTS([gtk+-2.0], [enable_gtk=yes], [enable_gtk=no]) + AC_CHECK_LIB([pixman-1], [pixman_version_string], [enable_gtk=auto], [enable_gtk=no]) fi -if test $enable_gtk = yes ; then - PKG_CHECK_MODULES(GTK, [gtk+-2.0]) + +if test $enable_gtk = auto ; then + PKG_CHECK_MODULES(GTK, [gtk+-2.0 pixman-1], [enable_gtk=yes], [enable_gtk=no]) fi AM_CONDITIONAL(HAVE_GTK, [test "x$enable_gtk" = xyes]) -- 2.7.4