Merge from trunk.
[m6w6/libmemcached] / m4 / pandora_have_libgearman.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_LIBGEARMAN],[
7 AC_REQUIRE([AC_LIB_PREFIX])
8
9 dnl --------------------------------------------------------------------
10 dnl Check for libgearman
11 dnl --------------------------------------------------------------------
12
13 AC_ARG_ENABLE([libgearman],
14 [AS_HELP_STRING([--disable-libgearman],
15 [Build with libgearman support @<:@default=on@:>@])],
16 [ac_enable_libgearman="$enableval"],
17 [ac_enable_libgearman="yes"])
18
19 AS_IF([test "x$ac_enable_libgearman" = "xyes"],[
20 AC_LIB_HAVE_LINKFLAGS(gearman,,[
21 #include <libgearman/gearman.h>
22 ],[
23 gearman_client_st gearman_client;
24 gearman_version();
25 ])
26 ],[
27 ac_cv_libgearman="no"
28 ])
29
30 AM_CONDITIONAL(HAVE_LIBGEARMAN, [test "x${ac_cv_libgearman}" = "xyes"])
31 ])
32
33 AC_DEFUN([PANDORA_HAVE_LIBGEARMAN],[
34 AC_REQUIRE([_PANDORA_SEARCH_LIBGEARMAN])
35 ])
36
37 AC_DEFUN([PANDORA_REQUIRE_LIBGEARMAN],[
38 AC_REQUIRE([PANDORA_HAVE_LIBGEARMAN])
39 AS_IF([test "x${ac_cv_libgearman}" = "xno"],
40 AC_MSG_ERROR([libgearman is required for ${PACKAGE}]))
41 ])