[glade3] Add --with-gtk=2.0|3.0 configure flag



commit aab71318744e745328265835a023a32eb0582e88
Author: Pablo Castellano <pablog src gnome org>
Date:   Mon Aug 30 19:44:44 2010 +0200

    Add --with-gtk=2.0|3.0 configure flag

 configure.ac |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0277a5e..c2cf9d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -121,9 +121,39 @@ GTK_DOC_CHECK(1.9)
 dnl ================================================================
 dnl Check for gtk+
 dnl ================================================================
-PKG_CHECK_MODULES(GTK, [gtk+-3.0 libxml-2.0 >= 2.4.0])
+# Which gtk+ API version to compile against
+
+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
+
 AC_SUBST(GTK_LIBS)
 AC_SUBST(GTK_CFLAGS)
+AC_SUBST([GTK_API_VERSION])
+
+AM_CONDITIONAL([HAVE_GTK_2],[test "$with_gtk" = "2.0"])
+AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk" = "3.0"])
+
+PKG_CHECK_MODULES([GTK],[
+  gtk+-$GTK_API_VERSION >= $GTK_REQUIRED
+  libxml-2.0 >= 2.4.0
+])
+
 
 dnl ================================================================
 dnl Check for the unix print widgets in gtk+
@@ -282,6 +312,7 @@ Configuration:
 
 	Source code location:	 ${srcdir}
 	Compiler:		 ${CC}
+	GTK+ version:            $with_gtk
 	GTK+ UNIX Print Widgets: ${have_unix_print}
 	PYTHON Widgets support:	 ${have_python}
 



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