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.
6 AC_DEFUN([_PANDORA_SEARCH_SASL],[
7 AC_REQUIRE([AC_LIB_PREFIX])
9 dnl --------------------------------------------------------------------
11 dnl --------------------------------------------------------------------
13 [AS_HELP_STRING([--disable-sasl],
14 [Build with sasl support @<:@default=on@:>@])],
15 [ac_enable_sasl="$enableval"],
16 [ac_enable_sasl="yes"])
18 AS_IF([test "x$ac_enable_sasl" = "xyes"],
20 AC_LIB_HAVE_LINKFLAGS(sasl,,[
22 #include <sasl/sasl.h>
24 sasl_server_init(NULL, NULL);
27 AS_IF([test "x${ac_cv_libsasl}" != "xyes" ],
29 AC_LIB_HAVE_LINKFLAGS(sasl2,,[
31 #include <sasl/sasl.h>
33 sasl_server_init(NULL, NULL);
35 HAVE_LIBSASL="$HAVE_LIBSASL2"
37 LIBSASL_PREFIX="$LIBSASL2_PREFIX"
38 LTLIBSASL="$LT_LIBSASL2"
42 AS_IF([test "x${ac_cv_libsasl}" = "xyes" -o "x${ac_cv_libsasl2}" = "xyes"],
46 AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
47 AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
48 AM_CONDITIONAL(HAVE_SASL, [test "x${ac_cv_sasl}" = "xyes"])
51 AC_DEFUN([PANDORA_HAVE_SASL],[
52 AC_REQUIRE([_PANDORA_SEARCH_SASL])
55 AC_DEFUN([PANDORA_REQUIRE_SASL],[
56 AC_REQUIRE([_PANDORA_SEARCH_SASL])
57 AS_IF([test "x${ac_cv_sasl}" = "xno"],
58 AC_MSG_ERROR([SASL (libsasl or libsasl2) is required for ${PACKAGE}]))
61 AC_DEFUN([_PANDORA_SEARCH_LIBSASL],[
62 AC_REQUIRE([AC_LIB_PREFIX])
64 dnl --------------------------------------------------------------------
66 dnl --------------------------------------------------------------------
68 AC_ARG_ENABLE([libsasl],
69 [AS_HELP_STRING([--disable-libsasl],
70 [Build with libsasl support @<:@default=on@:>@])],
71 [ac_enable_libsasl="$enableval"],
72 [ac_enable_libsasl="yes"])
74 AS_IF([test "x$ac_enable_libsasl" = "xyes"],[
75 AC_LIB_HAVE_LINKFLAGS(sasl,,[
77 #include <sasl/sasl.h>
79 sasl_server_init(NULL, NULL);
85 AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
88 AC_DEFUN([PANDORA_HAVE_LIBSASL],[
89 AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
92 AC_DEFUN([PANDORA_REQUIRE_LIBSASL],[
93 AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
94 AS_IF([test "x${ac_cv_libsasl}" = "xno"],
95 AC_MSG_ERROR([libsasl is required for ${PACKAGE}]))
98 AC_DEFUN([_PANDORA_SEARCH_LIBSASL2],[
99 AC_REQUIRE([AC_LIB_PREFIX])
101 dnl --------------------------------------------------------------------
102 dnl Check for libsasl2
103 dnl --------------------------------------------------------------------
105 AC_ARG_ENABLE([libsasl2],
106 [AS_HELP_STRING([--disable-libsasl2],
107 [Build with libsasl2 support @<:@default=on@:>@])],
108 [ac_enable_libsasl2="$enableval"],
109 [ac_enable_libsasl2="yes"])
111 AS_IF([test "x$ac_enable_libsasl2" = "xyes"],[
112 AC_LIB_HAVE_LINKFLAGS(sasl2,,[
114 #include <sasl2/sasl2.h>
116 sasl2_server_init(NULL, NULL);
122 AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
125 AC_DEFUN([PANDORA_HAVE_LIBSASL2],[
126 AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
129 AC_DEFUN([PANDORA_REQUIRE_LIBSASL2],[
130 AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
131 AS_IF([test "x${ac_cv_libsasl2}" = "xno"],
132 AC_MSG_ERROR([libsasl2 is required for ${PACKAGE}]))