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
#--------------------------------------------------------------------
8
#--------------------------------------------------------------------
11
AC_DEFUN([_PANDORA_SEARCH_LIBLDAP],[
12
AC_REQUIRE([AC_LIB_PREFIX])
14
AC_LIB_HAVE_LINKFLAGS(ldap,,
17
LDAP *l= ldap_init("localhost", 389);
19
AS_IF([test "x$ac_cv_libldap" = "xno"],
26
AC_LIB_HAVE_LINKFLAGS(ldap,,
27
[#include <ldap/ldap.h>],
29
LDAP *l= ldap_init("localhost", 389);
31
AS_IF([test "x$ac_cv_libldap" = "xyes"], [
32
ac_cv_ldap_location="<ldap/ldap.h>"
35
ac_cv_ldap_location="<ldap.h>"
38
AM_CONDITIONAL(HAVE_LIBLDAP, [test "x${ac_cv_libldap}" = "xyes"])
41
AC_DEFUN([_PANDORA_HAVE_LIBLDAP],[
43
AC_ARG_ENABLE([libldap],
44
[AS_HELP_STRING([--disable-libldap],
45
[Build with libldap support @<:@default=on@:>@])],
46
[ac_enable_libldap="$enableval"],
47
[ac_enable_libldap="yes"])
49
_PANDORA_SEARCH_LIBLDAP
53
AC_DEFUN([PANDORA_HAVE_LIBLDAP],[
54
AC_REQUIRE([_PANDORA_HAVE_LIBLDAP])
57
AC_DEFUN([_PANDORA_REQUIRE_LIBLDAP],[
58
ac_enable_libldap="yes"
59
_PANDORA_SEARCH_LIBLDAP
61
AS_IF([test x$ac_cv_libldap = xno],[
62
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.])
64
AC_DEFINE_UNQUOTED(LDAP_HEADER,[${ac_cv_ldap_location}],
65
[Location of ldap header])
69
AC_DEFUN([PANDORA_REQUIRE_LIBLDAP],[
70
AC_REQUIRE([_PANDORA_REQUIRE_LIBLDAP])