Merge lp:~tangent-org/libmemcached/1.0-build/ Build: jenkins-Libmemcached-187
[m6w6/libmemcached] / m4 / ax_sasl.m4
1 # ===========================================================================
2 # http://www.tangent.org/
3 # ===========================================================================
4 #
5 # SYNOPSIS
6 #
7 # AX_SASL
8 # AX_SASL_CHECK
9 #
10 # DESCRIPTION
11 #
12 # Check to see if libsasl is requested and available.
13 #
14 # LICENSE
15 #
16 # Copyright (c) 2012 Brian Aker <brian@tangent.org>
17 #
18 # Copying and distribution of this file, with or without modification, are
19 # permitted in any medium without royalty provided the copyright notice
20 # and this notice are preserved. This file is offered as-is, without any
21 # warranty.
22
23 #serial 2
24
25 AC_DEFUN([AX_SASL_OPTION],
26 [AC_REQUIRE([AX_SASL_CHECK])
27 AC_ARG_ENABLE([sasl],
28 [AS_HELP_STRING([--disable-sasl], [Build with sasl support @<:@default=on@:>@])],
29 [ac_enable_sasl="$enableval"],
30 [ac_enable_sasl=yes])
31
32 AS_IF([test "x${ac_enable_sasl}" = xyes],
33 [AC_MSG_CHECKING([checking to see if enabling sasl])
34 AS_IF([test "x${ax_sasl_check}" = xyes],
35 [ax_sasl_option=yes],
36 [AC_MSG_WARN([request to add sasl support failed, please see config.log])
37 ac_enable_sasl=no
38 ax_sasl_option=no])
39 AC_MSG_RESULT(["$ax_sasl_option"])
40 ])
41 AM_CONDITIONAL([HAVE_SASL],[test "x${ax_sasl_option}" = xyes])
42 ])
43
44 AC_DEFUN([AX_SASL_CHECK],
45 [ax_sasl_check=no
46 AX_CHECK_LIBRARY([LIBSASL],[sasl/sasl.h],[sasl2],
47 [ax_sasl_check=yes
48 AC_SUBST([SASL_LIB],[[-lsasl2]])
49 ])
50 AC_MSG_CHECKING([checking to see if sasl works])
51 AC_MSG_RESULT(["$ax_sasl_check"])
52 ])