From 7decc2f30b5b1187d0969a13f453b8be6ee1111e Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 29 Nov 2005 15:53:27 +0000 Subject: Added --enable-deprecated-api option. When set to disabled, it does not 2005-11-29 Murray Cumming * build_shared/Makefile_build.am_fragment: * configure.in: Added --enable-deprecated-api option. When set to disabled, it does not build deprecated API. This reduces the size of the library, and might be useful for embedded devices. * glib/src/date.ccg: * glib/src/date.hg: Use _DEPRECATE_IFDEF_START/END around the deprecated set_time() method. --- ChangeLog | 11 +++++++++++ build_shared/Makefile_build.am_fragment | 2 +- configure.in | 14 ++++++++++++++ glib/src/date.ccg | 2 ++ glib/src/date.hg | 2 ++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bcda6c39..d4990d5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-11-29 Murray Cumming + + * build_shared/Makefile_build.am_fragment: + * configure.in: Added --enable-deprecated-api + option. When set to disabled, it does not build + deprecated API. This reduces the size of the library, + and might be useful for embedded devices. + * glib/src/date.ccg: + * glib/src/date.hg: Use _DEPRECATE_IFDEF_START/END + around the deprecated set_time() method. + 2005-11-29 Murray Cumming * tools/m4/base.m4: Add diff --git a/build_shared/Makefile_build.am_fragment b/build_shared/Makefile_build.am_fragment index 0c36fc55..edfe7da8 100644 --- a/build_shared/Makefile_build.am_fragment +++ b/build_shared/Makefile_build.am_fragment @@ -42,7 +42,7 @@ all_includes = -I$(top_builddir)/glib -I$(top_srcdir)/glib \ $(sublib_cflags) $(GTHREAD_CFLAGS) extra_defines = -DG_LOG_DOMAIN=\"$(sublib_name)\" \ - -DG_DISABLE_DEPRECATED + -DG_DISABLE_DEPRECATED $(GLIBMM_DISABLE_DEPRECATED) dist_sources = $(files_built_all_cc) $(files_extra_all_cc) \ $(files_built_all_h) $(files_extra_all_h) diff --git a/configure.in b/configure.in index d2c2a20c..71d899f4 100644 --- a/configure.in +++ b/configure.in @@ -213,6 +213,20 @@ GLIBMM_ARG_ENABLE_DEBUG_REFCOUNTING() # Evaluate the --enable-warnings=level option. GTKMM_ARG_ENABLE_WARNINGS() + +# Add an --enable-deprecated-api option: +AC_ARG_ENABLE(deprecated-api, [AC_HELP_STRING([--enable-deprecated-api], + [include (build) deprecated API in the libraries [default=yes]])],, + [enable_deprecated_api=yes]) +if test "x$enable_deprecated_api" = "xyes"; then +AC_MSG_WARN([Deprecated API will be built, for backwards-compatibility.]) +else + DISABLE_DEPRECATED_API_CFLAGS="-DGLIBMM_DISABLE_DEPRECATED" +AC_SUBST(DISABLE_DEPRECATED_API_CFLAGS) +AC_MSG_WARN([Deprecated API will not be built, breaking backwards-compatibility. Do not use this build for distribution packages.]) +fi + + # Dummy conditional just to make automake-1.4 happy. # We need an always-false condition in docs/Makefile.am. AM_CONDITIONAL(GTKMM_FALSE,[false]) diff --git a/glib/src/date.ccg b/glib/src/date.ccg index 68edafe2..e70a0e26 100644 --- a/glib/src/date.ccg +++ b/glib/src/date.ccg @@ -65,11 +65,13 @@ void Date::set_parse(const Glib::ustring& str) g_date_set_parse(&gobject_, str.c_str()); } +_DEPRECATE_IFDEF_START void Date::set_time(GTime time) { //This method, and the C function that it wraps, are deprecated. g_date_set_time(&gobject_, time); } +_DEPRECATE_IFDEF_END void Date::set_time(time_t timet) { diff --git a/glib/src/date.hg b/glib/src/date.hg index f17b87f2..0a223901 100644 --- a/glib/src/date.hg +++ b/glib/src/date.hg @@ -70,6 +70,7 @@ public: */ void set_parse (const Glib::ustring& str); + _DEPRECATE_IFDEF_START /** Sets the value of a date from a GTime (time_t) value. * * @param time GTime value to set. @@ -77,6 +78,7 @@ public: * @deprecated Please use set_time(time_t) or set_time(const GTimeVal&). */ void set_time(GTime time); + _DEPRECATE_IFDEF_END /** Sets the value of a date from a time_t value. * -- cgit v1.2.1