[librsvg] Simplify configure check for gtk 2 + 3



commit 3ee24532461d1eaf1320638fa54c8fefe5e315ac
Author: Christian Persch <chpe gnome org>
Date:   Wed Sep 7 19:50:53 2011 +0200

    Simplify configure check for gtk 2 + 3

 Makefile.am  |    4 +---
 configure.in |   53 ++++++++++++++++++++++++++++++-----------------------
 2 files changed, 31 insertions(+), 26 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 493f905..245c165 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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
 
diff --git a/configure.in b/configure.in
index 62f6a85..e39b4c3 100644
--- a/configure.in
+++ b/configure.in
@@ -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}



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