From 75b3785c33864d1fde0fd74fa33e87f5293cf38d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 9 Jun 2010 01:53:11 -0400 Subject: [PATCH] Make it possible to compile against gtk3 --- configure.ac | 37 +++++++++++++++++++++++++------------ 1 files changed, 25 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 85c3bde..63a9c6c 100644 --- a/configure.ac +++ b/configure.ac @@ -340,26 +340,21 @@ fi ### GTK (optional) #### -AC_ARG_ENABLE([gtk], - AS_HELP_STRING([--disable-gtk], [Disable optional GTK+ support]), - [ - case "${enableval}" in - yes) gtk=yes ;; - no) gtk=no ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-gtk) ;; - esac - ], - [gtk=auto]) +AC_ARG_WITH([gtk], + AS_HELP_STRING([--with-gtk=gtk2|gtk3|no], [Configure optional GTK+ support]), + [], + [with_gtk=gtk2]) AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [false]) -if test "x${gtk}" != xno ; then + +if test "x${with_gtk}" = xgtk2 ; then PKG_CHECK_MODULES(GTK, [ gtk+-2.0 >= 2.20.0 gthread-2.0 ], [ HAVE_GTK=1 AC_DEFINE([HAVE_GTK], 1, [Have GTK?]) AC_PATH_PROG(GCONFTOOL, gconftool-2) - AM_GCONF_SOURCE_2 + AM_GCONF_SOURCE_2 GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0` GTK_MODULES_DIR="${libdir}/gtk-2.0/modules" @@ -370,6 +365,24 @@ if test "x${gtk}" != xno ; then AC_MSG_ERROR([*** GTK not found ***]) fi ]) +elif test "x${with_gtk}" = xgtk3 ; then + PKG_CHECK_MODULES(GTK, [ gtk+-3.0 gthread-2.0 ], + [ + HAVE_GTK=1 + AC_DEFINE([HAVE_GTK], 1, [Have GTK?]) + + AC_PATH_PROG(GCONFTOOL, gconftool-2) + AM_GCONF_SOURCE_2 + + GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0` + GTK_MODULES_DIR="${libdir}/gtk-3.0/modules" + ], + [ + HAVE_GTK=0 + if test "x$gtk" = xyes ; then + AC_MSG_ERROR([*** GTK not found ***]) + fi + ]) else HAVE_GTK=0 fi -- 1.7.1