+AC_MSG_CHECKING([whether to use Mozilla C SDK for LDAP support])
+PGAC_ARG_BOOL(with, mozldap, no,
+ [build with Mozilla LDAP support],
+ [AC_DEFINE([USE_MOZLDAP], 1, [Define to 1 to use the Mozilla LDAP C SDK instead of platform default (OpenLDAP or Microsoft LDAP). (--with-mozldap)])])
+AC_MSG_RESULT([$with_mozldap])
+AC_SUBST(with_mozldap)
+
#
# Bonjour
@@ -1077,7 +1084,7 @@
fi
if test "$with_ldap" = yes ; then
- if test "$PORTNAME" != "win32"; then
+ if test "$PORTNAME" != "win32" || test "$with_mozldap" = "yes"; then
AC_CHECK_HEADERS(ldap.h, [],
[AC_MSG_ERROR([header file <ldap.h> is required for LDAP])])
else
@@ -1086,6 +1093,7 @@
[AC_INCLUDES_DEFAULT
#include <windows.h>
])
+ AC_DEFINE([USE_MICROSOFT_LDAP], 1, [Defined when using Microsof LDAP])
fi
fi
@@ -1498,7 +1506,18 @@
# We can test for libldap_r only after we know PTHREAD_LIBS
if test "$with_ldap" = yes ; then
_LIBS="$LIBS"
- if test "$PORTNAME" != "win32"; then
+ if test "$with_mozldap" = "yes"; then
+ if test "$PORTNAME" != "win32"; then
+ mozlibname=ldap50
+ else
+ mozlibname=nsldap32v50
+ fi
+ AC_CHECK_LIB($mozlibname, ldap_bind, [],
+ [AC_MSG_ERROR([library "$mozlibname" is required for Mozilla LDAP])],