[clutter] build: Disable deprecated symbols during development cycles



commit a7fc76a1c506aca9494c5f1d6bfad970d5a70179
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Tue Jun 14 14:47:14 2011 +0100

    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 7702a0e..1ab56f2 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 df5470f..cdba2a7 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 ""



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