summaryrefslogtreecommitdiffstats
path: root/m4/want_ldap.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
commitf7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch)
treea3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /m4/want_ldap.m4
parentInitial commit. (diff)
downloaddovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.tar.xz
dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.zip
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/want_ldap.m4')
-rw-r--r--m4/want_ldap.m458
1 files changed, 58 insertions, 0 deletions
diff --git a/m4/want_ldap.m4 b/m4/want_ldap.m4
new file mode 100644
index 0000000..91d9e0f
--- /dev/null
+++ b/m4/want_ldap.m4
@@ -0,0 +1,58 @@
+AC_DEFUN([DOVECOT_WANT_LDAP], [
+ have_ldap=no
+ if test $want_ldap != no; then
+ AC_CHECK_LIB(ldap, ldap_init, [
+ AC_CHECK_HEADER(ldap.h, [
+ AC_CHECK_LIB(ldap, ldap_initialize, [
+ AC_DEFINE(LDAP_HAVE_INITIALIZE,, [Define if you have ldap_initialize])
+ ])
+ AC_CHECK_LIB(ldap, ldap_start_tls_s, [
+ AC_DEFINE(LDAP_HAVE_START_TLS_S,, [Define if you have ldap_start_tls_s])
+ ])
+ LDAP_LIBS="-lldap"
+ AC_CHECK_LIB(ldap, ber_free, [
+ # do nothing, default is to add -lldap to LIBS
+ :
+ ], [
+ AC_CHECK_LIB(lber, ber_free, [
+ LDAP_LIBS="$LDAP_LIBS -llber"
+ ])
+ ])
+ AC_SUBST(LDAP_LIBS)
+ if test $want_ldap != plugin; then
+ AUTH_LIBS="$AUTH_LIBS $LDAP_LIBS"
+ DICT_LIBS="$DICT_LIBS $LDAP_LIBS"
+ AC_DEFINE(BUILTIN_LDAP,, [LDAP support is built in])
+ fi
+
+ AC_DEFINE(USERDB_LDAP,, [Build with LDAP support])
+ AC_DEFINE(PASSDB_LDAP,, [Build with LDAP support])
+ AC_CHECK_HEADERS(sasl.h sasl/sasl.h)
+ have_ldap=yes
+ ], [
+ if test $want_ldap != auto; then
+ AC_ERROR([Can't build with LDAP support: ldap.h not found])
+ fi
+ ])
+ ], [
+ if test $want_ldap != auto; then
+ AC_ERROR([Can't build with LDAP support: libldap not found])
+ fi
+ ])
+ fi
+
+ if test $have_ldap = no; then
+ not_passdb="$not_passdb ldap"
+ not_userdb="$not_userdb ldap"
+ else
+ userdb="$userdb ldap"
+ passdb="$passdb ldap"
+ if test $want_ldap = plugin; then
+ have_ldap_plugin=yes
+ userdb="$userdb (plugin)"
+ passdb="$passdb (plugin)"
+ fi
+ fi
+ AM_CONDITIONAL(LDAP_PLUGIN, test "$have_ldap_plugin" = "yes")
+ AM_CONDITIONAL(HAVE_LDAP, test "$want_ldap" != "no")
+])