-AC_DEFINE([HAVE_LIBMEMCACHED], [ 1 ], [dummy rule for libtest])
-AC_SUBST(HAVE_LIBMEMCACHED, 1)
-AM_CONDITIONAL(HAVE_LIBMEMCACHED, true)
-LT_INIT
-
-AH_TOP([
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#ifdef _SYS_FEATURE_TESTS_H
-#error "You should include config.h as your first include file"
-#endif
-
-#ifdef WIN32
-#define _WIN32_WINNT 0x0501
-#endif
-])
-
-AH_BOTTOM([
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-
-#ifdef HAVE_FNMATCH_H
-#include <fnmatch.h>
-#endif
-
-#ifdef HAVE_POLL_H
-#include <poll.h>
-#else
-#include "poll/poll.h"
-#endif
-
-/* To hide the platform differences between MS Windows and Unix, I am
- * going to use the Microsoft way and #define the Microsoft-specific
- * functions to the unix way. Microsoft use a separate subsystem for sockets,
- * but Unix normally just use a filedescriptor on the same functions. It is
- * a lot easier to map back to the unix way with macros than going the other
- * way without side effect ;-)
- */
-#ifdef WIN32
-#include "win32/wrappers.h"
-#define get_socket_errno() WSAGetLastError()
-#else
-#define INVALID_SOCKET -1
-#define SOCKET_ERROR -1
-#define closesocket(a) close(a)
-#define get_socket_errno() errno
-#endif
-
-#ifndef HAVE_MSG_NOSIGNAL
-#define MSG_NOSIGNAL 0
-#endif
-
-#ifndef HAVE_MSG_DONTWAIT
-#define MSG_DONTWAIT 0
-#endif
-
-#ifndef HAVE_MSG_MORE
-#define MSG_MORE 0
-#endif
-
-#endif
-])
+LT_PREREQ([2.2])
+LT_INIT()
+LT_LANG([C++])
+LT_LANG([C])
+gl_VISIBILITY
+
+AX_CXX_HEADER_STDCXX_98
+ if test "$ax_cv_cxx_stdcxx_98" = no; then
+ AC_MSG_ERROR([Your system lacks a new enough C++ compiler])
+ fi
+
+m4_include([m4/memcached.m4])
+m4_include([m4/memcached_sasl.m4])
+m4_include([m4/gearmand.m4])
+m4_include([m4/libgearman.m4])
+
+AM_CONDITIONAL(BUILDING_LIBMEMCACHED, true)
+AM_CONDITIONAL(HAVE_LIBMEMCACHED, false)
+AC_DEFINE([HAVE_LIBMEMCACHED], [1], [Enables libmemcached Support])
+
+AM_CONDITIONAL(BUILDING_GEARMAN, false)