[evolution-data-server] Use version-based GLib/GDK/GTK+ warnings.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Use version-based GLib/GDK/GTK+ warnings.
- Date: Wed, 28 Nov 2012 21:00:56 +0000 (UTC)
commit 1dc565d12e64260e640c8c50a9c63b43b62b84e4
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Nov 28 14:31:24 2012 -0500
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 no deprecation warnings.
configure.ac | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b4a2af9..69170d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,8 +33,15 @@ dnl Automake 1.11 - Silent Build Rules
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl Required Package Versions
+
+dnl Keep these two definitions in agreement.
m4_define([glib_minimum_version], [2.34])
-m4_define([gtk_minimum_version], [3.2])
+m4_define([glib_encoded_version], [GLIB_VERSION_2_34])
+
+dnl Keep these two definitions in agreement.
+m4_define([gdk_minimum_version], [3.2])
+m4_define([gdk_encoded_version], [GDK_VERSION_3_2])
+
m4_define([gcr_minimum_version], [3.4])
m4_define([libsecret_minimum_version], [0.5])
m4_define([libxml_minimum_version], [2.0.0]) dnl XXX Just a Guess
@@ -157,6 +164,7 @@ dnl Compiler Warning Flags
dnl ******************************
AS_COMPILER_FLAGS(WARNING_FLAGS,
"-Wall -Wextra
+ -Wdeprecated-declarations
-Wno-missing-field-initializers
-Wno-sign-compare
-Wno-unused-parameter
@@ -199,11 +207,20 @@ fi
AC_MSG_RESULT([$enable_strict])
if test "x$enable_strict" = xyes; then
- AM_CPPFLAGS="$AM_CPPFLAGS -Wdeprecated-declarations -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DLIBSOUP_DISABLE_DEPRECATED"
-else
- AM_CPPFLAGS="$AM_CPPFLAGS -Wno-deprecated-declarations"
+ AM_CPPFLAGS="$AM_CPPFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DLIBSOUP_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_encoded_version"
+
AC_SUBST(AM_CPPFLAGS)
dnl ******************************
@@ -340,7 +357,7 @@ dnl ***********************************
PKG_CHECK_MODULES(GNOME_PLATFORM,
[gio-2.0 >= glib_minimum_version
gmodule-2.0 >= glib_minimum_version
- gtk+-3.0 >= gtk_minimum_version
+ gtk+-3.0 >= gdk_minimum_version
libxml-2.0 >= libxml_minimum_version
libsoup-2.4 >= libsoup_minimum_version
libgdata >= libgdata_minimum_version])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]