2 dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 dnl Copyright 1998-2022 The OpenLDAP Foundation.
5 dnl All rights reserved.
7 dnl Redistribution and use in source and binary forms, with or without
8 dnl modification, are permitted only as authorized by the OpenLDAP
11 dnl A copy of this license is available in the file LICENSE in the
12 dnl top-level directory of the distribution or, alternatively, at
13 dnl <http://www.OpenLDAP.org/license.html>.
15 dnl ----------------------------------------------------------------
16 dnl Disable config.cache!
17 define([AC_CACHE_LOAD], )dnl
18 define([AC_CACHE_SAVE], )dnl
19 dnl ----------------------------------------------------------------
20 dnl Disable libtool 1.5 support for languages we don't use
21 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
22 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
23 define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])dnl
24 dnl ================================================================
25 dnl Configure.in for OpenLDAP
26 AC_COPYRIGHT([[Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.
27 Restrictions apply, see COPYRIGHT and LICENSE files.]])
29 AC_INIT([OpenLDAP],,[https://bugs.openldap.org],,[https://www.openldap.org])
30 AC_CONFIG_SRCDIR(build/version.sh)dnl
31 dnl ----------------------------------------------------------------
32 dnl OpenLDAP Autoconf Macros
33 builtin(include, build/openldap.m4)dnl
34 dnl ================================================================
36 m4_ifndef([PKG_PREREQ],
37 [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
39 AC_CONFIG_AUX_DIR(build)dnl
40 AC_CONFIG_MACRO_DIRS([build])
42 eval `$ac_aux_dir/version.sh`
43 if test -z "$OL_STRING"; then
44 AC_MSG_ERROR([could not determine version])
47 if test -f "$ac_aux_dir/shtool" && test ! -d $ac_aux_dir/shtool; then
48 ac_cv_shtool="$ac_aux_dir/shtool"
50 AC_MSG_ERROR([no shtool found in $ac_aux_dir])
53 SHTOOL="$ac_cv_shtool"
54 dnl AC_SUBST(SHTOOL)dnl
58 TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
59 TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
63 if test -d $ac_aux_dir/../.git; then
64 OPENLDAP_REPO="(from Git clone) "
65 elif test -d $ac_aux_dir/CVS; then
66 OPENLDAP_REPO="(from CVS checkout) "
69 echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_REPO}..."
71 dnl Determine host platform
72 dnl we try not to use this for much
73 AC_CANONICAL_TARGET([])
75 AC_SUBST(PACKAGE,$OL_PACKAGE)dnl
76 AC_SUBST(VERSION,$OL_VERSION)dnl
77 AC_DEFINE_UNQUOTED(OPENLDAP_PACKAGE,"$PACKAGE",Package)
78 AC_DEFINE_UNQUOTED(OPENLDAP_VERSION,"$VERSION",Version)
80 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION,$OL_API_INC,Version)
81 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_MAJOR,$OL_MAJOR,Major)
82 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_MINOR,$OL_MINOR,Minor)
83 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_PATCH,$OL_PATCH,Patch)
85 OPENLDAP_LIBVERSION=$OL_API_LIB_VERSION
86 AC_SUBST(OPENLDAP_LIBVERSION)dnl
88 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
89 AC_SUBST(OPENLDAP_RELEASE_DATE)dnl
91 AC_PREREQ([2.69])dnl Required Autoconf version
94 /* begin of portable.h.pre */
95 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
97 * Copyright 1998-2022 The OpenLDAP Foundation
98 * All rights reserved.
100 * Redistribution and use in source and binary forms, with or without
101 * modification, are permitted only as authorized by the OpenLDAP
104 * A copy of this license is available in the file LICENSE in the
105 * top-level directory of the distribution or, alternatively, at
106 * <http://www.OpenLDAP.org/license.html>.
109 #ifndef _LDAP_PORTABLE_H
110 #define _LDAP_PORTABLE_H
112 /* define this if needed to get reentrant functions */
120 /* define this if needed to get threadsafe functions */
134 #ifndef _SGI_MP_SOURCE
135 #undef _SGI_MP_SOURCE
138 /* end of portable.h.pre */
141 /* begin of portable.h.post */
143 #define RETSIGTYPE void
146 /* don't suck in all of the win32 api */
147 # define WIN32_LEAN_AND_MEAN 1
150 #ifndef LDAP_NEEDS_PROTOTYPES
151 /* force LDAP_P to always include prototypes */
152 #define LDAP_NEEDS_PROTOTYPES 1
156 #if (LDAP_VENDOR_VERSION == 000000) && !defined(LDAP_DEVEL)
159 #if defined(LDAP_DEVEL) && !defined(LDAP_TEST)
169 /* ASCII/EBCDIC converting replacements for stdio funcs
170 * vsnprintf and snprintf are used too, but they are already
171 * checked by the configure script
173 #define fputs ber_pvt_fputs
174 #define fgets ber_pvt_fgets
175 #define printf ber_pvt_printf
176 #define fprintf ber_pvt_fprintf
177 #define vfprintf ber_pvt_vfprintf
178 #define vsprintf ber_pvt_vsprintf
181 #include "ac/fdset.h"
183 #include "ldap_cdefs.h"
184 #include "ldap_features.h"
186 #include "ac/assert.h"
187 #include "ac/localize.h"
189 #endif /* _LDAP_PORTABLE_H */
190 /* end of portable.h.post */
193 AC_CONFIG_HEADERS([include/portable.h:include/portable.hin])
194 AC_CONFIG_HEADERS([include/ldap_features.h:include/ldap_features.hin])
195 AC_CONFIG_HEADERS([include/lber_types.h:include/lber_types.hin])
197 dnl ================================================================
199 AC_MSG_CHECKING(configure arguments)
200 AC_PREFIX_DEFAULT(/usr/local)
203 AC_SUBST(top_builddir)dnl
205 dnl ----------------------------------------------------------------
207 ldap_subdir="/openldap"
210 [ --with-subdir=DIR change default subdirectory used for installs],
217 ldap_subdir="$withval"
220 ldap_subdir="/$withval"
225 AC_SUBST(ldap_subdir)dnl
227 dnl ----------------------------------------------------------------
228 dnl General "enable" options
229 dnl set default to traditional to enable the original debug style
230 OL_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [enable debugging])], yes, [no yes traditional])dnl
231 OL_ARG_ENABLE(dynamic, [AS_HELP_STRING([--enable-dynamic], [enable linking built binaries with dynamic libs])], auto)dnl
232 OL_ARG_ENABLE(syslog, [AS_HELP_STRING([--enable-syslog], [enable syslog support])], auto)dnl
233 dnl OL_ARG_ENABLE(referrals,[AS_HELP_STRING([--enable-referrals], [enable LDAPv2+ Referrals (experimental)])], no)dnl
234 ol_enable_referrals=${ol_enable_referrals-no}
235 OL_ARG_ENABLE(ipv6, [AS_HELP_STRING([--enable-ipv6], [enable IPv6 support])], auto)dnl
236 OL_ARG_ENABLE(local, [AS_HELP_STRING([--enable-local], [enable AF_LOCAL (AF_UNIX) socket support])], auto)dnl
238 dnl ----------------------------------------------------------------
239 dnl General "with" options
240 OL_ARG_WITH(cyrus_sasl, [AS_HELP_STRING([--with-cyrus-sasl], [with Cyrus SASL support])],
241 auto, [auto yes no] )
242 OL_ARG_WITH(systemd, [AS_HELP_STRING([--with-systemd], [with systemd service notification support])],
243 auto, [auto yes no] )
244 OL_ARG_WITH(fetch, [AS_HELP_STRING([--with-fetch], [with fetch(3) URL support])],
245 auto, [auto yes no] )
247 [AS_HELP_STRING([--with-threads], [with threads library auto|nt|posix|pth|lwp|manual])],
248 auto, [auto nt posix pth lwp yes no manual] )
250 [AS_HELP_STRING([--with-tls], [with TLS/SSL support auto|openssl|gnutls|mbedtls])],
251 auto, [auto openssl gnutls mbedtls yes no] )
252 OL_ARG_WITH(yielding_select,
253 [AS_HELP_STRING([--with-yielding-select], [with implicitly yielding select])],
254 auto, [auto yes no manual] )
256 [AS_HELP_STRING([--with-mp], [with multiple precision statistics auto|longlong|long|bignum|gmp])],
257 auto, [auto longlong long bignum gmp yes no])
259 [AS_HELP_STRING([--with-odbc], [with specific ODBC support iodbc|unixodbc|odbc32|auto])],
260 auto, [auto iodbc unixodbc odbc32] )
262 dnl ----------------------------------------------------------------
264 dnl ----------------------------------------------------------------
266 dnl ----------------------------------------------------------------
268 SlapdOptions="dynacl \
279 AC_ARG_ENABLE(xxslapdoptions,[
280 SLAPD (Standalone LDAP Daemon) Options:])
282 OL_ARG_ENABLE(slapd, [AS_HELP_STRING([--enable-slapd], [enable building slapd])], yes)dnl
283 OL_ARG_ENABLE(dynacl, [AS_HELP_STRING([--enable-dynacl], [enable run-time loadable ACL support (experimental)])], no)dnl
284 OL_ARG_ENABLE(aci, [AS_HELP_STRING([--enable-aci], [enable per-object ACIs (experimental)])], no, [no yes mod])dnl
285 OL_ARG_ENABLE(cleartext, [AS_HELP_STRING([--enable-cleartext], [enable cleartext passwords])], yes)dnl
286 OL_ARG_ENABLE(crypt, [AS_HELP_STRING([--enable-crypt], [enable crypt(3) passwords])], no)dnl
287 OL_ARG_ENABLE(spasswd, [AS_HELP_STRING([--enable-spasswd], [enable (Cyrus) SASL password verification])], no)dnl
288 OL_ARG_ENABLE(modules, [AS_HELP_STRING([--enable-modules], [enable dynamic module support])], no)dnl
289 OL_ARG_ENABLE(rlookups, [AS_HELP_STRING([--enable-rlookups], [enable reverse lookups of client hostnames])], no)dnl
290 OL_ARG_ENABLE(slapi, [AS_HELP_STRING([--enable-slapi], [enable SLAPI support (experimental)])], no)dnl
291 OL_ARG_ENABLE(slp, [AS_HELP_STRING([--enable-slp], [enable SLPv2 support])], no)dnl
292 OL_ARG_ENABLE(wrappers, [AS_HELP_STRING([--enable-wrappers], [enable tcp wrapper support])], no)dnl
294 dnl ----------------------------------------------------------------
295 dnl SLAPD Backend Options
309 AC_ARG_ENABLE(xxslapbackends,[
310 SLAPD Backend Options:])
312 OL_ARG_ENABLE(backends, [AS_HELP_STRING([--enable-backends], [enable all available backends])],
314 OL_ARG_ENABLE(dnssrv, [AS_HELP_STRING([--enable-dnssrv], [enable dnssrv backend])],
315 no, [no yes mod], ol_enable_backends)dnl
316 OL_ARG_ENABLE(ldap, [AS_HELP_STRING([--enable-ldap], [enable ldap backend])],
317 no, [no yes mod], ol_enable_backends)dnl
318 OL_ARG_ENABLE(mdb, [AS_HELP_STRING([--enable-mdb], [enable mdb database backend])],
319 yes, [no yes mod], ol_enable_backends)dnl
320 OL_ARG_ENABLE(meta, [AS_HELP_STRING([--enable-meta], [enable metadirectory backend])],
321 no, [no yes mod], ol_enable_backends)dnl
322 OL_ARG_ENABLE(asyncmeta, [AS_HELP_STRING([--enable-asyncmeta], [enable asynchronous metadirectory backend])],
323 no, [no yes mod], ol_enable_backends)dnl
324 OL_ARG_ENABLE(null, [AS_HELP_STRING([--enable-null], [enable null backend])],
325 no, [no yes mod], ol_enable_backends)dnl
326 OL_ARG_ENABLE(passwd, [AS_HELP_STRING([--enable-passwd], [enable passwd backend])],
327 no, [no yes mod], ol_enable_backends)dnl
328 OL_ARG_ENABLE(perl, [AS_HELP_STRING([--enable-perl], [enable perl backend])],
329 no, [no yes mod], ol_enable_backends)dnl
330 OL_ARG_ENABLE(relay, [AS_HELP_STRING([--enable-relay], [enable relay backend])],
331 yes, [no yes mod], ol_enable_backends)dnl
332 OL_ARG_ENABLE(sock, [AS_HELP_STRING([--enable-sock], [enable sock backend])],
333 no, [no yes mod], ol_enable_backends)dnl
334 OL_ARG_ENABLE(sql, [AS_HELP_STRING([--enable-sql], [enable sql backend])],
335 no, [no yes mod], ol_enable_backends)dnl
336 OL_ARG_ENABLE(wt, [AS_HELP_STRING([--enable-wt], [enable WiredTiger backend])],
337 no, [no yes mod], ol_enable_backends)dnl
339 dnl ----------------------------------------------------------------
340 dnl SLAPD Overlay Options
341 Overlays="accesslog \
368 AC_ARG_ENABLE(xxslapoverlays,[
369 SLAPD Overlay Options:])
371 OL_ARG_ENABLE(overlays, [AS_HELP_STRING([--enable-overlays], [enable all available overlays])],
373 OL_ARG_ENABLE(accesslog, [AS_HELP_STRING([--enable-accesslog], [In-Directory Access Logging overlay])],
374 no, [no yes mod], ol_enable_overlays)
375 OL_ARG_ENABLE(auditlog, [AS_HELP_STRING([--enable-auditlog], [Audit Logging overlay])],
376 no, [no yes mod], ol_enable_overlays)
377 OL_ARG_ENABLE(autoca, [AS_HELP_STRING([--enable-autoca], [Automatic Certificate Authority overlay])],
378 no, [no yes mod], ol_enable_overlays)
379 OL_ARG_ENABLE(collect, [AS_HELP_STRING([--enable-collect], [Collect overlay])],
380 no, [no yes mod], ol_enable_overlays)
381 OL_ARG_ENABLE(constraint, [AS_HELP_STRING([--enable-constraint], [Attribute Constraint overlay])],
382 no, [no yes mod], ol_enable_overlays)
383 OL_ARG_ENABLE(dds, [AS_HELP_STRING([--enable-dds], [Dynamic Directory Services overlay])],
384 no, [no yes mod], ol_enable_overlays)
385 OL_ARG_ENABLE(deref, [AS_HELP_STRING([--enable-deref], [Dereference overlay])],
386 no, [no yes mod], ol_enable_overlays)
387 OL_ARG_ENABLE(dyngroup, [AS_HELP_STRING([--enable-dyngroup], [Dynamic Group overlay])],
388 no, [no yes mod], ol_enable_overlays)
389 OL_ARG_ENABLE(dynlist, [AS_HELP_STRING([--enable-dynlist], [Dynamic List overlay])],
390 no, [no yes mod], ol_enable_overlays)
391 OL_ARG_ENABLE(homedir, [AS_HELP_STRING([--enable-homedir], [Home Directory Management overlay])],
392 no, [no yes mod], ol_enable_overlays)
393 OL_ARG_ENABLE(memberof, [AS_HELP_STRING([--enable-memberof], [Reverse Group Membership overlay])],
394 no, [no yes mod], ol_enable_overlays)
395 OL_ARG_ENABLE(otp, [AS_HELP_STRING([--enable-otp], [OTP 2-factor authentication overlay])],
396 no, [no yes mod], ol_enable_overlays)
397 OL_ARG_ENABLE(ppolicy, [AS_HELP_STRING([--enable-ppolicy], [Password Policy overlay])],
398 no, [no yes mod], ol_enable_overlays)
399 OL_ARG_ENABLE(proxycache, [AS_HELP_STRING([--enable-proxycache], [Proxy Cache overlay])],
400 no, [no yes mod], ol_enable_overlays)
401 OL_ARG_ENABLE(refint, [AS_HELP_STRING([--enable-refint], [Referential Integrity overlay])],
402 no, [no yes mod], ol_enable_overlays)
403 OL_ARG_ENABLE(remoteauth, [AS_HELP_STRING([--enable-remoteauth], [Deferred Authentication overlay])],
404 no, [no yes mod], ol_enable_overlays)
405 OL_ARG_ENABLE(retcode, [AS_HELP_STRING([--enable-retcode], [Return Code testing overlay])],
406 no, [no yes mod], ol_enable_overlays)
407 OL_ARG_ENABLE(rwm, [AS_HELP_STRING([--enable-rwm], [Rewrite/Remap overlay])],
408 no, [no yes mod], ol_enable_overlays)
409 OL_ARG_ENABLE(seqmod, [AS_HELP_STRING([--enable-seqmod], [Sequential Modify overlay])],
410 no, [no yes mod], ol_enable_overlays)
411 OL_ARG_ENABLE(sssvlv, [AS_HELP_STRING([--enable-sssvlv], [ServerSideSort/VLV overlay])],
412 no, [no yes mod], ol_enable_overlays)
413 OL_ARG_ENABLE(syncprov, [AS_HELP_STRING([--enable-syncprov], [Syncrepl Provider overlay])],
414 yes, [no yes mod], ol_enable_overlays)
415 OL_ARG_ENABLE(translucent, [AS_HELP_STRING([--enable-translucent], [Translucent Proxy overlay])],
416 no, [no yes mod], ol_enable_overlays)
417 OL_ARG_ENABLE(unique, [AS_HELP_STRING([--enable-unique], [Attribute Uniqueness overlay])],
418 no, [no yes mod], ol_enable_overlays)
419 OL_ARG_ENABLE(valsort, [AS_HELP_STRING([--enable-valsort], [Value Sorting overlay])],
420 no, [no yes mod], ol_enable_overlays)
422 dnl ----------------------------------------------------------------
423 dnl PASSWORD MODULE OPTIONS
424 AC_ARG_ENABLE(pwmodoptions,[
425 SLAPD Password Module Options:])
426 OL_ARG_ENABLE(argon2, [AS_HELP_STRING([--enable-argon2], [Argon2 password hashing module])],
427 no, [no yes], ol_enable_pwmodules)
429 [AS_HELP_STRING([--with-argon2], [with argon2 support library auto|libsodium|libargon2])],
430 auto, [auto libsodium libargon2 yes no] )
432 dnl ----------------------------------------------------------------
434 AC_ARG_ENABLE(balanceroptions,[
435 LLOADD (Load Balancer Daemon) Options:])
436 OL_ARG_ENABLE(balancer, [AS_HELP_STRING([--enable-balancer], [enable load balancer])],
439 dnl ----------------------------------------------------------------
440 dnl TESTSUITE OPTIONS
441 AC_ARG_ENABLE(testoptions,[
442 Test suite Options:])
443 OL_ARG_ENABLE(harness, [AS_HELP_STRING([--enable-harness], [enable mod_harness])],
446 dnl ----------------------------------------------------------------
447 AC_ARG_ENABLE(xxliboptions,[
448 Library Generation & Linking Options])
451 OL_ARG_ENABLE(versioning, [AS_HELP_STRING([--enable-versioning], [Enable versioned symbols in shared library])],
453 dnl ----------------------------------------------------------------
455 dnl ----------------------------------------------------------------
457 if test $ol_enable_slapd = no ; then
458 dnl SLAPD was specifically disabled
459 dnl Disable all of its options
461 for i in $SlapdOptions; do
462 eval "ol_tmp=\$ol_enable_$i"
463 if test $ol_tmp = yes ; then
464 AC_MSG_WARN([slapd disabled, ignoring --enable-$i argument])
465 eval "ol_enable_$i=no"
469 for i in $Backends $Overlays $Pwmods; do
470 eval "ol_tmp=\$ol_enable_$i"
471 if test $ol_tmp != no ; then
472 AC_MSG_WARN([slapd disabled, ignoring --enable-$i argument])
473 eval "ol_enable_$i=no"
477 if test $ol_enable_balancer = mod ; then
478 AC_MSG_WARN([slapd disabled, ignoring --enable-balancer=mod argument])
479 ol_enable_balancer=no
482 if test $ol_enable_harness != no ; then
483 AC_MSG_WARN([slapd disabled, ignoring --enable-harness=$ol_enable_harness argument])
487 dnl If slapd enabled and loadable module support disabled
488 dnl then require at least one built-in backend
490 if test $ol_enable_modules = no; then
492 for i in backends overlays balancer $Backends $Overlays; do
493 eval "ol_tmp=\$ol_enable_$i"
494 if test -n "$ol_tmp" && test "$ol_tmp" = mod ; then
495 AC_MSG_ERROR([--enable-$i=mod requires --enable-modules])
499 for i in harness $Pwmods; do
500 eval "ol_tmp=\$ol_enable_$i"
501 if test -n "$ol_tmp" && test "$ol_tmp" = yes ; then
502 AC_MSG_ERROR([--enable-$i=yes requires --enable-modules])
507 for i in $Backends; do
508 eval "ol_tmp=\$ol_enable_$i"
509 if test $ol_tmp = yes; then
514 if test $ol_any_backend = no; then
515 AC_MSG_ERROR([slapd requires a backend])
520 if test $ol_enable_aci = yes ; then
521 if test $ol_enable_dynacl = no ; then
522 AC_MSG_ERROR([--enable-aci requires --enable-dynacl])
524 elif test $ol_enable_aci = mod ; then
525 AC_MSG_ERROR([ACI build as dynamic module not supported (yet)])
528 if test $ol_enable_modules = yes ; then
529 if test $ol_enable_dynamic = no ; then
530 AC_MSG_ERROR([--enable-modules requires --enable-dynamic])
532 ol_enable_dynamic=yes
535 if test $ol_enable_balancer != no ; then
536 dnl Load Balancer was specifically enabled
537 if test $ol_with_threads = no ; then
538 AC_MSG_ERROR([Load balancer requires threads])
542 if test $ol_enable_spasswd = yes ; then
543 if test $ol_with_cyrus_sasl = no ; then
544 AC_MSG_ERROR([--enable-spasswd requires --with-cyrus-sasl])
546 ol_with_cyrus_sasl=yes
549 if test $ol_enable_meta/$ol_enable_ldap = yes/no ; then
550 AC_MSG_ERROR([--enable-meta requires --enable-ldap])
553 if test $ol_enable_asyncmeta/$ol_enable_ldap = yes/no ; then
554 AC_MSG_ERROR([--enable-asyncmeta requires --enable-ldap])
559 dnl ----------------------------------------------------------------
626 SLAPD_STATIC_OVERLAYS=
627 SLAPD_DYNAMIC_OVERLAYS=
629 SLAPD_DYNAMIC_PWMODS=
631 SLAPD_MODULES_LDFLAGS=
632 SLAPD_MODULES_CPPFLAGS=
634 SLAPD_STATIC_BACKENDS="back-ldif back-monitor"
635 SLAPD_DYNAMIC_BACKENDS=
657 dnl ================================================================
658 dnl Checks for programs
660 AC_DEFINE(HAVE_MKVERSION, 1, [define this if you have mkversion])
662 dnl ----------------------------------------------------------------
664 dnl Determine which C translator to use
667 dnl AIX Thread requires we use cc_r or xlc_r.
668 dnl But only do this IF AIX and CC is not set
669 dnl and threads are auto|yes|posix.
671 dnl If we find cc_r|xlc_r, force pthreads and assume
672 dnl pthread_create is in $LIBS (ie: don't bring in
673 dnl any additional thread libraries)
674 dnl If we do not find cc_r|xlc_r, disable threads
678 *-*-aix*) dnl all AIX is not a good idea.
679 if test -z "$CC" ; then
680 case "$ol_with_threads" in
681 auto | yes | posix) ol_aix_threads=yes ;;
687 if test $ol_aix_threads = yes ; then
688 if test -z "${CC}" ; then
689 AC_CHECK_PROGS(CC,cc_r xlc_r cc)
691 if test "$CC" = cc ; then
692 dnl no CC! don't allow --with-threads
693 if test $ol_with_threads != auto ; then
694 AC_MSG_ERROR([--with-threads requires cc_r (or other suitable compiler) on AIX])
696 AC_MSG_WARN([disabling threads, no cc_r on AIX])
702 case ${CC} in cc_r | xlc_r)
703 ol_with_threads=posix
704 ol_cv_pthread_create=yes
709 if test -z "${CC}"; then
710 AC_CHECK_PROGS(CC,cc gcc,missing)
712 if test "${CC}" = "missing" ; then
713 AC_MSG_ERROR([Unable to locate cc(1) or suitable replacement. Check PATH or set CC.])
717 if test -z "${AR}"; then
718 AC_CHECK_PROGS(AR,ar gar,missing)
720 if test "${AR}" = "missing" ; then
721 AC_MSG_ERROR([Unable to locate ar(1) or suitable replacement. Check PATH or set AR.])
725 if test -z "${STRIP}"; then
726 AC_CHECK_PROGS(STRIP,strip,missing)
728 if test "${STRIP}" = "missing" ; then
729 AC_MSG_ERROR([Unable to locate strip(1) or suitable replacement. Check PATH or set STRIP.])
735 LT_INIT(dlopen, win32-dll)
737 dnl ----------------------------------------------------------------
740 if test $ol_enable_perl != no ; then
741 AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl)
743 if test "no$PERLBIN" = "no" ; then
744 if test $ol_enable_perl = yes ; then
745 AC_MSG_ERROR([could not locate perl])
749 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
750 PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e 's/ -lc / /' -e 's/ -lc$//'`"
752 if test x"$ol_enable_perl" = "xyes" ; then
753 SLAPD_PERL_LDFLAGS="$PERL_LDFLAGS"
755 MOD_PERL_LDFLAGS="$PERL_LDFLAGS"
757 dnl should check perl version
765 dnl ----------------------------------------------------------------
766 dnl Checks for Windows NT
768 *mingw32* ) ac_cv_mingw32=yes ;;
769 *cygwin* ) ac_cv_cygwin=yes ;;
770 *interix* ) ac_cv_interix=yes ;;
773 AC_CHECK_TOOL(RC, windres, )
775 dnl ----------------------------------------------------------------
776 dnl Checks for file extensions
779 AC_DEFINE_UNQUOTED(EXEEXT, "${EXEEXT}", [defined to be the EXE extension])
781 dnl ----------------------------------------------------------------
782 dnl BeOS requires -lbe -lroot -lnet
783 AC_CHECK_LIB(be, be_app, [LIBS="$LIBS -lbe -lroot -lnet"], :, [-lroot -lnet])
785 dnl ----------------------------------------------------------------
786 dnl OpenLDAP requires STDC features
788 if test "X${ac_cv_prog_cc_stdc}" = "Xno" ; then
789 AC_MSG_ERROR([OpenLDAP requires compiler to support STDC constructs.])
792 dnl ----------------------------------------------------------------
793 dnl Check cc depend flags
795 if test "${ol_cv_mkdep}" = no ; then
796 # this will soon become an error
797 AC_MSG_WARN([do not know how to generate dependencies])
800 dnl ----------------------------------------------------------------
801 dnl Check for AIX security library
802 AC_CHECK_LIB(s, afopen, [
804 AC_DEFINE(HAVE_AIX_SECURITY,1,[define if you have AIX security lib])
807 dnl ----------------------------------------------------------------
808 dnl Check for IBM OS/390
812 AC_DEFINE(BOTH_STRINGS_H,1,[define to use both <string.h> and <strings.h>])
816 dnl ----------------------------------------------------------------
817 dnl Check for module support
819 WITH_MODULES_ENABLED=no
820 if test $ol_enable_modules != no ; then
821 AC_CHECK_HEADERS(ltdl.h)
823 if test $ac_cv_header_ltdl_h = no ; then
824 AC_MSG_ERROR([could not locate libtool ltdl.h])
827 AC_CHECK_LIB(ltdl, lt_dlinit, [
829 AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
832 if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
833 AC_MSG_ERROR([could not locate libtool -lltdl])
836 WITH_MODULES_ENABLED=yes
839 dnl ----------------------------------------------------------------
840 dnl Checks for header files.
843 if test $ol_cv_header_stdc != yes; then
844 AC_MSG_WARN([could not locate Standard C compliant headers])
900 dnl Only check Winsock on MinGW
901 if test "$ac_cv_mingw32" = yes \
902 -o "$ac_cv_interix" = yes \
903 -o "$ol_cv_msvc" = yes
905 AC_CHECK_HEADERS( winsock.h winsock2.h )
908 AC_CHECK_HEADERS( resolv.h, [], [],
909 [$ac_includes_default
910 #include <netinet/in.h>
913 AC_CHECK_HEADERS( netinet/tcp.h, [], [],
914 [$ac_includes_default
915 #include <netinet/in.h>
918 AC_CHECK_HEADERS( sys/ucred.h, [], [],
919 [$ac_includes_default
920 #ifdef HAVE_SYS_PARAM_H
921 #include <sys/param.h>
925 dnl ----------------------------------------------------------------
926 dnl Checks for libraries
928 AC_CHECK_FUNCS( sigaction sigset )
929 AC_CHECK_FUNCS( fmemopen )
931 dnl HP-UX requires -lV3
932 dnl this is not needed on newer versions of HP-UX
933 if test $ac_cv_func_sigaction = no && test $ac_cv_func_sigaction = no ; then
934 AC_CHECK_LIB(V3, sigset)
937 if test $ol_cv_msvc = yes ; then
941 dnl The following is INTENTIONALLY scripted out because shell does not
942 dnl support variable names with the '@' character, which is what
943 dnl autoconf would try to generate if one merely used AC_SEARCH_LIBS
944 if test "$ac_cv_header_winsock_h" = yes; then
945 AC_CACHE_CHECK([for winsock], [ol_cv_winsock],[
947 for curlib in none ws2_32 wsock32; do
948 if test $curlib != none ; then
949 LIBS="$save_LIBS -l$curlib"
951 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>
954 select(0,NULL,NULL,NULL,NULL);
957 ]])],[ol_cv_winsock=$curlib],[ol_cv_winsock=no])
959 test "$ol_cv_winsock" != no && break
964 if test $ol_cv_winsock != no ; then
965 AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
966 ac_cv_func_socket=yes
967 ac_cv_func_select=yes
968 ac_cv_func_closesocket=yes
969 ac_cv_func_gethostname=yes
971 if test $ol_cv_winsock != none -a $ol_cv_winsock != yes ; then
972 LIBS="$LIBS -l$ol_cv_winsock"
975 if test $ol_cv_winsock = ws2_32 -o $ol_cv_winsock = yes ; then
976 AC_DEFINE(HAVE_WINSOCK2, 1, [define if you have winsock2])
982 dnl Likely combinations:
983 dnl -lsocket [ -lnsl_s | -lnsl ]
986 AC_CHECK_FUNC(socket, :, [
987 dnl hopefully we won't include too many libraries
988 AC_CHECK_LIB(socket, main)
989 AC_CHECK_LIB(net, socket)
990 AC_CHECK_LIB(nsl_s, main)
991 AC_CHECK_LIB(nsl, main)
992 AC_CHECK_LIB(inet, socket)
993 AC_CHECK_LIB(gen, main)
997 AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
999 if test "${ac_cv_header_winsock_h}" != yes; then
1000 dnl Select arg types
1001 dnl (if this detection becomes permanent, it and the select() detection
1002 dnl should be done before the yielding select test)
1003 AC_FUNC_SELECT_ARGTYPES
1006 dnl check to see if system call automatically restart
1007 dnl AC_SYS_RESTARTABLE_SYSCALLS
1009 dnl ----------------------------------------------------------------
1010 AC_CHECK_FUNCS( poll )
1011 if test $ac_cv_func_poll = yes; then
1012 AC_CHECK_HEADERS( poll.h sys/poll.h )
1015 dnl ----------------------------------------------------------------
1016 AC_CHECK_HEADERS( sys/epoll.h )
1017 if test "${ac_cv_header_sys_epoll_h}" = yes; then
1018 AC_MSG_CHECKING(for epoll system call)
1019 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
1020 #ifdef HAVE_SYS_POLL_H
1021 #include <sys/epoll.h>
1023 int main(int argc, char **argv)
1025 int epfd = epoll_create(256);
1026 exit (epfd == -1 ? 1 : 0);
1027 }]])],[AC_MSG_RESULT(yes)
1028 AC_DEFINE(HAVE_EPOLL,1, [define if your system supports epoll])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
1031 dnl ----------------------------------------------------------------
1032 AC_CHECK_HEADERS( sys/event.h )
1033 if test "${ac_cv_header_sys_event_h}" = yes; then
1034 AC_MSG_CHECKING(for kqueue system call)
1035 AC_RUN_IFELSE([AC_LANG_SOURCE([[$ac_includes_default
1036 #ifdef HAVE_SYS_EVENT_H
1037 #include <sys/event.h>
1039 #ifdef HAVE_SYS_TIME_H
1040 #include <sys/time.h>
1042 int main(int argc, char **argv)
1044 int kqfd = kqueue();
1045 exit (kqfd == -1 ? 1 : 0);
1046 }]])],[AC_MSG_RESULT(yes)
1047 AC_DEFINE(HAVE_KQUEUE,1, [define if your system supports kqueue])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
1050 dnl ----------------------------------------------------------------
1051 AC_CHECK_HEADERS( sys/devpoll.h )
1052 dnl "/dev/poll" needs <sys/poll.h> as well...
1053 if test "${ac_cv_header_sys_devpoll_h}" = yes \
1054 -a "${ac_cv_header_poll_h}" = yes ; \
1056 AC_MSG_CHECKING(for /dev/poll)
1057 AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv)
1059 int devpollfd = open("/dev/poll", /* O_RDWR */ 2);
1060 exit (devpollfd == -1 ? 1 : 0);
1061 }]])],[AC_MSG_RESULT(yes)
1062 AC_DEFINE(HAVE_DEVPOLL,1, [define if your system supports /dev/poll])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
1065 dnl ----------------------------------------------------------------
1068 dnl ----------------------------------------------------------------
1069 dnl require POSIX regex
1070 AC_CHECK_HEADERS( regex.h, [], [],
1071 [$ac_includes_default
1072 #ifdef HAVE_SYS_TYPES_H
1073 #include <sys/types.h>
1077 if test "$ac_cv_header_regex_h" != yes ; then
1078 AC_MSG_ERROR([POSIX regex.h required.])
1080 AC_SEARCH_LIBS(regfree, [regex gnuregex],
1081 :, AC_MSG_ERROR([POSIX regex required.]))
1084 if test "$ol_cv_c_posix_regex" = no ; then
1085 AC_MSG_ERROR([broken POSIX regex!])
1088 dnl ----------------------------------------------------------------
1092 AC_CHECK_HEADERS(sys/uuid.h)
1093 dnl The HAVE_UUID_TO_STR code path also needs uuid_create
1094 if test $ac_cv_header_sys_uuid_h = yes ; then
1096 AC_SEARCH_LIBS([uuid_to_str], [uuid], [have_uuid=yes], :)
1097 AC_SEARCH_LIBS([uuid_create], [uuid], :, [have_uuid=no])
1100 if test $have_uuid = yes ; then
1101 AC_DEFINE(HAVE_UUID_TO_STR,1,
1102 [define if you have uuid_to_str()])
1104 test "$ac_cv_search_uuid_to_str" = "none required" || \
1105 LUTIL_LIBS="$LUTIL_LIBS $ac_cv_search_uuid_to_str"
1109 dnl Look for uuid_generate
1110 dnl The HAVE_UUID_GENERATE code path also needs uuid_unparse_lower
1111 if test $have_uuid = no ; then
1112 AC_CHECK_HEADERS(uuid/uuid.h)
1113 if test $ac_cv_header_uuid_uuid_h = yes ; then
1115 AC_SEARCH_LIBS([uuid_generate], [uuid], [have_uuid=yes], :)
1116 AC_SEARCH_LIBS([uuid_unparse_lower], [uuid], :, [have_uuid=no])
1119 if test $have_uuid = yes ; then
1120 AC_DEFINE(HAVE_UUID_GENERATE,1,
1121 [define if you have uuid_generate()])
1123 test "$ac_cv_search_uuid_generate" = "none required" || \
1124 LUTIL_LIBS="$LUTIL_LIBS $ac_cv_search_uuid_generate"
1129 dnl For windows, check for the need of RPCRT for UUID function support
1130 if test $have_uuid = no ; then
1131 AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support)
1133 LIBS="$LIBS -lrpcrt4"
1134 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1135 int __stdcall UuidCreate(void *);
1136 int __stdcall UuidToStringA(void *,void **);
1140 ]])],[need_rpcrt=yes],[need_rpcrt=no])
1141 if test $need_rpcrt = yes; then
1142 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
1143 CLIENT_LIBS="$CLIENT_LIBS -lrpcrt4"
1146 AC_MSG_RESULT($need_rpcrt)
1149 dnl ----------------------------------------------------------------
1150 dnl Check for resolver routines
1154 if test "$ol_cv_lib_resolver" != no ; then
1155 AC_DEFINE(HAVE_RES_QUERY,1,
1156 [define if you have res_query()])
1158 if test "$ol_enable_dnssrv" != no ; then
1162 if test "$ol_cv_lib_resolver" != yes ; then
1163 LIBS="$ol_cv_lib_resolver $LIBS"
1167 if test "$ol_enable_dnssrv" = yes || test "$ol_enable_dnssrv" = mod ; then
1168 if test "$ol_link_dnssrv" = no ; then
1169 AC_MSG_ERROR([DNSSRV requires res_query()])
1175 AC_CHECK_FUNCS( hstrerror )
1177 dnl ----------------------------------------------------------------
1178 dnl PF_INET6 support requires getaddrinfo and INET6_ADDRSTRLEN
1179 dnl PF_LOCAL may use getaddrinfo in available
1180 AC_CHECK_FUNCS( getaddrinfo getnameinfo gai_strerror inet_ntop )
1183 if test $ac_cv_func_getaddrinfo = no || test $ac_cv_func_inet_ntop = no ; then
1184 if test $ol_enable_ipv6 = yes ; then
1185 AC_MSG_ERROR([IPv6 support requires getaddrinfo() and inet_ntop()])
1187 elif test $ol_enable_ipv6 != no ; then
1188 AC_CACHE_CHECK([INET6_ADDRSTRLEN],[ol_cv_inet6_addrstrlen],[
1189 AC_EGREP_CPP(__has_inet6_addrstrlen__,[
1190 # include <netinet/in.h>
1191 # ifdef INET6_ADDRSTRLEN
1192 __has_inet6_addrstrlen__;
1194 ], [ol_cv_inet6_addrstrlen=yes], [ol_cv_inet6_addrstrlen=no])])
1197 AC_CACHE_CHECK([struct sockaddr_storage],ol_cv_struct_sockaddr_storage,[
1198 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1199 #include <sys/types.h>
1200 #include <sys/socket.h>
1202 struct sockaddr_storage ss;
1203 ]])],[ol_cv_struct_sockaddr_storage=yes],[ol_cv_struct_sockaddr_storage=no])])
1205 if test $ol_cv_inet6_addrstrlen = yes &&
1206 test $ol_cv_struct_sockaddr_storage = yes ; then
1208 elif test $ol_enable_ipv6 = yes &&
1209 test $ol_cv_inet6_addrstrlen = no ; then
1210 AC_MSG_ERROR([IPv6 support requires INET6_ADDRSTRLEN])
1211 elif test $ol_enable_ipv6 = yes &&
1212 test $ol_cv_struct_sockaddr_storage = no ; then
1213 AC_MSG_ERROR([IPv6 support requires struct sockaddr_storage])
1217 if test $ol_enable_local != no ; then
1218 AC_CHECK_HEADERS( sys/un.h )
1220 if test $ol_enable_local = auto ; then
1221 ol_enable_local=$ac_cv_header_sys_un_h
1222 elif test $ac_cv_header_sys_un_h = no ; then
1223 AC_MSG_ERROR([AF_LOCAL domain support requires sys/un.h])
1227 dnl ----------------------------------------------------------------
1230 if test $ol_with_tls = yes ; then
1235 if test $ol_with_tls = openssl || test $ol_with_tls = auto ; then
1236 AC_CHECK_HEADERS(openssl/ssl.h)
1238 if test $ac_cv_header_openssl_ssl_h = yes ; then
1239 AC_PREPROC_IFELSE([AC_LANG_SOURCE(
1240 [[#include <openssl/opensslv.h>]
1241 [#if OPENSSL_VERSION_NUMBER < 0x1010100fL]
1242 [#error "OpenSSL is too old"]
1244 , [AC_MSG_FAILURE([OpenSSL 1.1.1 or newer required])])
1246 AC_CHECK_LIB(ssl, SSL_CTX_set_ciphersuites,
1247 [have_openssl=yes], [have_openssl=no],
1250 if test $have_openssl = yes ; then
1253 WITH_TLS_TYPE=openssl
1255 AC_DEFINE(HAVE_OPENSSL, 1,
1256 [define if you have OpenSSL])
1258 TLS_LIBS="-lssl -lcrypto"
1263 if test $ol_link_tls = no ; then
1264 if test $ol_with_tls = gnutls || test $ol_with_tls = auto ; then
1265 AC_CHECK_HEADERS(gnutls/gnutls.h)
1267 if test $ac_cv_header_gnutls_gnutls_h = yes ; then
1268 AC_PREPROC_IFELSE([AC_LANG_SOURCE(
1269 [[#include <gnutls/gnutls.h>]
1270 [#if GNUTLS_VERSION_NUMBER < 0x030306]
1271 [#error "GnuTLS is too old"]
1273 , [AC_MSG_FAILURE([GnuTLS 3.3.6 or newer required])])
1275 AC_CHECK_LIB(gnutls, gnutls_init,
1276 [have_gnutls=yes], [have_gnutls=no])
1278 if test $have_gnutls = yes ; then
1281 WITH_TLS_TYPE=gnutls
1285 AC_DEFINE(HAVE_GNUTLS, 1,
1286 [define if you have GNUtls])
1292 if test $ol_link_tls = no ; then
1293 if test $ol_with_tls = mbedtls || test $ol_with_tls = auto ; then
1294 AC_CHECK_HEADERS(mbedtls/ssl.h)
1296 if test $ac_cv_header_mbedtls_ssl_h = yes ; then
1297 AC_PREPROC_IFELSE([AC_LANG_SOURCE(
1298 [[#include <mbedtls/version.h>]
1299 [#if MBEDTLS_VERSION_NUMBER < 0x02120000]
1300 [#error "mbedtls is too old"]
1302 , [AC_MSG_FAILURE([mbedtls 2.18.0 or newer required])])
1304 AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
1305 [have_mbedtls=yes], [have_mbedtls=no], -lmbedx509 -lmbedcrypto)
1307 if test $have_mbedtls = yes ; then
1310 WITH_TLS_TYPE=mbedtls
1312 TLS_LIBS="-lmbedtls -lmbedx509 -lmbedcrypto"
1314 AC_DEFINE(HAVE_MBEDTLS, 1,
1315 [define if you have mbedtls])
1322 if test $ol_link_tls = yes ; then
1323 AC_DEFINE(HAVE_TLS, 1, [define if you have TLS])
1325 elif test $ol_with_tls = auto ; then
1326 AC_MSG_WARN([Could not locate TLS/SSL package])
1327 AC_MSG_WARN([TLS data protection not supported!])
1328 elif test $ol_with_tls != no ; then
1329 AC_MSG_ERROR([Could not locate TLS/SSL package])
1331 AC_MSG_WARN([TLS data protection not supported!])
1335 dnl ----------------------------------------------------------------
1339 case $ol_with_threads in auto | yes | nt)
1343 if test "$ol_cv_nt_threads" = yes ; then
1345 ol_with_threads=found
1346 ol_with_yielding_select=yes
1348 AC_DEFINE(HAVE_NT_SERVICE_MANAGER,1,[if you have NT Service Manager])
1349 AC_DEFINE(HAVE_NT_EVENT_LOG,1,[if you have NT Event Log])
1352 if test $ol_with_threads = nt ; then
1353 AC_MSG_ERROR([could not locate NT Threads])
1358 case $ol_with_threads in auto | yes | posix)
1360 AC_CHECK_HEADERS(pthread.h)
1362 if test $ac_cv_header_pthread_h = yes ; then
1363 OL_POSIX_THREAD_VERSION
1365 if test $ol_cv_pthread_version != 0 ; then
1366 AC_DEFINE_UNQUOTED(HAVE_PTHREADS,$ol_cv_pthread_version,
1367 [define to pthreads API spec revision])
1369 AC_MSG_ERROR([unknown pthread version])
1372 # consider threads found
1373 ol_with_threads=found
1375 OL_HEADER_LINUX_THREADS
1376 OL_HEADER_GNU_PTH_PTHREAD_H
1378 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
1379 AC_CHECK_HEADERS(sched.h)
1382 dnl Now the hard part, how to link?
1384 dnl currently supported checks:
1386 dnl Check for no flags
1387 dnl pthread_create() in $LIBS
1389 dnl Check special pthread (final) flags
1390 dnl [skipped] pthread_create() with -mt (Solaris) [disabled]
1391 dnl pthread_create() with -kthread (FreeBSD)
1392 dnl pthread_create() with -pthread (FreeBSD/Digital Unix)
1393 dnl pthread_create() with -pthreads (?)
1394 dnl pthread_create() with -mthreads (AIX)
1395 dnl pthread_create() with -thread (?)
1397 dnl Check pthread (final) libraries
1398 dnl pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1)
1399 dnl pthread_mutex_lock() in -lpthread -lmach -lexc (OSF/1)
1400 dnl [skipped] pthread_mutex_trylock() in -lpthread -lexc (OSF/1)
1401 dnl pthread_join() -Wl,-woff,85 -lpthread (IRIX)
1402 dnl pthread_create() in -lpthread (many)
1403 dnl pthread_create() in -lc_r (FreeBSD)
1405 dnl Check pthread (draft4) flags (deprecated)
1406 dnl pthread_create() with -threads (OSF/1)
1408 dnl Check pthread (draft4) libraries (deprecated)
1409 dnl pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
1410 dnl pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
1411 dnl pthread_mutex_trylock() in -lpthreads -lexc (OSF/1)
1412 dnl pthread_create() in -lpthreads (many)
1415 dnl pthread_create in $LIBS
1416 AC_CACHE_CHECK([for pthread_create in default libraries],
1417 ol_cv_pthread_create,[
1418 AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
1419 [ol_cv_pthread_create=yes],
1420 [ol_cv_pthread_create=no],
1421 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[OL_PTHREAD_TEST_INCLUDES]], [[OL_PTHREAD_TEST_FUNCTION]])],[ol_cv_pthread_create=yes],[ol_cv_pthread_create=no])])])
1423 if test $ol_cv_pthread_create != no ; then
1424 ol_link_threads=posix
1428 dnl OL_PTHREAD_TRY([-mt], [ol_cv_pthread_mt])
1429 OL_PTHREAD_TRY([-kthread], [ol_cv_pthread_kthread])
1430 OL_PTHREAD_TRY([-pthread], [ol_cv_pthread_pthread])
1431 OL_PTHREAD_TRY([-pthreads], [ol_cv_pthread_pthreads])
1432 OL_PTHREAD_TRY([-mthreads], [ol_cv_pthread_mthreads])
1433 OL_PTHREAD_TRY([-thread], [ol_cv_pthread_thread])
1435 OL_PTHREAD_TRY([-lpthread -lmach -lexc -lc_r],
1436 [ol_cv_pthread_lpthread_lmach_lexc_lc_r])
1437 OL_PTHREAD_TRY([-lpthread -lmach -lexc],
1438 [ol_cv_pthread_lpthread_lmach_lexc])
1439 dnl OL_PTHREAD_TRY([-lpthread -lexc],
1440 dnl [ol_cv_pthread_lpthread_lexc])
1442 OL_PTHREAD_TRY([-lpthread -Wl,-woff,85],
1443 [ol_cv_pthread_lib_lpthread_woff])
1445 OL_PTHREAD_TRY([-lpthread], [ol_cv_pthread_lpthread])
1446 OL_PTHREAD_TRY([-lc_r], [ol_cv_pthread_lc_r])
1448 OL_PTHREAD_TRY([-threads], [ol_cv_pthread_threads])
1450 OL_PTHREAD_TRY([-lpthreads -lmach -lexc -lc_r],
1451 [ol_cv_pthread_lpthreads_lmach_lexc_lc_r])
1452 OL_PTHREAD_TRY([-lpthreads -lmach -lexc],
1453 [ol_cv_pthread_lpthreads_lmach_lexc])
1454 OL_PTHREAD_TRY([-lpthreads -lexc],
1455 [ol_cv_pthread_lpthreads_lexc])
1457 OL_PTHREAD_TRY([-lpthreads],[ol_cv_pthread_lib_lpthreads])
1459 if test $ol_link_threads != no ; then
1460 LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
1463 save_CPPFLAGS="$CPPFLAGS"
1465 LIBS="$LTHREAD_LIBS $LIBS"
1467 dnl All POSIX Thread (final) implementations should have
1468 dnl sched_yield instead of pthread yield.
1469 dnl check for both, and thr_yield for Solaris
1470 AC_CHECK_FUNCS(sched_yield pthread_yield thr_yield)
1472 if test $ac_cv_func_sched_yield = no &&
1473 test $ac_cv_func_pthread_yield = no &&
1474 test $ac_cv_func_thr_yield = no ; then
1475 dnl Digital UNIX has sched_yield() in -lrt
1476 AC_CHECK_LIB(rt, sched_yield,
1477 [LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
1478 AC_DEFINE(HAVE_SCHED_YIELD,1,
1479 [Define if you have the sched_yield function.])
1480 ac_cv_func_sched_yield=yes],
1481 [ac_cv_func_sched_yield=no])
1483 if test $ac_cv_func_sched_yield = no &&
1484 test $ac_cv_func_pthread_yield = no &&
1485 test "$ac_cv_func_thr_yield" = no ; then
1486 AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
1489 dnl Check functions for compatibility
1490 AC_CHECK_FUNCS(pthread_kill)
1492 dnl Check for pthread_rwlock_destroy with <pthread.h>
1493 dnl as pthread_rwlock_t may not be defined.
1494 AC_CACHE_CHECK([for pthread_rwlock_destroy with <pthread.h>],
1495 [ol_cv_func_pthread_rwlock_destroy], [
1497 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1498 #include <pthread.h>
1499 pthread_rwlock_t rwlock;
1500 ]], [[pthread_rwlock_destroy(&rwlock);]])],[ol_cv_func_pthread_rwlock_destroy=yes],[ol_cv_func_pthread_rwlock_destroy=no])
1502 if test $ol_cv_func_pthread_rwlock_destroy = yes ; then
1503 AC_DEFINE(HAVE_PTHREAD_RWLOCK_DESTROY,1,
1504 [define if you have pthread_rwlock_destroy function])
1507 dnl Check for pthread_detach with <pthread.h> inclusion
1508 dnl as it's symbol may have been mangled.
1509 AC_CACHE_CHECK([for pthread_detach with <pthread.h>],
1510 [ol_cv_func_pthread_detach], [
1512 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1513 #include <pthread.h>
1515 ]], [[pthread_detach(thread);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
1518 if test $ol_cv_func_pthread_detach = no ; then
1519 AC_MSG_ERROR([could not locate pthread_detach()])
1522 AC_DEFINE(HAVE_PTHREAD_DETACH,1,
1523 [define if you have pthread_detach function])
1525 dnl Check for setconcurrency functions
1527 pthread_setconcurrency \
1528 pthread_getconcurrency \
1529 thr_setconcurrency \
1530 thr_getconcurrency \
1533 OL_SYS_LINUX_THREADS
1536 if test $ol_cv_linux_threads = error; then
1537 AC_MSG_ERROR([LinuxThreads header/library mismatch]);
1540 AC_CACHE_CHECK([AC_LANG_SOURCE([if pthread_create() works])],
1541 ol_cv_pthread_create_works,[
1542 AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
1543 [ol_cv_pthread_create_works=yes],
1544 [ol_cv_pthread_create_works=no],
1546 ol_cv_pthread_create_works=yes])])
1548 if test $ol_cv_pthread_create_works = no ; then
1549 AC_MSG_ERROR([pthread_create is not usable, check environment settings])
1552 ol_replace_broken_yield=no
1553 dnl case "$target" in
1555 dnl AC_CHECK_FUNCS(nanosleep)
1556 dnl ol_replace_broken_yield=yes
1560 if test $ol_replace_broken_yield = yes ; then
1561 AC_DEFINE([REPLACE_BROKEN_YIELD],1,
1562 [define if sched_yield yields the entire process])
1565 dnl Check if select causes an yield
1566 if test $ol_with_yielding_select = auto ; then
1567 AC_CACHE_CHECK([if select yields when using pthreads],
1568 ol_cv_pthread_select_yields,[
1569 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1570 #define _XOPEN_SOURCE 500 /* For pthread_setconcurrency() on glibc */
1573 #include <sys/types.h>
1574 #include <sys/time.h>
1576 #include <pthread.h>
1578 #define NULL (void*) 0
1581 static int fildes[2];
1584 static void *task(void *p)
1586 static void *task(p)
1599 FD_SET(fildes[0], &rfds);
1601 /* we're not interested in any fds */
1602 i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
1609 exit(0); /* if we exit here, the select blocked the whole process */
1613 int main(int argc, char **argv)
1615 int main(argc, argv)
1622 /* create a pipe to select */
1623 if(pipe(&fildes[0])) {
1628 #ifdef HAVE_PTHREAD_SETCONCURRENCY
1629 (void) pthread_setconcurrency(2);
1631 #ifdef HAVE_THR_SETCONCURRENCY
1632 /* Set Solaris LWP concurrency to 2 */
1633 thr_setconcurrency(2);
1637 #if HAVE_PTHREADS < 6
1638 pthread_create(&t, pthread_attr_default, task, NULL);
1640 pthread_create(&t, NULL, task, NULL);
1643 /* make sure task runs first */
1644 #ifdef HAVE_THR_YIELD
1646 #elif defined( HAVE_SCHED_YIELD )
1648 #elif defined( HAVE_PTHREAD_YIELD )
1653 }]])],[ol_cv_pthread_select_yields=no],[ol_cv_pthread_select_yields=yes],[ol_cv_pthread_select_yields=cross])])
1655 if test $ol_cv_pthread_select_yields = cross ; then
1656 AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual])
1659 if test $ol_cv_pthread_select_yields = yes ; then
1660 ol_with_yielding_select=yes
1665 CPPFLAGS="$save_CPPFLAGS"
1668 AC_MSG_ERROR([could not locate usable POSIX Threads])
1672 if test $ol_with_threads = posix ; then
1673 AC_MSG_ERROR([could not locate POSIX Threads])
1678 case $ol_with_threads in auto | yes | pth)
1680 AC_CHECK_HEADERS(pth.h)
1682 if test $ac_cv_header_pth_h = yes ; then
1683 AC_CHECK_LIB(pth, pth_version, [have_pth=yes], [have_pth=no])
1685 if test $have_pth = yes ; then
1686 AC_DEFINE(HAVE_GNU_PTH,1,[if you have GNU Pth])
1687 LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
1689 ol_with_threads=found
1691 if test $ol_with_yielding_select = auto ; then
1692 ol_with_yielding_select=yes
1699 case $ol_with_threads in auto | yes | lwp)
1701 dnl check for SunOS5 LWP
1702 AC_CHECK_HEADERS(thread.h synch.h)
1703 if test $ac_cv_header_thread_h = yes &&
1704 test $ac_cv_header_synch_h = yes ; then
1705 AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
1707 if test $have_thr = yes ; then
1708 AC_DEFINE(HAVE_THR,1,
1709 [if you have Solaris LWP (thr) package])
1710 LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
1713 if test $ol_with_yielding_select = auto ; then
1714 ol_with_yielding_select=yes
1717 dnl Check for setconcurrency functions
1719 thr_setconcurrency \
1720 thr_getconcurrency \
1727 if test $ol_with_yielding_select = yes ; then
1728 AC_DEFINE(HAVE_YIELDING_SELECT,1,
1729 [define if select implicitly yields])
1732 if test $ol_with_threads = manual ; then
1733 dnl User thinks he can manually configure threads.
1736 AC_MSG_WARN([thread defines and link options must be set manually])
1738 AC_CHECK_HEADERS(pthread.h sched.h)
1739 AC_CHECK_FUNCS(sched_yield pthread_yield)
1740 OL_HEADER_LINUX_THREADS
1742 AC_CHECK_HEADERS(thread.h synch.h)
1745 if test $ol_link_threads != no && test $ol_link_threads != nt ; then
1746 dnl needed to get reentrant/threadsafe versions
1748 AC_DEFINE(REENTRANT,1)
1749 AC_DEFINE(_REENTRANT,1)
1750 AC_DEFINE(THREAD_SAFE,1)
1751 AC_DEFINE(_THREAD_SAFE,1)
1752 AC_DEFINE(THREADSAFE,1)
1753 AC_DEFINE(_THREADSAFE,1)
1754 AC_DEFINE(_SGI_MP_SOURCE,1)
1756 dnl The errno declaration may dependent upon _REENTRANT.
1757 dnl If it does, we must link with thread support.
1758 AC_CACHE_CHECK([for thread specific errno],
1759 [ol_cv_errno_thread_specific], [
1760 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], [[errno = 0;]])],[ol_cv_errno_thread_specific=yes],[ol_cv_errno_thread_specific=no])
1763 dnl The h_errno declaration may dependent upon _REENTRANT.
1764 dnl If it does, we must link with thread support.
1765 AC_CACHE_CHECK([for thread specific h_errno],
1766 [ol_cv_h_errno_thread_specific], [
1767 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[h_errno = 0;]])],[ol_cv_h_errno_thread_specific=yes],[ol_cv_h_errno_thread_specific=no])
1770 if test $ol_cv_errno_thread_specific != yes ||
1771 test $ol_cv_h_errno_thread_specific != yes ; then
1772 LIBS="$LTHREAD_LIBS $LIBS"
1776 dnl When in thread environment, use
1777 dnl #if defined( HAVE_REENTRANT_FUNCTIONS ) || defined( HAVE_FUNC_R )
1785 dnl HAVE_REENTRANT_FUNCTIONS is derived from:
1786 dnl _POSIX_REENTRANT_FUNCTIONS
1787 dnl _POSIX_THREAD_SAFE_FUNCTIONS
1788 dnl _POSIX_THREADSAFE_FUNCTIONS
1790 dnl and is currently defined in <ldap_pvt_thread.h>
1792 dnl libldap/*.c should only include <ldap_pvt_thread.h> iff
1793 dnl LDAP_R_COMPILE is defined. ie:
1794 dnl #ifdef LDAP_R_COMPILE
1795 dnl # include <ldap_pvt_thread.h>
1798 dnl LDAP_R_COMPILE is defined by libldap/ldap-int.h
1799 dnl specifically for compiling the threadsafe version of
1800 dnl the ldap library.
1802 dnl dnl check for reentrant/threadsafe functions
1804 dnl dnl note: these should only be used when linking
1805 dnl dnl with $LTHREAD_LIBS
1807 dnl save_CPPFLAGS="$CPPFLAGS"
1808 dnl save_LIBS="$LIBS"
1809 dnl LIBS="$LTHREAD_LIBS $LIBS"
1810 dnl AC_CHECK_FUNCS( \
1812 dnl gethostbyaddr_r gethostbyname_r \
1813 dnl feof_unlocked unlocked_feof \
1814 dnl putc_unlocked unlocked_putc \
1815 dnl flockfile ftrylockfile \
1817 dnl CPPFLAGS="$save_CPPFLAGS"
1818 dnl LIBS="$save_LIBS"
1821 if test $ol_link_threads = no ; then
1822 if test $ol_enable_slapd != no; then
1823 AC_MSG_ERROR([slapd requires thread support])
1826 if test $ol_with_threads = yes ; then
1827 AC_MSG_ERROR([no suitable thread support])
1830 if test $ol_with_threads = auto ; then
1831 AC_MSG_WARN([no suitable thread support, disabling threads])
1835 AC_DEFINE(NO_THREADS,1,
1836 [define if you have (or want) no threads])
1843 if test $ol_link_threads != no ; then
1844 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE,1,
1845 [define to 1 if library is thread safe])
1847 dnl This could be enabled without threads if all of the
1848 dnl reentrant functions are available. Needs testing.
1849 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_REENTRANT,1,
1850 [define to 1 if library is reentrant])
1853 dnl ----------------------------------------------------------------
1854 dnl Tests for reentrant functions necessary for reentrant build
1857 gmtime_r localtime_r \
1858 gethostbyname_r gethostbyaddr_r \
1861 if test "$ac_cv_func_ctime_r" = no ; then
1862 ol_cv_func_ctime_r_nargs=0
1864 OL_FUNC_CTIME_R_NARGS
1865 dnl OL_FUNC_CTIME_R_TYPE
1868 if test "$ac_cv_func_gethostbyname_r" = yes ; then
1869 OL_FUNC_GETHOSTBYNAME_R_NARGS
1871 ol_cv_func_gethostbyname_r_nargs=0
1874 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
1875 OL_FUNC_GETHOSTBYADDR_R_NARGS
1877 ol_cv_func_gethostbyaddr_r_nargs=0
1880 dnl ----------------------------------------------------------------
1882 if test $ol_enable_dynamic = yes && test $enable_shared = yes ; then
1883 BUILD_LIBS_DYNAMIC=shared
1884 AC_DEFINE(LDAP_LIBS_DYNAMIC, 1, [define if LDAP libs are dynamic])
1887 BUILD_LIBS_DYNAMIC=static
1890 AC_SUBST(LTSTATIC)dnl
1892 dnl ----------------------------------------------------------------
1893 if test $ol_enable_wrappers != no ; then
1894 AC_CHECK_HEADERS(tcpd.h,[
1895 AC_MSG_CHECKING([for TCP wrappers library])
1898 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1900 int allow_severity = 0;
1901 int deny_severity = 0;
1903 struct request_info *req;
1906 ]])],[AC_MSG_RESULT([-lwrap])
1908 LIBS="$save_LIBS"],[
1911 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1913 int allow_severity = 0;
1914 int deny_severity = 0;
1916 struct request_info *req;
1919 ]])],[AC_MSG_RESULT([-lwrap -lnsl])
1921 LIBS="$save_LIBS -lnsl"],[
1924 LIBS=$save_LIBS])])],[have_wrappers=no])
1926 if test $have_wrappers = yes ; then
1927 AC_DEFINE(HAVE_TCPD,1, [define if you have -lwrap])
1929 elif test $ol_enable_wrappers = yes ; then
1930 AC_MSG_ERROR([could not find TCP wrappers, select appropriate options or disable])
1932 AC_MSG_WARN([could not find TCP wrappers, support disabled])
1937 dnl ----------------------------------------------------------------
1938 if test $ol_enable_syslog != no ; then
1939 AC_CHECK_FUNC(openlog)
1940 if test $ac_cv_func_openlog = no && test $ol_enable_syslog = yes; then
1941 AC_MSG_ERROR(could not find syslog, select appropriate options or disable)
1943 ol_enable_syslog=$ac_cv_func_openlog
1946 dnl ----------------------------------------------------------------
1949 if test $ol_enable_sql != no ; then
1950 AC_CHECK_HEADERS(sql.h sqlext.h,[],[
1951 AC_MSG_ERROR([could not locate SQL headers])
1955 LIBS="$LTHREAD_LIBS $LIBS"
1957 if test $ol_with_odbc = auto ; then
1958 ol_with_odbc="iodbc unixodbc odbc32"
1961 for odbc in $ol_with_odbc ; do
1962 if test $ol_link_sql = no ; then
1965 AC_CHECK_LIB(iodbc, SQLDriverConnect, [have_iodbc=yes], [have_iodbc=no])
1966 if test $have_iodbc = yes ; then
1967 ol_link_sql="-liodbc"
1972 AC_CHECK_LIB(odbc, SQLDriverConnect, [have_odbc=yes], [have_odbc=no])
1973 if test $have_odbc = yes ; then
1974 ol_link_sql="-lodbc"
1979 AC_CHECK_LIB(odbc32, SQLDriverConnect, [have_odbc32=yes], [have_odbc32=no])
1981 dnl The windows API uses __stdcall which cannot be detected by AC_CHECK_LIB
1982 if test $have_odbc32 = no ; then
1983 AC_MSG_CHECKING([for SQLDriverConnect in -lodbc32 with windows.h])
1985 LIBS="$LIBS -lodbc32"
1986 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <windows.h>
1989 SQLDriverConnect(NULL,NULL,NULL,0,NULL,0,NULL,0);
1990 ]])],[have_odbc32=yes], [have_odbc32=no])
1992 AC_MSG_RESULT($have_odbc32)
1995 if test $have_odbc32 = yes ; then
1996 ol_link_sql="-lodbc32"
2001 AC_MSG_ERROR([unknown ODBC library])
2009 if test $ol_link_sql != no ; then
2010 SLAPD_SQL_LIBS="$ol_link_sql"
2012 elif test $ol_enable_sql != auto ; then
2013 AC_MSG_ERROR([could not locate suitable ODBC library])
2017 dnl ----------------------------------------------------------------
2020 if test $ol_enable_wt != no ; then
2021 PKG_CHECK_MODULES(WT, wiredtiger)
2022 if test $ol_enable_wt = yes ; then
2023 SLAPD_LIBS="$SLAPD_LIBS \$(WT_LIBS)"
2028 dnl ----------------------------------------------------------------
2030 dnl Check for Cyrus SASL
2035 if test $ol_with_cyrus_sasl != no ; then
2036 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
2038 if test $ac_cv_header_sasl_sasl_h = yes ||
2039 test $ac_cv_header_sasl_h = yes; then
2040 AC_CHECK_LIB(sasl2, sasl_client_init,
2041 [ol_link_sasl="-lsasl2"],
2042 [AC_CHECK_LIB(sasl, sasl_client_init,
2043 [ol_link_sasl="-lsasl"])])
2046 if test $ol_link_sasl = no ; then
2047 if test $ol_with_cyrus_sasl != auto ; then
2048 AC_MSG_ERROR([Could not locate Cyrus SASL])
2050 AC_MSG_WARN([Could not locate Cyrus SASL])
2051 AC_MSG_WARN([SASL authentication not supported!])
2052 if test $ol_link_tls = no ; then
2053 AC_MSG_WARN([Strong authentication not supported!])
2058 if test $ol_cv_sasl_compat = no ; then
2060 AC_MSG_ERROR([Cyrus SASL library located but is incompatible])
2063 AC_DEFINE(HAVE_CYRUS_SASL,1,[define if you have Cyrus SASL])
2064 SASL_LIBS="$ol_link_sasl"
2065 if test $ol_enable_spasswd != no ; then
2069 ac_save_LIBS="$LIBS"
2070 LIBS="$LIBS $ol_link_sasl"
2071 AC_CHECK_FUNC(sasl_version, [AC_DEFINE(HAVE_SASL_VERSION,1,
2072 [define if your SASL library has sasl_version()])])
2073 LIBS="$ac_save_LIBS"
2079 AC_MSG_WARN([SASL authentication not supported!])
2080 if test $ol_link_tls = no ; then
2081 AC_MSG_WARN([Strong authentication not supported!])
2085 dnl ----------------------------------------------------------------
2087 dnl Check for systemd (only if we have a server)
2090 systemdsystemunitdir=
2092 if test $ol_enable_slapd = no && test $ol_enable_balancer != yes ; then
2093 if test $ol_with_systemd != no ; then
2094 AC_MSG_WARN([servers disabled, ignoring --with-systemd=$ol_with_systemd argument])
2098 if test $ol_with_systemd != no ; then
2099 AC_CHECK_HEADERS(systemd/sd-daemon.h)
2101 if test $ac_cv_header_systemd_sd_daemon_h = yes; then
2102 AC_CHECK_LIB(systemd, sd_notify,
2103 [ol_link_systemd="-lsystemd"])
2106 if test $ol_link_systemd = no ; then
2107 if test $ol_with_systemd != auto ; then
2108 AC_MSG_ERROR([Could not locate systemd])
2110 AC_MSG_WARN([Could not locate systemd])
2111 AC_MSG_WARN([systemd service notification not supported!])
2114 AC_DEFINE(HAVE_SYSTEMD,1,[define if you have systemd])
2115 SYSTEMD_LIBS="$ol_link_systemd"
2118 PKG_CHECK_VAR(systemdsystemunitdir, systemd, systemdsystemunitdir)
2119 if test -z "$systemdsystemunitdir"; then
2120 if test -d /usr/lib/systemd/system; then
2121 systemdsystemunitdir=/usr/lib/systemd/system
2123 systemdsystemunitdir=/lib/systemd/system
2128 AC_SUBST(systemdsystemunitdir)
2130 dnl ----------------------------------------------------------------
2131 dnl Check for entropy sources
2132 if test $cross_compiling != yes && test "$ac_cv_mingw32" != yes ; then
2134 if test -r /dev/urandom ; then
2136 elif test -r /idev/urandom ; then
2137 dev="/idev/urandom";
2138 elif test -r /dev/srandom ; then
2140 elif test -r /dev/random ; then
2142 elif test -r /idev/random ; then
2146 if test $dev != no ; then
2147 AC_DEFINE_UNQUOTED(URANDOM_DEVICE,"$dev",[set to urandom device])
2151 dnl ----------------------------------------------------------------
2153 dnl Check for fetch URL support
2154 dnl should be extended to support other fetch URL APIs
2157 if test $ol_with_fetch != no ; then
2160 if test $ol_cv_lib_fetch != no ; then
2161 LIBS="$LIBS $ol_link_fetch"
2162 ol_link_fetch=freebsd
2164 elif test $ol_with_fetch != auto ; then
2165 AC_MSG_ERROR(no suitable API for --with-fetch=$ol_with_fetch)
2169 dnl ----------------------------------------------------------------
2170 dnl FreeBSD (and others) have crypt(3) in -lcrypt
2171 if test $ol_enable_crypt != no ; then
2173 LIBS="$TLS_LIBS $LIBS"
2175 AC_CHECK_FUNC(crypt, [have_crypt=yes], [
2177 AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
2178 have_crypt=yes], [have_crypt=no])])
2180 LIBS="$TLS_LIBS $LIBS"
2181 AC_CHECK_LIB(crypt, crypt_r, [have_crypt_r=yes], [have_crypt_r=no])
2185 if test $have_crypt = yes ; then
2186 AC_DEFINE(HAVE_CRYPT,1, [define if crypt(3) is available])
2187 if test $have_crypt_r = yes ; then
2188 AC_DEFINE(HAVE_CRYPT_R, 1, [define if crypt_r() is also available])
2191 AC_MSG_WARN([could not find crypt])
2192 if test $ol_enable_crypt = yes ; then
2193 AC_MSG_ERROR([could not find crypt, select appropriate options or disable])
2196 AC_MSG_WARN([disabling crypt support])
2201 dnl ----------------------------------------------------------------
2202 if test $ol_enable_slp != no ; then
2203 AC_CHECK_HEADERS( slp.h )
2205 if test $ac_cv_header_slp_h = yes ; then
2206 AC_CHECK_LIB(slp, SLPOpen, [have_slp=yes], [have_slp=no])
2207 if test $have_slp = yes ; then
2208 AC_DEFINE(HAVE_SLP, 1, [define if you have -lslp])
2209 SLAPD_SLP_LIBS=-lslp
2212 elif test $ol_enable_slp = yes ; then
2213 AC_MSG_ERROR([SLP not found])
2217 dnl ----------------------------------------------------------------
2219 if test $ol_enable_balancer != no ; then
2220 AC_MSG_CHECKING(compiler support for atomics)
2221 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
2222 [[__atomic_thread_fence( __ATOMIC_ACQUIRE );]])],
2223 [AC_MSG_RESULT(yes)],
2224 [AC_MSG_ERROR(["Balancer requires support for atomic operations"])])
2226 AC_CHECK_LIB(event_extra, evdns_base_new,
2228 LEVENT_LIBS="$LEVENT_LIBS -levent_core -levent_extra"],
2229 [AC_CHECK_LIB(event, evdns_base_new,
2231 LEVENT_LIBS="$LEVENT_LIBS -levent"],
2232 [have_libevent=no])])
2233 AC_CHECK_LIB(event, libevent_global_shutdown, [], [have_libevent=no])
2235 if test $have_libevent = yes ; then
2236 AC_DEFINE(HAVE_LIBEVENT, 1, [define if you have -levent])
2238 AC_MSG_ERROR([You need libevent 2.1 or later with DNS support to build the load balancer])
2241 AC_CHECK_LIB(m, pow, [BALANCER_LIBS="$BALANCER_LIBS -lm"],
2242 [AC_MSG_ERROR([could not locate pow -lm])])
2245 dnl ----------------------------------------------------------------
2246 dnl Checks for typedefs, structures, and compiler characteristics.
2248 AC_CHECK_TYPE(mode_t, int)
2249 AC_CHECK_TYPE(off_t, long)
2250 AC_CHECK_TYPE(pid_t, int)
2251 AC_CHECK_TYPE(ssize_t, [signed int])
2252 AC_CHECK_TYPE(caddr_t, [char *])
2253 AC_CHECK_TYPE(size_t, unsigned)
2255 AC_CHECK_TYPES([long long])
2256 AC_CHECK_TYPES([ptrdiff_t])
2259 AC_CHECK_TYPE([socklen_t],,, [$ac_includes_default
2260 #ifdef HAVE_SYS_SOCKET_H
2261 #include <sys/socket.h>
2263 #ifdef HAVE_WINSOCK2
2264 #include <ws2tcpip.h>
2267 dnl socklen_t-like type in accept(), default socklen_t or int:
2268 dnl - The OS might define socklen_t without using it. POSIX moved from
2269 dnl int to size_t to socklen_t, hoping to stay at a 32-bit type, and
2270 dnl HP-UX now has selectors for what to use.
2271 dnl - On Solaris 2.8 the prototype has void *len, but the default is OK.
2272 AC_MSG_CHECKING([the type of arg 3 to accept()])
2273 AC_CACHE_VAL(ol_cv_type_ber_socklen_t, [
2274 set socklen_t int unsigned "unsigned long" long size_t
2275 test "$ac_cv_type_socklen_t" = yes || shift
2276 ol_cv_type_ber_socklen_t=$1 guessing="guessing "
2277 for lentype in "$@" ; do for addrtype in "struct sockaddr" void ; do
2278 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_includes_default
2279 #ifdef HAVE_SYS_SOCKET_H
2280 #include <sys/socket.h>
2282 extern int accept(int s, $addrtype *ap, $lentype *lp);
2284 accept(0, (struct sockaddr *) 0, ($lentype *) 0);
2285 ])], [ol_cv_type_ber_socklen_t=$lentype guessing= ; break 2])
2287 AC_MSG_RESULT([$guessing$ol_cv_type_ber_socklen_t *])
2288 AC_DEFINE_UNQUOTED(ber_socklen_t, $ol_cv_type_ber_socklen_t,
2289 [Define to the type of arg 3 for `accept'.])
2291 dnl Modules should use ber_socklen_t, not socklen_t. Define socklen_t
2292 dnl for the time being anyway, for backwards compatibility.
2293 if test "$ac_cv_type_socklen_t" != yes; then
2294 AC_DEFINE_UNQUOTED([socklen_t], [$ol_cv_type_ber_socklen_t],
2295 [Define like ber_socklen_t if <sys/socket.h> does not define.])
2299 AC_CHECK_TYPE([sig_atomic_t],,
2300 [AC_DEFINE_UNQUOTED([sig_atomic_t], [int],
2301 [Define to `int' if <signal.h> does not define.])],
2302 [$ac_includes_default
2308 AC_CHECK_HEADERS_ONCE([sys/time.h])
2310 AC_CHECK_MEMBERS([struct stat.st_blksize])
2311 AC_CHECK_MEMBERS([struct passwd.pw_gecos],,,[$ac_includes_default
2313 AC_CHECK_MEMBERS([struct passwd.pw_passwd],,,[$ac_includes_default
2320 if test $cross_compiling = yes ; then
2321 AC_MSG_WARN([Crossing compiling... all bets are off!])
2322 AC_DEFINE(CROSS_COMPILING, 1, [define if cross compiling])
2327 AC_CHECK_SIZEOF(short)
2328 AC_CHECK_SIZEOF(int)
2329 AC_CHECK_SIZEOF(long)
2330 AC_CHECK_SIZEOF(long long)
2331 AC_CHECK_SIZEOF(wchar_t)
2333 if test "$ac_cv_sizeof_int" -lt 4 ; then
2334 AC_MSG_WARN([OpenLDAP requires 'int' to be 32 bits or greater.])
2336 AC_DEFINE(LBER_INT_T,long,[define to 32-bit or greater integer type])
2338 AC_DEFINE(LBER_INT_T,int,[define to 32-bit or greater integer type])
2341 AC_DEFINE(LBER_LEN_T,long,[define to large integer type])
2342 AC_DEFINE(LBER_SOCKET_T,int,[define to socket descriptor type])
2343 AC_DEFINE(LBER_TAG_T,long,[define to large integer type])
2345 dnl ----------------------------------------------------------------
2346 dnl Check for multiple precision support
2347 if test $ol_with_mp = longlong || test $ol_with_mp = auto ; then
2348 if test $ac_cv_sizeof_long_long -gt 4 ; then
2350 AC_DEFINE(USE_MP_LONG_LONG,1,[define to use 'long long' for MP])
2351 elif test $ol_with_mp = longlong ; then
2352 AC_MSG_ERROR([long long unusable for multiple precision])
2355 if test $ol_with_mp = long || test $ol_with_mp = auto ; then
2356 if test $ac_cv_sizeof_long -gt 4 ; then
2358 AC_DEFINE(USE_MP_LONG,1,[define to use 'long' for MP])
2359 elif test $ol_with_mp = long ; then
2360 AC_MSG_ERROR([long unusable for multiple precision])
2363 if test $ol_with_mp = bignum || test $ol_with_mp = auto ; then
2364 AC_CHECK_HEADERS(openssl/bn.h)
2365 AC_CHECK_HEADERS(openssl/crypto.h)
2366 if test "$ac_cv_header_openssl_bn_h" = "yes" &&
2367 test "$ac_cv_header_openssl_crypto_h" = "yes" &&
2368 test "$ol_with_tls" = "found" ; then
2370 AC_DEFINE(USE_MP_BIGNUM,1,[define to use OpenSSL BIGNUM for MP])
2371 elif test $ol_with_mp = bignum ; then
2372 AC_MSG_ERROR([bignum not available])
2375 if test $ol_with_mp = gmp || test $ol_with_mp = auto ; then
2376 AC_CHECK_HEADERS(gmp.h)
2377 AC_CHECK_LIB(gmp, __gmpz_add_ui)
2378 if test $ac_cv_header_gmp_h = yes && test $ac_cv_lib_gmp___gmpz_add_ui = yes ; then
2379 AC_DEFINE(USE_MP_GMP,1,[define to use GMP for MP])
2381 elif test $ol_with_mp = gmp ; then
2382 AC_MSG_ERROR([gmp not available])
2385 if test $ol_with_mp = auto ; then
2389 dnl ----------------------------------------------------------------
2390 dnl Checks for library functions.
2393 if test $ac_cv_func_memcmp_working = no ; then
2394 AC_DEFINE(NEED_MEMCMP_REPLACEMENT,1,
2395 [define if memcmp is not 8-bit clean or is otherwise broken])
2402 dnl Check for NT specific routines
2403 AC_CHECK_FUNC(_spawnlp, AC_DEFINE(HAVE_SPAWNLP,1,[if you have spawnlp()]))
2405 AC_CHECK_FUNC(_snprintf, [ac_cv_func_snprintf=yes
2406 AC_DEFINE(snprintf, _snprintf, [define to snprintf routine])
2409 AC_CHECK_FUNCS(vsnprintf _vsnprintf)
2411 if test $ac_cv_func_vsnprintf = no -a $ac_cv_func__vsnprintf = yes ; then
2412 ac_cv_func_vsnprintf=yes
2413 AC_DEFINE(vsnprintf, _vsnprintf, [define to vsnprintf routine])
2418 if test $ac_cv_func_vprintf = yes ; then
2419 dnl check for vsnprintf
2420 AC_CHECK_FUNCS(snprintf vsnprintf)
2483 dnl We actually may need to replace more than this.
2484 AC_REPLACE_FUNCS(getopt getpeereid)
2486 if test "$ac_cv_func_getopt" != yes; then
2487 LIBSRCS="$LIBSRCS getopt.c"
2490 if test "$ac_cv_func_getpeereid" != yes; then
2491 AC_CHECK_FUNCS( getpeerucred )
2492 if test "$ac_cv_func_getpeerucred" != yes ; then
2493 AC_CHECK_MEMBERS([struct msghdr.msg_accrightslen],,,
2494 [$ac_includes_default
2495 #ifdef HAVE_SYS_SOCKET_H
2496 #include <sys/socket.h>
2498 if test "$ac_cv_member_struct_msghdr_msg_accrightslen" != yes; then
2499 AC_CHECK_MEMBERS([struct msghdr.msg_control],,,
2500 [$ac_includes_default
2501 #ifdef HAVE_SYS_SOCKET_H
2502 #include <sys/socket.h>
2505 AC_CHECK_MEMBERS([struct stat.st_fstype, struct stat.st_vfstype])
2506 if test "$ac_cv_member_struct_stat_st_fstype" = yes; then
2507 AC_COMPILE_IFELSE([AC_LANG_SOURCE([struct stat st; char *ptr=st.st_fstype;])],
2508 AC_DEFINE([HAVE_STRUCT_STAT_ST_FSTYPE_CHAR],1,[define to 1 if st_fstype is char *]),
2509 AC_DEFINE([HAVE_STRUCT_STAT_ST_FSTYPE_INT],1,[define to 1 if st_fstype is int]))
2512 LIBSRCS="$LIBSRCS getpeereid.c"
2515 if test "$ac_cv_func_snprintf" != yes ||
2516 test "$ac_cv_func_vsnprintf" != yes; then
2517 if test "$ac_cv_func_snprintf" != yes; then
2518 AC_DEFINE(snprintf, ber_pvt_snprintf, [define to snprintf routine])
2520 if test "$ac_cv_func_vsnprintf" != yes; then
2521 AC_DEFINE(vsnprintf, ber_pvt_vsnprintf, [define to snprintf routine])
2525 dnl ----------------------------------------------------------------
2526 dnl Sort out defines
2528 if test "$ol_enable_slapi" != no ; then
2529 dnl This check is done also if --enable-modules is used;
2530 dnl it is duplicated here, 'cause it'd be cached anyway
2531 AC_CHECK_HEADERS(ltdl.h)
2533 if test $ac_cv_header_ltdl_h != yes ; then
2534 AC_MSG_ERROR([could not locate <ltdl.h>])
2536 AC_CHECK_LIB(ltdl, lt_dlinit, [
2538 LIBSLAPI=slapi/libslapi.la
2539 AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
2540 ],[AC_MSG_ERROR([could not locate libtool -lltdl])])
2542 AC_DEFINE(LDAP_SLAPI,1, [define this to add SLAPI code])
2545 if test "$ol_enable_debug" != no ; then
2546 if test "$ol_enable_debug" = traditional; then
2547 AC_DEFINE(OLD_DEBUG,1,
2548 [define to use the original debug style])
2550 AC_DEFINE(LDAP_DEBUG,1,
2551 [define this to add debugging code])
2553 if test "$ol_enable_syslog" != no ; then
2554 AC_DEFINE(LDAP_SYSLOG,1,
2555 [define this to add syslog code])
2557 if test "$ol_enable_referrals" != no ; then
2558 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS,LDAP_VENDOR_VERSION,
2559 [define to LDAP VENDOR VERSION])
2561 if test "$ol_enable_local" != no; then
2562 AC_DEFINE(LDAP_PF_LOCAL,1,[define to support PF_LOCAL])
2564 if test "$ol_link_ipv6" != no; then
2565 AC_DEFINE(LDAP_PF_INET6,1,[define to support PF_INET6])
2567 if test "$ol_enable_cleartext" != no ; then
2568 AC_DEFINE(SLAPD_CLEARTEXT,1,[define to support cleartext passwords])
2570 if test "$ol_enable_crypt" != no ; then
2571 AC_DEFINE(SLAPD_CRYPT,1,[define to support crypt(3) passwords])
2573 if test "$ol_link_spasswd" != no ; then
2574 AC_DEFINE(SLAPD_SPASSWD,1,[define to support SASL passwords])
2576 if test "$ol_enable_rlookups" != no ; then
2577 AC_DEFINE(SLAPD_RLOOKUPS,1,[define to support reverse lookups])
2579 if test "$ol_enable_aci" != no ; then
2580 if test "$ol_enable_aci" = mod ; then
2581 MFLAG=SLAPD_MOD_DYNAMIC
2582 dnl remove this after moving servers/slapd/aci.c in contrib/slapd-modules/acl
2583 AC_MSG_ERROR([ACI build as dynamic module not supported (yet)])
2585 MFLAG=SLAPD_MOD_STATIC
2587 WITH_ACI_ENABLED=$ol_enable_aci
2588 AC_DEFINE_UNQUOTED(SLAPD_ACI_ENABLED,$MFLAG,[define to support per-object ACIs])
2592 if test "$ol_enable_dynacl" != no ; then
2593 AC_DEFINE(SLAP_DYNACL,1,[define to support run-time loadable ACL])
2596 if test "$ol_link_modules" != no ; then
2597 AC_DEFINE(SLAPD_MODULES,1,[define to support modules])
2599 SLAPD_MODULES_LDFLAGS="-dlopen self"
2602 AC_DEFINE(SLAPD_MOD_STATIC,1,[statically linked module])
2603 AC_DEFINE(SLAPD_MOD_DYNAMIC,2,[dynamically linked module])
2605 if test "$ol_enable_dnssrv" != no ; then
2607 BUILD_DNSSRV=$ol_enable_dnssrv
2608 if test "$ol_enable_dnssrv" = mod ; then
2609 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
2610 MFLAG=SLAPD_MOD_DYNAMIC
2612 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
2613 MFLAG=SLAPD_MOD_STATIC
2615 AC_DEFINE_UNQUOTED(SLAPD_DNSSRV,$MFLAG,[define to support DNS SRV backend])
2618 if test "$ol_enable_ldap" != no ; then
2620 BUILD_LDAP=$ol_enable_ldap
2621 if test "$ol_enable_ldap" = mod ; then
2622 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
2623 MFLAG=SLAPD_MOD_DYNAMIC
2625 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
2626 MFLAG=SLAPD_MOD_STATIC
2628 AC_DEFINE_UNQUOTED(SLAPD_LDAP,$MFLAG,[define to support LDAP backend])
2631 if test "$ol_enable_mdb" != no ; then
2633 BUILD_MDB=$ol_enable_mdb
2634 if test "$ol_enable_mdb" = mod ; then
2635 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-mdb"
2636 MFLAG=SLAPD_MOD_DYNAMIC
2638 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-mdb"
2639 MFLAG=SLAPD_MOD_STATIC
2641 AC_DEFINE_UNQUOTED(SLAPD_MDB,$MFLAG,[define to support MDB backend])
2644 if test "$ol_enable_meta" != no ; then
2646 BUILD_META=$ol_enable_meta
2647 if test "$ol_enable_meta" = mod ; then
2648 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
2649 MFLAG=SLAPD_MOD_DYNAMIC
2651 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
2652 MFLAG=SLAPD_MOD_STATIC
2654 AC_DEFINE_UNQUOTED(SLAPD_META,$MFLAG,[define to support LDAP Metadirectory backend])
2657 if test "$ol_enable_asyncmeta" != no ; then
2659 BUILD_ASYNCMETA=$ol_enable_asyncmeta
2660 if test "$ol_enable_asyncmeta" = mod ; then
2661 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-asyncmeta"
2662 MFLAG=SLAPD_MOD_DYNAMIC
2664 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-asyncmeta"
2665 MFLAG=SLAPD_MOD_STATIC
2667 AC_DEFINE_UNQUOTED(SLAPD_ASYNCMETA,$MFLAG,[define to support LDAP Async Metadirectory backend])
2670 if test "$ol_enable_null" != no ; then
2672 BUILD_NULL=$ol_enable_null
2673 if test "$ol_enable_null" = mod ; then
2674 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
2675 MFLAG=SLAPD_MOD_DYNAMIC
2677 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
2678 MFLAG=SLAPD_MOD_STATIC
2680 AC_DEFINE_UNQUOTED(SLAPD_NULL,$MFLAG,[define to support NULL backend])
2683 if test "$ol_enable_passwd" != no ; then
2685 BUILD_PASSWD=$ol_enable_passwd
2686 if test "$ol_enable_passwd" = mod ; then
2687 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
2688 MFLAG=SLAPD_MOD_DYNAMIC
2690 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
2691 MFLAG=SLAPD_MOD_STATIC
2693 AC_DEFINE_UNQUOTED(SLAPD_PASSWD,$MFLAG,[define to support PASSWD backend])
2696 if test "$ol_link_perl" != no ; then
2698 BUILD_PERL=$ol_enable_perl
2699 if test "$ol_enable_perl" = mod ; then
2700 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
2701 MFLAG=SLAPD_MOD_DYNAMIC
2703 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
2704 MFLAG=SLAPD_MOD_STATIC
2706 AC_DEFINE_UNQUOTED(SLAPD_PERL,$MFLAG,[define to support PERL backend])
2709 if test "$ol_enable_relay" != no ; then
2711 BUILD_RELAY=$ol_enable_relay
2712 if test "$ol_enable_relay" = mod ; then
2713 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-relay"
2714 MFLAG=SLAPD_MOD_DYNAMIC
2716 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-relay"
2717 MFLAG=SLAPD_MOD_STATIC
2719 AC_DEFINE_UNQUOTED(SLAPD_RELAY,$MFLAG,[define to support relay backend])
2722 if test "$ol_enable_sock" != no ; then
2724 BUILD_SOCK=$ol_enable_sock
2725 if test "$ol_enable_sock" = mod ; then
2726 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sock"
2727 MFLAG=SLAPD_MOD_DYNAMIC
2729 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sock"
2730 MFLAG=SLAPD_MOD_STATIC
2732 AC_DEFINE_UNQUOTED(SLAPD_SOCK,$MFLAG,[define to support SOCK backend])
2735 if test "$ol_link_sql" != no ; then
2737 BUILD_SQL=$ol_enable_sql
2738 if test "$ol_enable_sql" = mod; then
2739 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
2740 MFLAG=SLAPD_MOD_DYNAMIC
2742 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
2743 MFLAG=SLAPD_MOD_STATIC
2745 AC_DEFINE_UNQUOTED(SLAPD_SQL,$MFLAG,[define to support SQL backend])
2748 if test "$ol_link_wt" != no ; then
2750 BUILD_WT=$ol_enable_wt
2751 if test "$ol_enable_wt" = mod; then
2752 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-wt"
2753 MFLAG=SLAPD_MOD_DYNAMIC
2755 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-wt"
2756 MFLAG=SLAPD_MOD_STATIC
2758 AC_DEFINE_UNQUOTED(SLAPD_WT,$MFLAG,[define to support WiredTiger backend])
2761 if test "$ol_enable_accesslog" != no ; then
2762 BUILD_ACCESSLOG=$ol_enable_accesslog
2763 if test "$ol_enable_accesslog" = mod ; then
2764 MFLAG=SLAPD_MOD_DYNAMIC
2765 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS accesslog.la"
2767 MFLAG=SLAPD_MOD_STATIC
2768 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS accesslog.o"
2770 AC_DEFINE_UNQUOTED(SLAPD_OVER_ACCESSLOG,$MFLAG,[define for In-Directory Access Logging overlay])
2773 if test "$ol_enable_auditlog" != no ; then
2774 BUILD_AUDITLOG=$ol_enable_auditlog
2775 if test "$ol_enable_auditlog" = mod ; then
2776 MFLAG=SLAPD_MOD_DYNAMIC
2777 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS auditlog.la"
2779 MFLAG=SLAPD_MOD_STATIC
2780 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS auditlog.o"
2782 AC_DEFINE_UNQUOTED(SLAPD_OVER_AUDITLOG,$MFLAG,[define for Audit Logging overlay])
2785 if test "$ol_enable_autoca" != no ; then
2786 if test $ol_with_tls != openssl ; then
2787 AC_MSG_ERROR([--enable-autoca=$ol_enable_autoca requires --with-tls=openssl])
2790 BUILD_AUTOCA=$ol_enable_autoca
2791 if test "$ol_enable_autoca" = mod ; then
2792 MFLAG=SLAPD_MOD_DYNAMIC
2793 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS autoca.la"
2795 MFLAG=SLAPD_MOD_STATIC
2796 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS autoca.o"
2798 AC_DEFINE_UNQUOTED(SLAPD_OVER_AUTOCA,$MFLAG,[define for Automatic Certificate Authority overlay])
2801 if test "$ol_enable_collect" != no ; then
2802 BUILD_COLLECT=$ol_enable_collect
2803 if test "$ol_enable_collect" = mod ; then
2804 MFLAG=SLAPD_MOD_DYNAMIC
2805 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS collect.la"
2807 MFLAG=SLAPD_MOD_STATIC
2808 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS collect.o"
2810 AC_DEFINE_UNQUOTED(SLAPD_OVER_COLLECT,$MFLAG,[define for Collect overlay])
2813 if test "$ol_enable_constraint" != no ; then
2814 BUILD_CONSTRAINT=$ol_enable_constraint
2815 if test "$ol_enable_constraint" = mod ; then
2816 MFLAG=SLAPD_MOD_DYNAMIC
2817 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS constraint.la"
2819 MFLAG=SLAPD_MOD_STATIC
2820 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS constraint.o"
2822 AC_DEFINE_UNQUOTED(SLAPD_OVER_CONSTRAINT,$MFLAG,[define for Attribute Constraint overlay])
2825 if test "$ol_enable_dds" != no ; then
2826 BUILD_DDS=$ol_enable_dds
2827 if test "$ol_enable_dds" = mod ; then
2828 MFLAG=SLAPD_MOD_DYNAMIC
2829 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dds.la"
2831 MFLAG=SLAPD_MOD_STATIC
2832 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dds.o"
2834 AC_DEFINE_UNQUOTED(SLAPD_OVER_DDS,$MFLAG,[define for Dynamic Directory Services overlay])
2837 if test "$ol_enable_deref" != no ; then
2838 BUILD_DEREF=$ol_enable_deref
2839 if test "$ol_enable_deref" = mod ; then
2840 MFLAG=SLAPD_MOD_DYNAMIC
2841 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS deref.la"
2843 MFLAG=SLAPD_MOD_STATIC
2844 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS deref.o"
2846 AC_DEFINE_UNQUOTED(SLAPD_OVER_DEREF,$MFLAG,[define for Dynamic Directory Services overlay])
2849 if test "$ol_enable_dyngroup" != no ; then
2850 BUILD_DYNGROUP=$ol_enable_dyngroup
2851 if test "$ol_enable_dyngroup" = mod ; then
2852 MFLAG=SLAPD_MOD_DYNAMIC
2853 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dyngroup.la"
2855 MFLAG=SLAPD_MOD_STATIC
2856 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dyngroup.o"
2858 AC_DEFINE_UNQUOTED(SLAPD_OVER_DYNGROUP,$MFLAG,[define for Dynamic Group overlay])
2861 if test "$ol_enable_dynlist" != no ; then
2862 BUILD_DYNLIST=$ol_enable_dynlist
2863 if test "$ol_enable_dynlist" = mod ; then
2864 MFLAG=SLAPD_MOD_DYNAMIC
2865 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dynlist.la"
2867 MFLAG=SLAPD_MOD_STATIC
2868 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dynlist.o"
2870 AC_DEFINE_UNQUOTED(SLAPD_OVER_DYNLIST,$MFLAG,[define for Dynamic List overlay])
2873 if test "$ol_enable_homedir" != no ; then
2874 BUILD_HOMEDIR=$ol_enable_homedir
2875 if test "$ol_enable_homedir" = mod ; then
2876 MFLAG=SLAPD_MOD_DYNAMIC
2877 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS homedir.la"
2879 MFLAG=SLAPD_MOD_STATIC
2880 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS homedir.o"
2882 AC_DEFINE_UNQUOTED(SLAPD_OVER_HOMEDIR,$MFLAG,[define for Home Directory Management overlay])
2885 if test "$ol_enable_memberof" != no ; then
2886 BUILD_MEMBEROF=$ol_enable_memberof
2887 if test "$ol_enable_memberof" = mod ; then
2888 MFLAG=SLAPD_MOD_DYNAMIC
2889 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS memberof.la"
2891 MFLAG=SLAPD_MOD_STATIC
2892 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS memberof.o"
2894 AC_DEFINE_UNQUOTED(SLAPD_OVER_MEMBEROF,$MFLAG,[define for Reverse Group Membership overlay])
2897 if test "$ol_enable_otp" != no ; then
2898 if test $ol_with_tls = no ; then
2899 AC_MSG_ERROR([--enable-otp=$ol_enable_otp requires --with-tls])
2902 BUILD_OTP=$ol_enable_otp
2903 if test "$ol_enable_otp" = mod ; then
2904 MFLAG=SLAPD_MOD_DYNAMIC
2905 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS otp.la"
2907 MFLAG=SLAPD_MOD_STATIC
2908 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS otp.o"
2910 AC_DEFINE_UNQUOTED(SLAPD_OVER_OTP,$MFLAG,[define for OTP 2-factor Authentication overlay])
2913 if test "$ol_enable_ppolicy" != no ; then
2914 BUILD_PPOLICY=$ol_enable_ppolicy
2915 if test "$ol_enable_ppolicy" = mod ; then
2916 MFLAG=SLAPD_MOD_DYNAMIC
2917 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS ppolicy.la"
2919 MFLAG=SLAPD_MOD_STATIC
2920 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS ppolicy.o"
2922 AC_DEFINE_UNQUOTED(SLAPD_OVER_PPOLICY,$MFLAG,[define for Password Policy overlay])
2925 if test "$ol_enable_proxycache" != no ; then
2926 BUILD_PROXYCACHE=$ol_enable_proxycache
2927 if test "$ol_enable_proxycache" = mod ; then
2928 MFLAG=SLAPD_MOD_DYNAMIC
2929 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS pcache.la"
2931 MFLAG=SLAPD_MOD_STATIC
2932 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS pcache.o"
2934 AC_DEFINE_UNQUOTED(SLAPD_OVER_PROXYCACHE,$MFLAG,[define for Proxy Cache overlay])
2937 if test "$ol_enable_refint" != no ; then
2938 BUILD_REFINT=$ol_enable_refint
2939 if test "$ol_enable_refint" = mod ; then
2940 MFLAG=SLAPD_MOD_DYNAMIC
2941 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS refint.la"
2943 MFLAG=SLAPD_MOD_STATIC
2944 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS refint.o"
2946 AC_DEFINE_UNQUOTED(SLAPD_OVER_REFINT,$MFLAG,[define for Referential Integrity overlay])
2949 if test "$ol_enable_remoteauth" != no ; then
2950 BUILD_REMOTEAUTH=$ol_enable_remoteauth
2951 if test "$ol_enable_remoteauth" = mod ; then
2952 MFLAG=SLAPD_MOD_DYNAMIC
2953 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS remoteauth.la"
2955 MFLAG=SLAPD_MOD_STATIC
2956 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS remoteauth.o"
2958 AC_DEFINE_UNQUOTED(SLAPD_OVER_REMOTEAUTH,$MFLAG,[define for Deferred Authentication overlay])
2961 if test "$ol_enable_retcode" != no ; then
2962 BUILD_RETCODE=$ol_enable_retcode
2963 if test "$ol_enable_retcode" = mod ; then
2964 MFLAG=SLAPD_MOD_DYNAMIC
2965 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS retcode.la"
2967 MFLAG=SLAPD_MOD_STATIC
2968 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS retcode.o"
2970 AC_DEFINE_UNQUOTED(SLAPD_OVER_RETCODE,$MFLAG,[define for Return Code overlay])
2973 if test "$ol_enable_rwm" != no ; then
2974 BUILD_RWM=$ol_enable_rwm
2975 if test "$ol_enable_rwm" = mod ; then
2976 MFLAG=SLAPD_MOD_DYNAMIC
2977 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS rwm.la"
2979 MFLAG=SLAPD_MOD_STATIC
2980 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS rwm_x.o"
2982 AC_DEFINE_UNQUOTED(SLAPD_OVER_RWM,$MFLAG,[define for Rewrite/Remap overlay])
2985 if test "$ol_enable_seqmod" != no ; then
2986 BUILD_SEQMOD=$ol_enable_seqmod
2987 if test "$ol_enable_seqmod" = mod ; then
2988 MFLAG=SLAPD_MOD_DYNAMIC
2989 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS seqmod.la"
2991 MFLAG=SLAPD_MOD_STATIC
2992 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS seqmod.o"
2994 AC_DEFINE_UNQUOTED(SLAPD_OVER_SEQMOD,$MFLAG,[define for Sequential Modify overlay])
2997 if test "$ol_enable_sssvlv" != no ; then
2998 BUILD_SSSVLV=$ol_enable_sssvlv
2999 if test "$ol_enable_sssvlv" = mod ; then
3000 MFLAG=SLAPD_MOD_DYNAMIC
3001 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS sssvlv.la"
3003 MFLAG=SLAPD_MOD_STATIC
3004 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS sssvlv.o"
3006 AC_DEFINE_UNQUOTED(SLAPD_OVER_SSSVLV,$MFLAG,[define for ServerSideSort/VLV overlay])
3009 if test "$ol_enable_syncprov" != no ; then
3010 BUILD_SYNCPROV=$ol_enable_syncprov
3011 if test "$ol_enable_syncprov" = mod ; then
3012 MFLAG=SLAPD_MOD_DYNAMIC
3013 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS syncprov.la"
3015 MFLAG=SLAPD_MOD_STATIC
3016 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS syncprov.o"
3018 AC_DEFINE_UNQUOTED(SLAPD_OVER_SYNCPROV,$MFLAG,[define for Syncrepl Provider overlay])
3021 if test "$ol_enable_translucent" != no ; then
3022 BUILD_TRANSLUCENT=$ol_enable_translucent
3023 if test "$ol_enable_translucent" = mod ; then
3024 MFLAG=SLAPD_MOD_DYNAMIC
3025 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS translucent.la"
3027 MFLAG=SLAPD_MOD_STATIC
3028 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS translucent.o"
3030 AC_DEFINE_UNQUOTED(SLAPD_OVER_TRANSLUCENT,$MFLAG,[define for Translucent Proxy overlay])
3033 if test "$ol_enable_unique" != no ; then
3034 BUILD_UNIQUE=$ol_enable_unique
3035 if test "$ol_enable_unique" = mod ; then
3036 MFLAG=SLAPD_MOD_DYNAMIC
3037 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS unique.la"
3039 MFLAG=SLAPD_MOD_STATIC
3040 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS unique.o"
3042 AC_DEFINE_UNQUOTED(SLAPD_OVER_UNIQUE,$MFLAG,[define for Attribute Uniqueness overlay])
3045 if test "$ol_enable_valsort" != no ; then
3046 BUILD_VALSORT=$ol_enable_valsort
3047 if test "$ol_enable_valsort" = mod ; then
3048 MFLAG=SLAPD_MOD_DYNAMIC
3049 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS valsort.la"
3051 MFLAG=SLAPD_MOD_STATIC
3052 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS valsort.o"
3054 AC_DEFINE_UNQUOTED(SLAPD_OVER_VALSORT,$MFLAG,[define for Value Sorting overlay])
3058 if test "$ol_enable_argon2" = "yes" ; then
3059 if test $ol_with_argon2 = libargon2 || test $ol_with_argon2 = auto; then
3060 AC_CHECK_HEADERS(argon2.h)
3061 if test $ac_cv_header_argon2_h = yes ; then
3062 AC_CHECK_LIB(argon2, argon2i_hash_encoded,
3063 [have_argon2=yes], [have_argon2=no],
3066 if test "$have_argon2" = "yes" ; then
3067 ol_with_argon2=libargon2
3069 AC_DEFINE(HAVE_LIBARGON2, 1,
3070 [define if you have libargon2])
3071 ARGON2_LIBS="-largon2"
3074 if test $ol_with_argon2 = libsodium || test $ol_with_argon2 = auto; then
3075 AC_CHECK_HEADERS(sodium.h)
3076 if test $ac_cv_header_sodium_h = yes ; then
3077 AC_CHECK_LIB(sodium, crypto_pwhash_str_alg,
3078 [have_argon2=yes], [have_argon2=no],
3081 if test "$have_argon2" = "yes" ; then
3082 ol_with_argon2=libsodium
3084 AC_DEFINE(HAVE_LIBSODIUM, 1,
3085 [define if you have libsodium])
3086 ARGON2_LIBS="-lsodium"
3090 if test "$ol_link_argon2" = no ; then
3091 AC_MSG_ERROR([--enable_argon2=$ol_enable_argon2 requires --with-argon2])
3094 BUILD_PW_ARGON2=$ol_enable_argon2
3095 if test "$ol_enable_argon2" = "yes" ; then
3096 SLAPD_DYNAMIC_PWMODS="$SLAPD_DYNAMIC_PWMODS argon2.la"
3098 AC_DEFINE_UNQUOTED(SLAPD_PWMOD_PW_ARGON2,$SLAPD_MOD_DYNAMIC,[define for Argon2 Password hashing module])
3101 if test "$ol_enable_balancer" != no \
3102 -a "$ol_with_threads" != no \
3103 -a "$have_libevent" = yes ; then
3104 if test "$ol_enable_balancer" = mod; then
3106 BALANCER_MAKE="servers/lloadd/Makefile_module.in:build/mod.mk"
3109 BALANCER_MAKE="servers/lloadd/Makefile_server.in:build/srv.mk"
3113 if test "$ol_enable_slapi" != no ; then
3114 AC_DEFINE(ENABLE_SLAPI,1,[define to enable slapi library])
3116 SLAPD_SLAPI_DEPEND=libslapi.a
3119 OL_VERSIONED_SYMBOLS=""
3120 DO_VERSIONED_SYMBOLS="# "
3121 if test $ol_enable_versioning != no; then
3122 LDVS=`$LD --help < /dev/null 2>/dev/null | grep gnu-version-script`
3123 if test -z "$LDVS"; then
3124 LDVS=`$LD --help < /dev/null 2>/dev/null | grep version-script`
3125 if test -z "$LDVS"; then
3126 if test $ol_enable_versioning = "yes" ; then
3127 AC_MSG_ERROR([Library symbol versioning requested but not supported])
3130 OL_VERSIONED_SYMBOLS="-Wl,--version-script="
3133 OL_VERSIONED_SYMBOLS="-z gnu-version-script="
3135 if test -n "$OL_VERSIONED_SYMBOLS"; then
3136 DO_VERSIONED_SYMBOLS=""
3140 dnl ----------------------------------------------------------------
3143 dnl We use 'yes' but mean 'mod' as far as our Makefile infra is concerned
3144 if test $ol_enable_harness != no; then
3148 dnl ----------------------------------------------------------------
3151 dnl For Windows build, we don't want to include -dlopen flags.
3152 dnl They hurt more than they help.
3155 if test "$ac_cv_mingw32" = yes -o $ol_cv_msvc = yes ; then
3157 SLAPD_MODULES_LDFLAGS=
3166 AC_SUBST(WITH_MODULES_ENABLED)
3167 AC_SUBST(WITH_ACI_ENABLED)
3168 AC_SUBST(WITH_SYSTEMD)
3169 AC_SUBST(BUILD_THREAD)
3170 AC_SUBST(BUILD_LIBS_DYNAMIC)
3171 AC_SUBST(OL_VERSIONED_SYMBOLS)
3172 AC_SUBST(DO_VERSIONED_SYMBOLS)
3174 AC_SUBST(BUILD_SLAPD)
3176 AC_SUBST(BUILD_SLAPI)
3177 AC_SUBST(SLAPD_SLAPI_DEPEND)
3179 AC_SUBST(BUILD_DNSSRV)
3180 AC_SUBST(BUILD_LDAP)
3182 AC_SUBST(BUILD_META)
3183 AC_SUBST(BUILD_ASYNCMETA)
3185 AC_SUBST(BUILD_NULL)
3186 AC_SUBST(BUILD_PASSWD)
3187 AC_SUBST(BUILD_RELAY)
3188 AC_SUBST(BUILD_PERL)
3189 AC_SUBST(BUILD_SHELL)
3190 AC_SUBST(BUILD_SOCK)
3194 AC_SUBST(BUILD_ACCESSLOG)
3195 AC_SUBST(BUILD_AUDITLOG)
3196 AC_SUBST(BUILD_AUTOCA)
3197 AC_SUBST(BUILD_COLLECT)
3198 AC_SUBST(BUILD_CONSTRAINT)
3200 AC_SUBST(BUILD_DENYOP)
3201 AC_SUBST(BUILD_DEREF)
3202 AC_SUBST(BUILD_DYNGROUP)
3203 AC_SUBST(BUILD_DYNLIST)
3204 AC_SUBST(BUILD_LASTMOD)
3205 AC_SUBST(BUILD_HOMEDIR)
3206 AC_SUBST(BUILD_MEMBEROF)
3208 AC_SUBST(BUILD_PPOLICY)
3209 AC_SUBST(BUILD_PROXYCACHE)
3210 AC_SUBST(BUILD_REFINT)
3211 AC_SUBST(BUILD_REMOTEAUTH)
3212 AC_SUBST(BUILD_RETCODE)
3214 AC_SUBST(BUILD_SEQMOD)
3215 AC_SUBST(BUILD_SSSVLV)
3216 AC_SUBST(BUILD_SYNCPROV)
3217 AC_SUBST(BUILD_TRANSLUCENT)
3218 AC_SUBST(BUILD_UNIQUE)
3219 AC_SUBST(BUILD_VALSORT)
3220 AC_SUBST(BUILD_BALANCER)
3222 AC_SUBST(BUILD_PW_ARGON2)
3224 AC_SUBST(BUILD_HARNESS)
3227 AC_SUBST(CLIENT_LIBS)
3228 AC_SUBST(SLAPD_LIBS)
3229 AC_SUBST(BALANCER_LIBS)
3230 AC_SUBST(SLAPD_NDB_LIBS)
3231 AC_SUBST(SLAPD_NDB_INCS)
3232 AC_SUBST(LTHREAD_LIBS)
3233 AC_SUBST(LUTIL_LIBS)
3234 AC_SUBST(LEVENT_LIBS)
3237 AC_SUBST(SLAPD_MODULES_CPPFLAGS)
3238 AC_SUBST(SLAPD_MODULES_LDFLAGS)
3240 AC_SUBST(SLAPD_NO_STATIC)
3241 AC_SUBST(SLAPD_STATIC_BACKENDS)
3242 AC_SUBST(SLAPD_DYNAMIC_BACKENDS)
3243 AC_SUBST(SLAPD_STATIC_OVERLAYS)
3244 AC_SUBST(SLAPD_DYNAMIC_OVERLAYS)
3245 AC_SUBST(SLAPD_DYNAMIC_PWMODS)
3247 AC_SUBST(PERL_CPPFLAGS)
3248 AC_SUBST(SLAPD_PERL_LDFLAGS)
3249 AC_SUBST(MOD_PERL_LDFLAGS)
3253 AC_SUBST(WITH_TLS_TYPE)
3254 AC_SUBST(MODULES_LIBS)
3255 AC_SUBST(SLAPI_LIBS)
3258 AC_SUBST(ARGON2_LIBS)
3259 AC_SUBST(SYSTEMD_LIBS)
3261 AC_SUBST(SLAPD_SLP_LIBS)
3262 AC_SUBST(SLAPD_GMP_LIBS)
3264 AC_SUBST(SLAPD_SQL_LDFLAGS)
3265 AC_SUBST(SLAPD_SQL_LIBS)
3266 AC_SUBST(SLAPD_SQL_INCLUDES)
3271 dnl ----------------------------------------------------------------
3272 dnl final help output
3273 AC_ARG_WITH(xxinstall,[
3274 See INSTALL file for further details.])
3276 dnl ----------------------------------------------------------------
3280 AC_CONFIG_FILES([Makefile:build/top.mk:Makefile.in:build/dir.mk]
3281 [doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk]
3282 [doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk]
3283 [doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk]
3284 [doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk]
3285 [doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk]
3286 [doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk]
3287 [clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk]
3288 [clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk]
3289 [include/Makefile:build/top.mk:include/Makefile.in]
3290 [libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk]
3291 [libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk]
3292 [libraries/liblber/lber.pc]
3293 [libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk]
3294 [libraries/libldap/ldap.pc]
3295 [libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk]
3296 [libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk]
3297 [libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk]
3298 [servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk]
3299 [servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk]
3300 [servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk]
3301 [servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk]
3302 [servers/slapd/back-ldif/Makefile:build/top.mk:servers/slapd/back-ldif/Makefile.in:build/mod.mk]
3303 [servers/slapd/back-mdb/Makefile:build/top.mk:servers/slapd/back-mdb/Makefile.in:build/mod.mk]
3304 [servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk]
3305 [servers/slapd/back-asyncmeta/Makefile:build/top.mk:servers/slapd/back-asyncmeta/Makefile.in:build/mod.mk]
3306 [servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk]
3307 [servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk]
3308 [servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk]
3309 [servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk]
3310 [servers/slapd/back-relay/Makefile:build/top.mk:servers/slapd/back-relay/Makefile.in:build/mod.mk]
3311 [servers/slapd/back-sock/Makefile:build/top.mk:servers/slapd/back-sock/Makefile.in:build/mod.mk]
3312 [servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk]
3313 [servers/slapd/back-wt/Makefile:build/top.mk:servers/slapd/back-wt/Makefile.in:build/mod.mk]
3314 [servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk]
3315 [servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.mk]
3316 [servers/slapd/pwmods/Makefile:build/top.mk:servers/slapd/pwmods/Makefile.in:build/lib.mk]
3317 [servers/lloadd/Makefile:build/top.mk:servers/lloadd/Makefile.in:$BALANCER_MAKE]
3318 [tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk]
3320 [tests/modules/Makefile:build/top.mk:tests/modules/Makefile.in:build/dir.mk]
3321 [tests/modules/mod-harness/Makefile:build/top.mk:tests/modules/mod-harness/Makefile.in:build/mod.mk]
3322 [tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk])
3324 AC_CONFIG_COMMANDS([default],[[
3327 BACKENDSC="servers/slapd/backends.c"
3328 echo "Making $BACKENDSC"
3330 cat > $BACKENDSC << ENDX
3331 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3333 * Copyright 1998-2022 The OpenLDAP Foundation.
3334 * All rights reserved.
3336 * Redistribution and use in source and binary forms, with or without
3337 * modification, are permitted only as authorized by the OpenLDAP
3340 * A copy of this license is available in the file LICENSE in the
3341 * top-level directory of the distribution or, alternatively, at
3342 * <http://www.OpenLDAP.org/license.html>.
3344 /* This file is automatically generated by configure; please do not edit. */
3346 #include "portable.h"
3350 if test "${STATIC_BACKENDS}"; then
3351 for b in config ${STATIC_BACKENDS}; do
3352 bb=`echo "${b}" | sed -e 's/back-//'`
3353 cat >> $BACKENDSC << ENDX
3354 extern BI_init ${bb}_back_initialize;
3358 cat >> $BACKENDSC << ENDX
3360 BackendInfo slap_binfo[] = {
3363 for b in config ${STATIC_BACKENDS}; do
3364 bb=`echo "${b}" | sed -e 's/back-//'`
3365 echo " Add ${bb} ..."
3366 cat >> $BACKENDSC << ENDX
3367 { "${bb}", ${bb}_back_initialize },
3371 cat >> $BACKENDSC << ENDX
3375 /* end of generated file */
3378 OVERLAYSC="servers/slapd/overlays/statover.c"
3379 echo "Making $OVERLAYSC"
3381 cat > $OVERLAYSC << ENDX
3382 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3384 * Copyright 1998-2022 The OpenLDAP Foundation.
3385 * All rights reserved.
3387 * Redistribution and use in source and binary forms, with or without
3388 * modification, are permitted only as authorized by the OpenLDAP
3391 * A copy of this license is available in the file LICENSE in the
3392 * top-level directory of the distribution or, alternatively, at
3393 * <http://www.OpenLDAP.org/license.html>.
3395 /* This file is automatically generated by configure; please do not edit. */
3397 #include "portable.h"
3401 if test "${STATIC_OVERLAYS}"; then
3402 for o in ${STATIC_OVERLAYS}; do
3403 oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
3404 cat >> $OVERLAYSC << ENDX
3405 extern OV_init ${oo}_initialize;
3410 cat >> $OVERLAYSC << ENDX
3412 OverlayInit slap_oinfo[] = {
3415 if test "${STATIC_OVERLAYS}"; then
3416 for o in ${STATIC_OVERLAYS}; do
3417 oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
3418 echo " Add ${oo} ..."
3419 cat >> $OVERLAYSC << ENDX
3420 { "${oo}", ${oo}_initialize },
3425 cat >> $OVERLAYSC << ENDX
3429 /* end of generated file */
3432 if test "${ol_cv_mkdep}" = no; then
3433 echo '(Do not "make depend"; we do not know how to build dependencies)'
3435 echo 'Please run "make depend" to build dependencies'
3438 STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"
3439 STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS"