From 23d0dd5fc14e28bbc575c3006823c659cabf47b5 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 31 Jul 2012 14:34:51 +0200 Subject: Introduced configure option --with-gtk=2|3|default to be able to compile against different version of GTK+ (2.x or 3.x). --- AUTHORS | 1 + ChangeLog | 9 +++++++++ NEWS | 1 + acinclude.m4 | 40 +++++++++++++++++++++++++++++++++++++++- 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 3396bff..3d3e0bb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -8,6 +8,7 @@ Danesh Dadachanji Adam Domurad Thomas Fitzsimmons Mark Greenwood +Peter Hatina Andrew John Hughes Matthias Klose Michał Górny < mgorny@gentoo.org > diff --git a/ChangeLog b/ChangeLog index ed7a87d..2d8cb6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-07-31 Jiri Vanek + Peter Hatina + + Introduced configure option --with-gtk=2|3|default to be able + to compile against different version of GTK+ (2.x or 3.x). + * NEWS: mentioned bug fix + * acinclude.m4: (ITW_GTK_CHECK_VERSION) macro for getting GTK+ version + (ITW_GTK_CHECK) macro for checking GTK+ version + 2012-07-24 Adam Domurad * plugin/icedteanp/IcedTeaPluginUtils.cc diff --git a/NEWS b/NEWS index dbc025f..3bec098 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ New in release 1.3 (2012-XX-XX): - PR918: java applet windows uses a low resulution black/white icon - RH838417: Disambiguate signed applet security prompt from certificate warning - RH838559: Disambiguate signed applet security prompt from certificate warning + - RH720836: project can be compiled against GTK+ 2 or 3 librarie New in release 1.2 (2011-XX-XX): * Security updates: diff --git a/acinclude.m4 b/acinclude.m4 index bdddb77..1ab4c9a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -359,13 +359,51 @@ AC_ARG_ENABLE([plugin], AC_MSG_RESULT(${enable_plugin}) ]) +dnl ITW_GTK_CHECK_VERSION([gtk version]) +AC_DEFUN([ITW_GTK_CHECK_VERSION], +[ + AC_MSG_CHECKING([for GTK$1 version]) + GTK_VER=`$PKG_CONFIG --modversion gtk+-$1.0` + AC_MSG_RESULT([$GTK_VER]) +]) + +dnl ITW_GTK_CHECK([gtk version]) +AC_DEFUN([ITW_GTK_CHECK], +[ + case "$1" in + default) + PKG_CHECK_MODULES(GTK, gtk+-3.0, + [ITW_GTK_CHECK_VERSION([3])], + [PKG_CHECK_MODULES(GTK, gtk+-2.0, + [ITW_GTK_CHECK_VERSION([2])], + [AC_MSG_ERROR([GTK $1 not found])] + )] + ) + ;; + *) + PKG_CHECK_MODULES(GTK, gtk+-$1.0, + [ITW_GTK_CHECK_VERSION([$1])], + [AC_MSG_ERROR([GTK $1 not found])] + ) + ;; + esac +]) + AC_DEFUN_ONCE([IT_CHECK_PLUGIN_DEPENDENCIES], [ dnl Check for plugin support headers and libraries. dnl FIXME: use unstable AC_REQUIRE([IT_CHECK_PLUGIN]) if test "x${enable_plugin}" = "xyes" ; then - PKG_CHECK_MODULES(GTK, gtk+-2.0) + AC_ARG_WITH([gtk], + [AS_HELP_STRING([--with-gtk=[2|3|default]], + [the GTK+ version to use (default: 3)])], + [case "$with_gtk" in + 2|3|default) ;; + *) AC_MSG_ERROR([invalid GTK version specified]) ;; + esac], + [with_gtk=default]) + ITW_GTK_CHECK([$with_gtk]) PKG_CHECK_MODULES(GLIB, glib-2.0) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) -- cgit v1.2.3