Submitted By: DJ Lucas Date: 2012-05-15 Initial Package Version: 1.2 Upstream Status: Submitted Origin: Peter Hatina phatina@redhat.com Description: Allows plugin to link against GTK+3 libs for browsers that are linked against GTK+3. --- icedtea-web-1.2-orig/acinclude.m4 2012-03-05 16:04:20.000000000 +0000 +++ icedtea-web-1.2/acinclude.m4 2012-05-15 05:24:20.000000000 +0000 @@ -359,13 +359,65 @@ AC_ARG_ENABLE([plugin], AC_MSG_RESULT(${enable_plugin}) ]) +dnl GTK_CHECK_VERSION([gtk version], [ACTION-IF-FOUND], [ACTION-IF-NOT]) +AC_DEFUN([GTK_CHECK_VERSION], +[ + if pkg-config --modversion gtk+-$1 &> /dev/null; then + $2 + else + $3 + fi +]) + +dnl GTK_SET_CXX_VARS([gtk version]) +AC_DEFUN([GTK_SET_CXX_VARS], +[ + GTK_CFLAGS=`pkg-config --cflags gtk+-$1` + GTK_LIBS=`pkg-config --libs gtk+-$1` +]) + +dnl GTK_CHECK([gtk version]) +AC_DEFUN([GTK_CHECK], +[ + AC_CACHE_CHECK([for GTK+], [gtk_cv_version], + [ + case "$1" in + default) + GTK_CHECK_VERSION(["3.0"], + [echo -n "3.0" + GTK_SET_CXX_VARS(["3.0"])], + [GTK_CHECK_VERSION(["2.0"], + [echo -n "2.0" + GTK_SET_CXX_VARS(["2.0"])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([GTK+ not found])])]) + ;; + *) + GTK_CHECK_VERSION([$1], + [echo -n "$1" + GTK_SET_CXX_VARS([$1])], + [AC_MSG_RESULT([no]) + 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.0|3.0], + [the GTK+ version to use (default: 3.0)])], + [case "$with_gtk" in + 2.0|3.0) ;; + *) AC_MSG_ERROR([invalid GTK+ version specified]) ;; + esac], + [with_gtk=default]) + GTK_CHECK([$with_gtk]) PKG_CHECK_MODULES(GLIB, glib-2.0) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS)