[gtk-vnc] Allows linking with gtk+2.0 and gtk+3.0



commit 85a32e4e243bf57a2bdde9e1bf1f4408d4923e74
Author: Jonh Wendell <jwendell gnome org>
Date:   Wed Jun 30 10:40:09 2010 -0300

    Allows linking with gtk+2.0 and gtk+3.0
    
    This adds a new configure parameter: --with-gtk=2.0|3.0 (default: 2.0)

 configure.ac      |   32 +++++++++++++++++++++++++++++---
 gtk-vnc-1.0.pc.in |    2 +-
 2 files changed, 30 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0075708..c98fce7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,8 +32,6 @@ GOBJECT_REQUIRED=2.10.0
 AC_SUBST(GOBJECT_REQUIRED)
 GDK_PIXBUF_REQUIRED=2.10.0
 AC_SUBST(GDK_PIXBUF_REQUIRED)
-GTK_REQUIRED=2.18.0
-AC_SUBST(GTK_REQUIRED)
 GNUTLS_REQUIRED=1.4.0
 AC_SUBST(GNUTLS_REQUIRED)
 
@@ -72,6 +70,33 @@ AM_GLIB_GNU_GETTEXT
 
 dnl *******************************************************************************
 
+################################################################################
+# GTK+
+################################################################################
+
+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.18.0
+       ;;
+  3.0) GTK_API_VERSION=3.0
+       GTK_REQUIRED=2.90.4
+       ;;
+esac
+
+AC_SUBST([GTK_API_VERSION])
+AC_SUBST([GTK_REQUIRED])
+AM_CONDITIONAL([HAVE_GTK_2],[test "$with_gtk" = "2.0"])
+AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk" = "3.0"])
 
 AC_CHECK_HEADERS([pwd.h winsock2.h])
 
@@ -109,7 +134,7 @@ PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED)
 AC_SUBST(GDK_PIXBUF_CFLAGS)
 AC_SUBST(GDK_PIXBUF_LIBS)
 
-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED)
+PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
 AC_SUBST(GTK_CFLAGS)
 AC_SUBST(GTK_LIBS)
 
@@ -362,4 +387,5 @@ Configure summary:
 	Browser plugin .............:  ${enable_plugin}
 	Scaling support.............:  ${with_scaling}
 	SASL support................:  ${enable_sasl}
+	GTK+ version................:  ${GTK_API_VERSION}
 "
diff --git a/gtk-vnc-1.0.pc.in b/gtk-vnc-1.0.pc.in
index 1f9af79..1859228 100644
--- a/gtk-vnc-1.0.pc.in
+++ b/gtk-vnc-1.0.pc.in
@@ -5,7 +5,7 @@ includedir= includedir@
 
 Name: GTK-VNC
 Description: GTK widget for a VNC client
-Requires: gvnc-1.0 = @VERSION@, gtk+-2.0 >= @GTK_REQUIRED@
+Requires: gvnc-1.0 = @VERSION@, gtk+- GTK_API_VERSION@ >= @GTK_REQUIRED@
 Version: @VERSION@
 Libs: -L${libdir} -lgtk-vnc-1.0
 Cflags: -I${includedir}/gtk-vnc-1.0



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