Commit 3ee24532 authored by Christian Persch's avatar Christian Persch

Simplify configure check for gtk 2 + 3

parent 5b2dd097
......@@ -4,11 +4,9 @@ NULL =
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
if ENABLE_GTK_ENGINE
if HAVE_GTK_2
if ENABLE_GTK2_ENGINE
SUBDIRS += gtk-engine
endif
endif
lib_LTLIBRARIES = librsvg-@RSVG_API_MAJOR_VERSION@.la
......
......@@ -37,7 +37,7 @@ CAIRO_REQUIRED=1.2.0
PANGOCAIRO_REQUIRED=1.10.0
GDK_PIXBUF_REQUIRED=1.3.7
GTK2_REQUIRED=2.16.0
GTK3_REQUIRED=2.90.0
GTK3_REQUIRED=3.0.0
# ===========================================================================
......@@ -223,40 +223,45 @@ else
AC_MSG_RESULT(no)
fi
dnl ===========================================================================
dnl GTK theme engine
dnl ===========================================================================
# ===========================================================================
# GTK
# ===========================================================================
AC_MSG_CHECKING([whether to build the GTK+ theme engine])
AC_ARG_ENABLE([gtk-theme],
[AS_HELP_STRING([--disable-gtk-theme],[Disable a RSVG based GTK+ theme engine (default=yes)])],
[],[enable_gtk_theme=yes])
AC_MSG_RESULT([$enable_gtk_theme])
PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= $GTK2_REQUIRED],[have_gtk_2=yes],[have_gtk_2=no])
PKG_CHECK_MODULES([GTK3],[gtk+-3.0 >= $GTK3_REQUIRED],[have_gtk_3=yes],[have_gtk_3=no])
have_gtk_2=no
have_gtk_3=no
GTK2_BINARY_VERSION=
GTK3_BINARY_VERSION=
if test "x$enable_gtk_theme" = "xyes" -o "x$enable_pixbuf_loader" = "xyes"; then
PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= $GTK2_REQUIRED],[have_gtk_2=yes],[have_gtk_2=no])
PKG_CHECK_MODULES([GTK3],[gtk+-3.0 >= $GTK3_REQUIRED],[have_gtk_3=yes],[have_gtk_3=no])
if test "$have_gtk_2" = "yes"; then
GTK2_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`"
fi
if test "$have_gtk_3" = "yes"; then
GTK3_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`"
fi
if test "$have_gtk_2" = "yes"; then
GTK2_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`"
fi
if test "$have_gtk_3" = "yes"; then
GTK3_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`"
fi
AC_SUBST([GTK2_BINARY_VERSION])
AC_SUBST([GTK3_BINARY_VERSION])
AM_CONDITIONAL([ENABLE_GTK_ENGINE],[test "$enable_gtk_theme" = "yes"])
AM_CONDITIONAL([HAVE_GTK_2],[test "$have_gtk_2" = "yes"])
AM_CONDITIONAL([HAVE_GTK_3],[test "$have_gtk_3" = "yes"])
# ===========================================================================
# GTK theme engine
# ===========================================================================
if test "$have_gtk_2"; then
AC_MSG_CHECKING([whether to build the GTK+ theme engine])
AC_ARG_ENABLE([gtk-theme],
[AS_HELP_STRING([--disable-gtk-theme],[Disable a RSVG based GTK+ theme engine (default=yes)])],
[],[enable_gtk_theme=yes])
AC_MSG_RESULT([$enable_gtk_theme])
else
enable_gtk_theme=no
fi
AM_CONDITIONAL([ENABLE_GTK2_ENGINE],[test "$enable_gtk_theme" = "yes"])
dnl ===========================================================================
dnl GDK-Pixbuf SVG loader
dnl ===========================================================================
......@@ -392,7 +397,9 @@ librsvg-$VERSION
Build introspectable bindings: ${found_introspection}
Build GdkPixbuf loader: ${enable_pixbuf_loader}
Build theme engine: ${enable_gtk_theme}
GTK 2.0: ${have_gtk_2}
GTK 3.0: ${have_gtk_3}
Build GTK 2.0 theme engine: ${enable_gtk_theme}
Build miscellaenous tools: ${build_misc_tools}
Handle svgz files: ${test_svgz}
Use libcroco for css parsing: ${test_croco}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment