aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-11-29 03:54:24 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-11-29 04:59:40 +0800
commit19b26e86d0f995ef1b508a982a0c0ade605023b2 (patch)
tree9f64d62b72519bf05233739be6c717731fb24761
parentaef0e1e7fd70373218cc395ddc74ac178ba9ca2f (diff)
downloadgsoc2013-evolution-19b26e86d0f995ef1b508a982a0c0ade605023b2.tar
gsoc2013-evolution-19b26e86d0f995ef1b508a982a0c0ade605023b2.tar.gz
gsoc2013-evolution-19b26e86d0f995ef1b508a982a0c0ade605023b2.tar.bz2
gsoc2013-evolution-19b26e86d0f995ef1b508a982a0c0ade605023b2.tar.lz
gsoc2013-evolution-19b26e86d0f995ef1b508a982a0c0ade605023b2.tar.xz
gsoc2013-evolution-19b26e86d0f995ef1b508a982a0c0ade605023b2.tar.zst
gsoc2013-evolution-19b26e86d0f995ef1b508a982a0c0ade605023b2.zip
Use version-based GLib/GDK/GTK+ warnings.
Use GLIB_VERSION_MAX_ALLOWED and GDK_VERSION_MAX_ALLOWED to warn if we accidentally use symbols that were introduced in versions subsequent to our minimum requirement. Use GLIB_VERSION_MIN_REQUIRED and GDK_VERSION_MIN_REQUIRED to suppress deprecation warnings by version so we can clean them up incrementally. The initial values produce a few deprecation warnings which should not be terribly difficult to clean up.
-rw-r--r--configure.ac26
1 files changed, 22 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 3b9ba33463..7f5f844756 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,8 +31,15 @@ dnl Automake 1.11 - Silent Build Rules
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl Required Packages
+
+dnl Keep these two definitions in agreement.
m4_define([glib_minimum_version], [2.34.0])
-m4_define([gtk_minimum_version], [3.4.0])
+m4_define([glib_encoded_version], [GLIB_VERSION_2_34])
+
+dnl Keep these two definitions in agreement.
+m4_define([gdk_minimum_version], [3.4.0])
+m4_define([gdk_encoded_version], [GDK_VERSION_3_4])
+
m4_define([eds_minimum_version], [evo_version])
m4_define([gtkhtml_minimum_version], [4.5.2])
m4_define([gnome_desktop_minimum_version], [2.91.3])
@@ -65,10 +72,10 @@ dnl Compiler Warning Flags
dnl ******************************
AS_COMPILER_FLAGS(WARNING_FLAGS,
"-Wall -Wextra
+ -Wdeprecated-declarations
-Wno-missing-field-initializers
-Wno-sign-compare
-Wno-unused-parameter
- -Wno-deprecated-declarations
-Wdeclaration-after-statement
-Werror-implicit-function-declaration
-Wformat-security -Winit-self
@@ -114,6 +121,17 @@ if test "x$enable_strict" = xyes; then
AM_CPPFLAGS="$AM_CPPFLAGS -DG_DISABLE_DEPRECATED -DE_BOOK_DISABLE_DEPRECATED -DE_CAL_DISABLE_DEPRECATED"
fi
+dnl Warn about GLib/GTK+ API usage that violates our minimum requirements.
+AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MAX_ALLOWED=glib_encoded_version"
+AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MAX_ALLOWED=gdk_encoded_version"
+
+dnl These will suppress warnings about newly-deprecated symbols. Ideally
+dnl these settings should match our minimum requirements and we will clean
+dnl up any new deprecation warnings after bumping our minimum requirements.
+dnl But if the warnings get to be overwhelming, use fixed versions instead.
+AM_CPPFLAGS="$AM_CPPFLAGS -DGLIB_VERSION_MIN_REQUIRED=glib_encoded_version"
+AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_0"
+
AC_SUBST(AM_CPPFLAGS)
AC_CANONICAL_HOST
@@ -260,8 +278,8 @@ PKG_CHECK_MODULES([GNOME_PLATFORM],
[gio-2.0 >= glib_minimum_version
gmodule-2.0 >= glib_minimum_version
cairo-gobject
- gtk+-3.0 >= gtk_minimum_version
- gail-3.0 >= gtk_minimum_version
+ gtk+-3.0 >= gdk_minimum_version
+ gail-3.0 >= gdk_minimum_version
libxml-2.0 >= libxml_minimum_version
shared-mime-info >= shared_mime_info_minimum_version
gnome-desktop-3.0 >= gnome_desktop_minimum_version