[nautilus-actions] Add --enable-deprecated configure option



commit c82e452ed6da427da812e8089ee718c9720e3de1
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Feb 16 22:58:04 2011 +0100

    Add --enable-deprecated configure option

 ChangeLog                |    3 +++
 configure.ac             |   13 +++++++++++--
 m4/na-maintainer-mode.m4 |   19 +++++++++++++++++++
 3 files changed, 33 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7ea65a9..ec3c71d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2011-02-16 Pierre Wieser <pwieser trychlos org>
 
+	* configure.ac:
+	* m4/na-maintainer-mode.m4: Add --enable-deprecated configure option.
+
 	* src/api/na-object-api.h (na_object_set_modified): Deprecated macro.
 
 	* src/api/na-iduplicable.h:
diff --git a/configure.ac b/configure.ac
index fb5bc97..4778afb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -111,6 +111,9 @@ AC_SUBST([GETTEXT_PACKAGE])
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["${GETTEXT_PACKAGE}"],[gettext package])
 AM_GLIB_GNU_GETTEXT
 
+# Enable deprecated functions ?
+NA_ENABLE_DEPRECATED
+
 # Have and want GConf support ?
 NA_CHECK_FOR_GCONF
 
@@ -151,8 +154,10 @@ AC_SUBST([NAUTILUS_ACTIONS_CFLAGS])
 AC_SUBST([NAUTILUS_ACTIONS_LIBS])
 
 # check for gtk-doc
-# Starting with gtk-doc 1.15, multiple source dirs are directly handled
-# by gtk-doc.make
+# - starting with gtk-doc 1.15, multiple source dirs are directly handled
+#   by gtk-doc.make
+# - API documentation should not be built (would be incomplete) when deprecated
+#   symbols are not enabled
 GTK_DOC_CHECK([1.10],[--flavour no-tmpl])
 have_gtk_doc_115="no"
 if test "x${enable_gtk_doc}" = "xyes"; then
@@ -161,6 +166,9 @@ if test "x${enable_gtk_doc}" = "xyes"; then
 	AC_MSG_RESULT([${have_gtk_doc_115}])
 fi
 AM_CONDITIONAL([HAVE_GTK_DOC_115], [test x$have_gtk_doc_115 = xyes])
+if test "x${enable_gtk_doc}" = "xyes" -a "${enable_deprecated}" = "no"; then
+	AC_MSG_WARN([API documentation will be incomplete as deprecated symbols are disabled])
+fi
 
 # defines log domains when in maintainer mode
 NA_LOG_DOMAINS
@@ -201,6 +209,7 @@ $as_echo "
 	Nautilus extensions directory   ${with_nautilus_extdir}
 	Gtk+ version                    ${msg_gtk_version}
 	Default I/O provider            ${with_default_io_provider}
+	Enable deprecated functions     ${enable_deprecated}
 	GConf enabled                   ${enable_gconf}
 	GConf schemas installation      ${msg_schemas_install}
 	Maintainer mode                 ${msg_maintainer_mode}
diff --git a/m4/na-maintainer-mode.m4 b/m4/na-maintainer-mode.m4
index ff875b9..77788ce 100644
--- a/m4/na-maintainer-mode.m4
+++ b/m4/na-maintainer-mode.m4
@@ -42,3 +42,22 @@ AC_DEFUN([NA_IS_MAINTAINER_MODE],[
 
 	AM_CONDITIONAL([NA_MAINTAINER_MODE], [test "${USE_MAINTAINER_MODE}" = "yes"])
 ])
+
+AC_DEFUN([NA_ENABLE_DEPRECATED],[
+	AC_ARG_ENABLE(
+		[deprecated],
+		AC_HELP_STRING(
+			[--enable-deprecated],
+			[whether to enable deprecated functions @<:@no@:>@]
+		),
+	[enable_deprecated=$enableval],
+	[enable_deprecated="no"]
+	)
+
+	if test "${enable_deprecated}" = "no"; then
+		AC_DEFINE([NA_DISABLE_DEPRECATED],[1],[Define to 1 if deprecated functions should be disabled])
+		AC_SUBST([AM_CPPFLAGS],["${AM_CPPFLAGS} ${NA_DISABLE_DEPRECATED}"])
+	fi
+
+	AM_CONDITIONAL([ENABLE_DEPRECATED], [test "${enable_deprecated}" = "yes"])
+])



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