[gnome-terminal] Allow building against gtk 3



commit cd68e956b71e5b25edc443974acc119d98a637b0
Author: Christian Persch <chpe gnome org>
Date:   Sat Jun 12 17:40:52 2010 +0200

    Allow building against gtk 3
    
    Not parallel installable with the gtk 2 gnome-terminal version, since
    there's no need for more than one installed g-t !

 configure.ac |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 90f11d6..c48f878 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,7 +45,26 @@ GCONF_REQUIRED=2.14.0
 DBUS_GLIB_REQUIRED=0.6
 VTE_REQUIRED=0.25.1
 
-GDK_TARGET="$($PKG_CONFIG --variable target gdk-2.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: 2.0)])],
+  [case "$with_gtk" in
+     2.0|3.0) ;;
+     *) AC_MSG_ERROR([invalid gtk version specified]) ;;
+   esac],
+  [with_gtk=2.0])
+AC_MSG_RESULT([$with_gtk])
+
+case "$with_gtk" in
+  2.0) GTK_API_VERSION=2.0
+       GTK_REQUIRED=2.14.0
+       ;;
+  3.0) GTK_API_VERSION=3.0
+       GTK_REQUIRED=2.90.0
+       ;;
+esac
+
+GDK_TARGET="$($PKG_CONFIG --variable target gdk-$GTK_API_VERSION)"
 
 case "$GDK_TARGET" in
   x11) PLATFORM_DEPS="x11" ;;
@@ -57,12 +76,12 @@ PKG_CHECK_MODULES([TERM],
    glib-2.0 >= $GLIB_REQUIRED
    gthread-2.0
    gio-2.0
-   gtk+-2.0 >= $GTK_REQUIRED
+   gtk+-$GTK_API_VERSION >= $GTK_REQUIRED
    gconf-2.0 >= $GCONF_REQUIRED
    dbus-glib-1 >= $DBUS_GLIB_REQUIRED
    $PLATFORM_DEPS])
 
-PKG_CHECK_EXISTS([gtk+-2.0 >= 2.18.0],[have_gtk_2_18=yes],[have_gtk_2_18=no])
+PKG_CHECK_EXISTS([gtk+-$GTK_API_VERSION >= 2.18.0],[have_gtk_2_18=yes],[have_gtk_2_18=no])
 AM_CONDITIONAL([HAVE_GTK_2_18],[test "$have_gtk_2_18" = "yes"])
 
 # Check the smclient backend



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