From: Trond Norbye Date: Thu, 11 Jun 2009 07:31:09 +0000 (+0200) Subject: New configure flag: --enable-deprecated X-Git-Tag: 0.31~16^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=a8cff61fe8249af0112631c0c5c53cd7049a3918;p=m6w6%2Flibmemcached New configure flag: --enable-deprecated By default we don't compile in the deprecated interface (so that continuing to use it will be a bit more painful ;-) I had to create a new file to keep track of the #defines, because the clients of libmemcached doesn't see libmemcached_config.h. --- diff --git a/.bzrignore b/.bzrignore index 7cb02a8e..f629619a 100644 --- a/.bzrignore +++ b/.bzrignore @@ -105,6 +105,7 @@ libmemcached/jenkins_hash.lo libmemcached/libmemcached.la libmemcached/libmemcached_config.h libmemcached/libmemcached_config.h.in +libmemcached/memcached_configure.h libmemcached/md5.lo libmemcached/memcached.lo libmemcached/memcached_analyze.lo diff --git a/configure.ac b/configure.ac index af6d399e..17d3ff48 100644 --- a/configure.ac +++ b/configure.ac @@ -84,6 +84,7 @@ sinclude(m4/memcached.m4) sinclude(m4/setsockopt.m4) sinclude(m4/hsieh.m4) sinclude(m4/util.m4) +sinclude(m4/deprecated.m4) dnl This is likely subverted by vpath builds. How do we find the original dnl source dir in the configure step of a vpath build? @@ -158,6 +159,7 @@ AC_CONFIG_FILES([ tests/Makefile docs/Makefile libmemcached/Makefile + libmemcached/memcached_configure.h libmemcachedutil/Makefile support/Makefile support/libmemcached.pc diff --git a/libmemcached/Makefile.am b/libmemcached/Makefile.am index be314700..4274a5d4 100644 --- a/libmemcached/Makefile.am +++ b/libmemcached/Makefile.am @@ -1,4 +1,5 @@ -EXTRA_DIST = libmemcached_probes.d memcached/README.txt libmemcached.ver +EXTRA_DIST = libmemcached_probes.d memcached/README.txt libmemcached.ver \ + memcached_configure.h.in BUILT_SOURCES= @DTRACE_HEADER@ diff --git a/libmemcached/memcached.h b/libmemcached/memcached.h index 7f2b9a34..e389c388 100644 --- a/libmemcached/memcached.h +++ b/libmemcached/memcached.h @@ -21,6 +21,7 @@ #ifdef MEMCACHED_INTERNAL #include #endif +#include #include #include #include diff --git a/libmemcached/memcached_configure.h.in b/libmemcached/memcached_configure.h.in new file mode 100644 index 00000000..d3af270a --- /dev/null +++ b/libmemcached/memcached_configure.h.in @@ -0,0 +1,22 @@ +/* + * Summary: Preprocessor symbols set from configure we need install-time + * + * Copy: See Copyright for the status of this software. + * + * Author: Trond Norbye + */ + +#ifndef MEMCACHED_CONFIGURE_H +#define MEMCACHED_CONFIGURE_H + +#ifdef __cplusplus +extern "C" { +#endif + +@DEPRECATED@ + +#ifdef __cplusplus +} +#endif + +#endif /* MEMCACHED_CONFIGURE_H */ diff --git a/m4/deprecated.m4 b/m4/deprecated.m4 new file mode 100644 index 00000000..9268f776 --- /dev/null +++ b/m4/deprecated.m4 @@ -0,0 +1,18 @@ +dnl --------------------------------------------------------------------------- +dnl Macro: deprecated +dnl --------------------------------------------------------------------------- +AC_ARG_ENABLE([deprecated], + [AS_HELP_STRING([--enable-deprecated], + [Enable deprecated interface @<:@default=off@:>@])], + [ac_enable_deprecated="$enableval"], + [ac_enable_deprecated="no"]) + +if test "x$ac_enable_deprecated" = "xyes" +then + DEPRECATED="#define MEMCACHED_ENABLE_DEPRECATED 1" +fi + +AC_SUBST(DEPRECATED) +dnl --------------------------------------------------------------------------- +dnl End Macro: deprecated +dnl ---------------------------------------------------------------------------