1 dnl Copyright (C) 2009 Sun Microsystems, Inc.
2 dnl This file is free software; Sun Microsystems, Inc.
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 #--------------------------------------------------------------------
8 #--------------------------------------------------------------------
11 AC_DEFUN([_PANDORA_SEARCH_LIBLDAP],[
12 AC_REQUIRE([AC_LIB_PREFIX])
14 AC_LIB_HAVE_LINKFLAGS(ldap,,
18 ldap_initialize(&ldap, "ldap://localhost/");
20 AS_IF([test "x$ac_cv_libldap" = "xno"],
27 AC_LIB_HAVE_LINKFLAGS(ldap,,
28 [#include <ldap/ldap.h>],
31 ldap_initialize(&ldap, "ldap://localhost/");
33 AS_IF([test "x$ac_cv_libldap" = "xyes"], [
34 ac_cv_ldap_location="<ldap/ldap.h>"
37 ac_cv_ldap_location="<ldap.h>"
40 AM_CONDITIONAL(HAVE_LIBLDAP, [test "x${ac_cv_libldap}" = "xyes"])
43 AC_DEFUN([_PANDORA_HAVE_LIBLDAP],[
45 AC_ARG_ENABLE([libldap],
46 [AS_HELP_STRING([--disable-libldap],
47 [Build with libldap support @<:@default=on@:>@])],
48 [ac_enable_libldap="$enableval"],
49 [ac_enable_libldap="yes"])
51 _PANDORA_SEARCH_LIBLDAP
55 AC_DEFUN([PANDORA_HAVE_LIBLDAP],[
56 AC_REQUIRE([_PANDORA_HAVE_LIBLDAP])
59 AC_DEFUN([_PANDORA_REQUIRE_LIBLDAP],[
60 ac_enable_libldap="yes"
61 _PANDORA_SEARCH_LIBLDAP
63 AS_IF([test x$ac_cv_libldap = xno],[
64 AC_MSG_ERROR([libldap is required for ${PACKAGE}. On Debian this can be found in libldap2-dev. On RedHat this can be found in openldap-devel.])
66 AC_DEFINE_UNQUOTED(LDAP_HEADER,[${ac_cv_ldap_location}],
67 [Location of ldap header])
71 AC_DEFUN([PANDORA_REQUIRE_LIBLDAP],[
72 AC_REQUIRE([_PANDORA_REQUIRE_LIBLDAP])