From a7fc76a1c506aca9494c5f1d6bfad970d5a70179 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 14 Jun 2011 14:47:14 +0100 Subject: [PATCH] build: Disable deprecated symbols during development cycles And add a configure switch to toggle them. --- clutter/Makefile.am | 5 +---- configure.ac | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/clutter/Makefile.am b/clutter/Makefile.am index 7702a0e5e..1ab56f2ec 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -28,12 +28,9 @@ AM_CPPFLAGS = \ -DCLUTTER_DATADIR=\""$(datadir)"\" \ -DCLUTTER_LOCALEDIR=\""$(localedir)"\" \ -DCLUTTER_COMPILATION=1 \ - -DCLUTTER_DISABLE_DEPRECATED \ - -DCOGL_DISABLE_DEPRECATED \ -DCOGL_ENABLE_EXPERIMENTAL_API \ - -DG_DISABLE_DEPRECATED \ - -DG_DISABLE_SINGLE_INCLUDES \ -DG_LOG_DOMAIN=\"Clutter\" \ + $(CLUTTER_DEPRECATED_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ $(CLUTTER_PROFILE_CFLAGS) \ $(NULL) diff --git a/configure.ac b/configure.ac index df5470fd9..cdba2a739 100644 --- a/configure.ac +++ b/configure.ac @@ -687,6 +687,38 @@ AS_CASE([$enable_debug], AC_SUBST(CLUTTER_DEBUG_CFLAGS) +dnl === Enable deprecation guards ================================================== + +m4_define([deprecated_default], + [m4_if(m4_eval(clutter_minor_version % 2), + [1], + [no], + [yes])]) + +AC_ARG_ENABLE([deprecated], + [AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@], + [Whether deprecated symbols should be disabled when compiling Clutter])], + [], + [enable_deprecated=deprecated_default]) + +AS_CASE([$enable_deprecated], + + [no], + [ + CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED -DCLUTTER_DISABLE_DEPRECATED" + ], + + [yes], + [ + CLUTTER_DEPRECATED_CFLAGS="" + ], + + [AC_MSG_ERROR([Unknown argument for --enable-deprecated])] +) + +AC_SUBST([CLUTTER_DEPRECATED_CFLAGS]) + + dnl === Conformance test suite ================================================ AC_ARG_ENABLE([conformance], @@ -955,6 +987,7 @@ echo " Clutter debug level: ${enable_debug}" echo " Compiler flags: ${CFLAGS} ${MAINTAINER_CFLAGS}" echo " Profiling enabled: ${enable_profile}" echo " Enable coverage tests: ${enable_gcov}" +echo " Enable deprecated symbols: ${enable_deprecated}" # Documentation echo ""