[frogr] Allow deciding to use the GtkHeaderBar at configure time (default: no)



commit 96cd20f0ed25227c44559b4f5d5d490520c11921
Author: Mario Sanchez Prada <msanchez gnome org>
Date:   Sat Oct 11 07:42:51 2014 +0100

    Allow deciding to use the GtkHeaderBar at configure time (default: no)
    
    Useful for platforms where we might prefer not to use this (e.g. OS X)

 configure.ac |   59 ++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 41 insertions(+), 18 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e4dcc29..fa54081 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,11 +22,6 @@ PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0)
 FROGR_CFLAGS="$FROGR_CFLAGS $GLIB_CFLAGS"
 FROGR_LIBS="$FROGR_LIBS $GLIB_LIBS"
 
-GTK3_MIN_VERSION=3.4
-PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= $GTK3_MIN_VERSION)
-FROGR_CFLAGS=$GTK3_CFLAGS
-FROGR_LIBS=$GTK3_LIBS
-
 LIBSOUP_MIN_VERSION=2.34
 PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= $LIBSOUP_MIN_VERSION])
 FROGR_CFLAGS="$FROGR_CFLAGS $LIBSOUP_CFLAGS"
@@ -65,21 +60,32 @@ else
 fi
 AM_CONDITIONAL([PLATFORM_MAC],[test "x$osx" = "xyes"])
 
-# Debug mode
-AC_MSG_CHECKING([Checking whether to enable debug output])
-AC_ARG_ENABLE(debug,
-              AC_HELP_STRING([--enable-debug],
-                             [turn on debugging [default=no]]),
-              [],[enable_debug="no"])
-AC_MSG_RESULT([$enable_debug])
+# Enable GtkHeaderBar (requires GTK+ 3.10)
+AC_MSG_CHECKING([Checking whether to enable the GtkHeaderBar])
+AC_ARG_ENABLE(header-bar,
+              AC_HELP_STRING([--enable-header-bar],
+                             [Enable GtkHeaderBar [default=no]]),
+              [header_bar_feature="$enableval"],[header_bar_feature="no"])
+AC_MSG_RESULT([$header_bar_feature])
 
-if test "x$enable_debug" = "xyes"; then
-   AC_DEFINE([DEBUG_ENABLED], [1], [Debug enabled])
-   CFLAGS="$CFLAGS -DG_ENABLE_DEBUG -DG_ERRORCHECK_MUTEXES -Wall -Werror -g3 -O0"
-   CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED 
-DGDK_PIXBUF_DISABLE_DEPRECATED -DSOUP_DISABLE_DEPRECATED"
-else
-   CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
+GTK3_MIN_VERSION=3.4
+if test "x$header_bar_feature" = "xyes"; then
+   with_gtk_3_10="no"
+   PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.10,
+                     [with_gtk_3_10="yes"], [with_gtk_3_10="no"])
+
+   # Disable header bar and fallback to GTK+ minimum version if 3.10 is not found
+   if test "x$with_gtk_3_10" = "xyes"; then
+      AC_DEFINE(USE_HEADER_BAR, 1, [Use GtkHeaderBar])
+   else
+      header_bar_feature="no"
+   fi
 fi
+if test "x$header_bar_feature" = "xno"; then
+   PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= $GTK3_MIN_VERSION)
+fi
+FROGR_CFLAGS="$FROGR_CFLAGS $GTK3_CFLAGS"
+FROGR_LIBS="$FROGR_LIBS $GTK3_LIBS"
 
 # Enable video uploads (requires GStreamer)
 AC_MSG_CHECKING([Checking whether to enable video uploads])
@@ -110,6 +116,22 @@ if test "x$video_feature" = "xyes"; then
    AC_DEFINE(HAVE_GSTREAMER, 1, [Have GStreamer available])
 fi
 
+# Debug mode
+AC_MSG_CHECKING([Checking whether to enable debug output])
+AC_ARG_ENABLE(debug,
+              AC_HELP_STRING([--enable-debug],
+                             [turn on debugging [default=no]]),
+              [],[enable_debug="no"])
+AC_MSG_RESULT([$enable_debug])
+
+if test "x$enable_debug" = "xyes"; then
+   AC_DEFINE([DEBUG_ENABLED], [1], [Debug enabled])
+   CFLAGS="$CFLAGS -DG_ENABLE_DEBUG -DG_ERRORCHECK_MUTEXES -Wall -Werror -g3 -O0"
+   CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED 
-DGDK_PIXBUF_DISABLE_DEPRECATED -DSOUP_DISABLE_DEPRECATED"
+else
+   CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
+fi
+
 # Translations
 FROGR_LOCALE_DIR='${localedir}'
 AM_GLIB_DEFINE_LOCALEDIR([FROGR_LOCALE_DIR])
@@ -149,6 +171,7 @@ echo "  Platform              : $platform"
 echo "  Debug symbols         : $enable_debug"
 echo ""
 echo "Optional features:"
+echo "  Use GtkHeaderBar      : $header_bar_feature"
 echo "  Enable video uploads  : $video_feature"
 echo ""
 echo ""


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