-sinclude(config/pod2man.m4)
-sinclude(config/debug.m4)
-sinclude(config/dtrace.m4)
-sinclude(config/byteorder.m4)
-sinclude(config/64bit.m4)
-sinclude(config/protocol_binary.m4)
+AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+
+
+# libmemcached versioning when linked with GNU ld.
+if test "$lt_cv_prog_gnu_ld" = "yes"
+then
+ LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libmemcached/libmemcached.ver"
+ LD_UTIL_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libmemcachedutil/libmemcachedutil.ver"
+fi
+AC_SUBST(LD_VERSION_SCRIPT)
+AC_SUBST(LD_UTIL_VERSION_SCRIPT)
+
+AC_C_CONST
+AC_HEADER_TIME
+AC_TYPE_SIZE_T
+AC_SEARCH_LIBS(getopt_long, gnugetopt)
+AC_SEARCH_LIBS(socket, socket)
+AC_SEARCH_LIBS(gethostbyname, nsl)
+
+save_LIBS="$LIBS"
+LIBS="$LIBS -lm"
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+ ]],[[
+ float f= floorf((float) 1.0);
+ ]],
+ [LIBM="-lm"],[LIBM=""])])
+
+AC_SUBST(LIBM)
+LIBS="$save_LIBS"
+AC_SEARCH_LIBS(floorf, m)
+
+
+sinclude(m4/pod2man.m4)
+sinclude(m4/debug.m4)
+sinclude(m4/dtrace.m4)
+sinclude(m4/byteorder.m4)
+sinclude(m4/64bit.m4)
+sinclude(m4/protocol_binary.m4)
+sinclude(m4/memcached.m4)
+sinclude(m4/setsockopt.m4)
+sinclude(m4/hsieh.m4)
+sinclude(m4/util.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?
+if test -d ".hg"
+then
+ building_from_hg=yes
+else
+ building_from_hg=no
+fi
+