[gconf] Allow building against GTK+ 3



commit d1040d83beefa492499b882f13ced971d0292d7b
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 3 11:11:40 2010 -0400

    Allow building against GTK+ 3
    
    This adds the common --with-gtk option to configure. The default
    is to build against GTK+ 3.

 configure.in |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/configure.in b/configure.in
index 70274b7..9a67c68 100644
--- a/configure.in
+++ b/configure.in
@@ -139,6 +139,25 @@ fi
 
 GTK_DOC_CHECK([1.0])
 
+AC_MSG_CHECKING([which gtk+ version to compile against])
+AC_ARG_WITH([gtk],
+  [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 3.0)])],
+  [case "$with_gtk" in
+     2.0|3.0) ;;
+     *) AC_MSG_ERROR([invalid gtk version specified]) ;;
+   esac],
+  [with_gtk=3.0])
+AC_MSG_RESULT([$with_gtk])
+
+case "$with_gtk" in
+  2.0) GTK_API_VERSION=2.0
+       GTK_REQUIRED=2.14
+       ;;
+  3.0) GTK_API_VERSION=3.0
+       GTK_REQUIRED=2.90
+       ;;
+esac
+
 AC_ARG_ENABLE(gtk,
   AS_HELP_STRING([--enable-gtk],
     [Enable GTK+ support (for gconf-sanity-check) @<:@default=auto@:>@]),
@@ -146,8 +165,8 @@ AC_ARG_ENABLE(gtk,
 
 PKGCONFIG_MODULES='glib-2.0 > 2.14.0 gio-2.0 >= 2.25.9 gthread-2.0 gmodule-2.0 >= 2.7.0 gobject-2.0 >= 2.7.0 ORBit-2.0 >= 2.4.0'
 PKGCONFIG_MODULES_WITH_XML="$PKGCONFIG_MODULES libxml-2.0"
-PKGCONFIG_MODULES_WITH_GTK=" $PKGCONFIG_MODULES gtk+-2.0 >= 2.14.0"
-PKGCONFIG_MODULES_WITH_XML_AND_GTK=" $PKGCONFIG_MODULES gtk+-2.0 libxml-2.0"
+PKGCONFIG_MODULES_WITH_GTK=" $PKGCONFIG_MODULES gtk+-$GTK_API_VERSION >= $GTK_REQUIRED"
+PKGCONFIG_MODULES_WITH_XML_AND_GTK=" $PKGCONFIG_MODULES gtk+-$GTK_API_VERSION >= $GTK_REQUIRED libxml-2.0"
 PKGCONFIG_MODULES_DBUS=" dbus-1 >= 1.0.0 dbus-glib-1 >= 0.74"
 
 PKG_CHECK_MODULES(DEPENDENT, $PKGCONFIG_MODULES)
@@ -159,7 +178,7 @@ if test "x$enable_gtk" != "xno"; then
 
   if test "x$enable_gtk" = "xyes" && test "x$HAVE_GTK" = "xno"; then
     AC_MSG_ERROR([[
-*** Could not find GTK+ 2.14 or greater.
+*** Could not find GTK+ $GTK_REQUIRED.
 *** Go to http://www.gtk.org/ to get it.]])
   fi
 else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]