Merge from Trond
[m6w6/libmemcached] / m4 / pandora_have_libmemcached.m4
1 dnl Copyright (C) 2009 Sun Microsystems
2 dnl This file is free software; Sun Microsystems
3 dnl gives unlimited permission to copy and/or distribute it,
4 dnl with or without modifications, as long as this notice is preserved.
5
6 AC_DEFUN([_PANDORA_SEARCH_LIBMEMCACHED],[
7 AC_REQUIRE([AC_LIB_PREFIX])
8
9 dnl --------------------------------------------------------------------
10 dnl Check for libmemcached
11 dnl --------------------------------------------------------------------
12
13 AC_ARG_ENABLE([libmemcached],
14 [AS_HELP_STRING([--disable-libmemcached],
15 [Build with libmemcached support @<:@default=on@:>@])],
16 [ac_enable_libmemcached="$enableval"],
17 [ac_enable_libmemcached="yes"])
18
19 AS_IF([test "x$ac_enable_libmemcached" = "xyes"],[
20 AC_LIB_HAVE_LINKFLAGS(memcached,,[
21 #include <libmemcached/memcached.h>
22 ],[
23 memcached_st memc;
24 memcached_dump_func *df;
25 memcached_lib_version();
26 ])
27 ],[
28 ac_cv_libmemcached="no"
29 ])
30
31 AM_CONDITIONAL(HAVE_LIBMEMCACHED, [test "x${ac_cv_libmemcached}" = "xyes"])
32
33 AS_IF([test "x${ac_cv_libmemcached}" = "xyes"], [ PANDORA_WITH_MEMCACHED ])
34 ])
35
36 AC_DEFUN([PANDORA_HAVE_LIBMEMCACHED],[
37 AC_REQUIRE([_PANDORA_SEARCH_LIBMEMCACHED])
38 ])
39
40 AC_DEFUN([PANDORA_REQUIRE_LIBMEMCACHED],[
41 AC_REQUIRE([PANDORA_HAVE_LIBMEMCACHED])
42 AS_IF([test x$ac_cv_libmemcached = xno],
43 AC_MSG_ERROR([libmemcached is required for ${PACKAGE}]))
44 ])