New configure flag: --enable-deprecated
authorTrond Norbye <trond.norbye@sun.com>
Thu, 11 Jun 2009 07:31:09 +0000 (09:31 +0200)
committerTrond Norbye <trond.norbye@sun.com>
Thu, 11 Jun 2009 07:31:09 +0000 (09:31 +0200)
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.

.bzrignore
configure.ac
libmemcached/Makefile.am
libmemcached/memcached.h
libmemcached/memcached_configure.h.in [new file with mode: 0644]
m4/deprecated.m4 [new file with mode: 0644]

index 7cb02a8e50b61c6785f92a97e870e6a1f4b9b02f..f629619a6fa0ffe4d0b6bc2b9784227311eb0e16 100644 (file)
@@ -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
index af6d399efe0efc0da68dd8797e0ecdc43321ea21..17d3ff4804a6d75761396f1b1422933754954cc9 100644 (file)
@@ -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
index be314700e3e333ba0f2685cdc34051e2bc57c320..4274a5d4d84f3dddc2752a4a8c9b86620ef02db2 100644 (file)
@@ -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@
 
index 7f2b9a3449ab9f532342d6ca77bdda8d1115b97c..e389c388e67a96f6c75a4add22084dac910bf3fc 100644 (file)
@@ -21,6 +21,7 @@
 #ifdef MEMCACHED_INTERNAL
 #include <libmemcached/libmemcached_config.h>
 #endif
+#include <libmemcached/memcached_configure.h>
 #include <libmemcached/memcached_constants.h>
 #include <libmemcached/memcached_types.h>
 #include <libmemcached/memcached_watchpoint.h>
diff --git a/libmemcached/memcached_configure.h.in b/libmemcached/memcached_configure.h.in
new file mode 100644 (file)
index 0000000..d3af270
--- /dev/null
@@ -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 (file)
index 0000000..9268f77
--- /dev/null
@@ -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 ---------------------------------------------------------------------------