5cfa47ddbfd9553ad50b208d522a1f8228c10159
[m6w6/libmemcached] / m4 / ax_sasl.m4
1 # ===========================================================================
2 # http://www.tangent.org/
3 # ===========================================================================
4 #
5 # SYNOPSIS
6 #
7 # AX_SASL
8 #
9 # DESCRIPTION
10 #
11 # Check for sasl version one or two support.
12 #
13 # LICENSE
14 #
15 # Copyright (c) 2012 Brian Aker <brian@tangent.org>
16 #
17 # Copying and distribution of this file, with or without modification, are
18 # permitted in any medium without royalty provided the copyright notice
19 # and this notice are preserved. This file is offered as-is, without any
20 # warranty.
21
22 #serial 1
23
24 AC_DEFUN([AX_SASL_OPTION],[
25 AC_REQUIRE([AX_SASL_CHECK])
26 AC_ARG_ENABLE([sasl],
27 [AS_HELP_STRING([--disable-sasl], [Build with sasl support @<:@default=on@:>@])],
28 [ac_enable_sasl="$enableval"],
29 [ac_enable_sasl="yes"])
30
31 AS_IF([test "x$ac_enable_sasl" = "xyes"], [
32 ac_enable_sasl="no"
33 ], [
34 ])
35
36 AS_IF([test "x$ac_enable_sasl" = "xyes"], [
37 AC_DEFINE([HAVE_LIBSASL], [ 1 ], [Have libsasl2])
38 ], [
39 AC_DEFINE([HAVE_LIBSASL], [ 0 ], [Have libsasl2])
40 ])
41
42 AM_CONDITIONAL(HAVE_SASL, test "x${ac_enable_sasl}" = "xyes")
43
44 ])
45
46 AC_DEFUN([AX_SASL_CHECK],[
47
48 AX_CHECK_LIBRARY([LIBSASL], [sasl/sasl.h], [sasl2],[
49 LIBSASL_LDFLAGS="-lsasl2"
50 ax_cv_sasl=yes
51 ], [
52 ax_cv_sasl=no
53 ])
54 ])