[Xfce4-commits] [apps/mousepad] 04/10: Add support for building with GTK3 to build system

noreply at xfce.org noreply at xfce.org
Sat Jul 19 13:47:13 CEST 2014


This is an automated email from the git hooks/post-receive script.

mbrush pushed a commit to branch master
in repository apps/mousepad.

commit 79766fed3937a7c8ffe7730ac2da0e69d0ffeb69
Author: Matthew Brush <mbrush at codebrainz.ca>
Date:   Wed Jul 16 01:03:14 2014 -0700

    Add support for building with GTK3 to build system
---
 configure.ac.in |   29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 673d45a..57285eb 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -84,8 +84,32 @@ dnl *** Check for required packages ***
 dnl ***********************************
 XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.30.0])
 XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.30.0])
-XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.24.0])
-XDT_CHECK_PACKAGE([GTKSOURCEVIEW], [gtksourceview-2.0])
+
+dnl **********************
+dnl *** GTK+ 3 support ***
+dnl **********************
+
+AC_ARG_ENABLE([gtk3], [
+  AS_HELP_STRING([--enable-gtk3], [Build against GTK+ 3 instead of GTK+ 2])
+])
+
+# Hard-fail if --enable-gtk3(=yes) was supplied and no GTK3 package
+AS_IF([test "x$enable_gtk3" = "xyes"], [PKG_CHECK_MODULES([GTK], [gtk+-3.0])])
+
+# Fall back to GTK2 package if GTK3 package is not found and --enable-gtk3=auto
+AS_IF([test "x$enable_gtk3" = "xauto"], [
+  PKG_CHECK_MODULES([GTK], [gtk+-3.0], [enable_gtk3="yes"], [enable_gtk3="no"])
+])
+
+# If --enable-gtk3=no/--disable-gtk3 or with auto GTK3 package was not found
+AS_IF([test "x$enable_gtk3" = "xno"], [PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.24])])
+
+# Decide which GtkSourceView to use based on GTK 2 or 3
+AS_IF([test "x$enable_gtk3" = "xyes"],
+      [PKG_CHECK_MODULES([GTKSOURCEVIEW], [gtksourceview-3.0])],
+      [PKG_CHECK_MODULES([GTKSOURCEVIEW], [gtksourceview-2.0])])
+
+AM_CONDITIONAL([WITH_GTK3], [test "x$enable_gtk3" = "xyes"])
 
 dnl ************************************
 dnl *** Enable support for GSettings ***
@@ -149,4 +173,5 @@ echo "* D-BUS support:             no"
 fi
 echo "* Debug Support:             $enable_debug"
 echo "* Use keyfile backend:       $enable_keyfile_settings"
+echo "* Building with GTK+ 3:      $enable_gtk3"
 echo

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list