2 dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 dnl Copyright 1998-2005 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 ----------------------------------------------------------------
17 dnl Redefine AC_INIT_BINSH to provide RCS IDs and copyright notice
18 dnl at top of generated configure script. Prints simple copyright.
19 define([AC_INIT_BINSH],
22 # from] translit([$OpenLDAP$], $")] [
24 # This work is part of OpenLDAP Software <http://www.openldap.org/>.
26 # Copyright 1998-2005 The OpenLDAP Foundation.
27 # All rights reserved.
29 # Redistribution and use in source and binary forms, with or without
30 # modification, are permitted only as authorized by the OpenLDAP
33 # A copy of this license is available in the file LICENSE in the
34 # top-level directory of the distribution or, alternatively, at
35 # <http://www.OpenLDAP.org/license.html>.
37 echo "Copyright 1998-2005 The OpenLDAP Foundation. All rights reserved."
38 echo " Restrictions apply, see COPYRIGHT and LICENSE files."
40 dnl ----------------------------------------------------------------
41 dnl OpenLDAP Autoconf Macros
42 builtin(include, build/openldap.m4)dnl
43 dnl ----------------------------------------------------------------
44 dnl Disable config.cache!
45 define([AC_CACHE_LOAD], )dnl
46 define([AC_CACHE_SAVE], )dnl
47 dnl ================================================================
48 dnl Configure.in for OpenLDAP
50 AC_CONFIG_SRCDIR(build/version.sh)dnl
52 # set unset (borrowed from autoconf 2.49c)
53 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
59 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
61 AC_CONFIG_AUX_DIR(build)dnl
63 eval `$ac_aux_dir/version.sh`
64 if test -z "$OL_STRING"; then
65 AC_MSG_ERROR([could not determine version])
68 if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
69 ac_cv_shtool="$ac_aux_dir/shtool"
71 AC_MSG_ERROR([no shtool found in $ac_aux_dir])
74 SHTOOL="$ac_cv_shtool"
75 dnl AC_SUBST(SHTOOL)dnl
77 TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
78 TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
81 if test -d $ac_aux_dir/CVS; then
82 OPENLDAP_CVS="(from CVS sources) "
85 echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
87 dnl Determine host platform
88 dnl we try not to use this for much
89 AC_CANONICAL_TARGET([])
91 AM_INIT_AUTOMAKE([$OL_PACKAGE],[$OL_VERSION], [no defines])dnl
94 AC_DEFINE_UNQUOTED(OPENLDAP_PACKAGE,"$PACKAGE",Package)
95 AC_DEFINE_UNQUOTED(OPENLDAP_VERSION,"$VERSION",Version)
97 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION,$OL_API_INC,Version)
98 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_MAJOR,$OL_MAJOR,Major)
99 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_MINOR,$OL_MINOR,Minor)
100 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_PATCH,$OL_PATCH,Patch)
102 OPENLDAP_LIBRELEASE=$OL_API_LIB_RELEASE
103 AC_SUBST(OPENLDAP_LIBRELEASE)dnl
105 OPENLDAP_LIBVERSION=$OL_API_LIB_VERSION
106 AC_SUBST(OPENLDAP_LIBVERSION)dnl
108 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
109 AC_SUBST(OPENLDAP_RELEASE_DATE)dnl
111 dnl We use autoconf features new to 2.59. Later versions like won't work.
112 dnl aclocal.m4 should be built using aclocal from automake 1.5
113 dnl libtool 1.5 should be installed.
114 AC_PREREQ(2.59)dnl Required Autoconf version
117 /* begin of portable.h.pre */
118 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
120 * Copyright 1998-2005 The OpenLDAP Foundation
121 * All rights reserved.
123 * Redistribution and use in source and binary forms, with or without
124 * modification, are permitted only as authorized by the OpenLDAP
127 * A copy of this license is available in the file LICENSE in the
128 * top-level directory of the distribution or, alternatively, at
129 * <http://www.OpenLDAP.org/license.html>.
132 #ifndef _LDAP_PORTABLE_H
133 #define _LDAP_PORTABLE_H
135 /* define this if needed to get reentrant functions */
143 /* define this if needed to get threadsafe functions */
157 #ifndef _SGI_MP_SOURCE
158 #undef _SGI_MP_SOURCE
161 /* These are defined in ldap_features.h */
163 LDAP_API_FEATURE_X_OPENLDAP_REENTRANT
164 LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE
165 LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
166 LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
169 /* These are defined in lber_types.h */
177 /* end of portable.h.pre */
180 /* begin of portable.h.post */
183 /* don't suck in all of the win32 api */
184 # define WIN32_LEAN_AND_MEAN 1
187 #ifndef LDAP_NEEDS_PROTOTYPES
188 /* force LDAP_P to always include prototypes */
189 #define LDAP_NEEDS_PROTOTYPES 1
193 #if (LDAP_VENDOR_VERSION == 000000) && !defined(LDAP_DEVEL)
196 #if defined(LDAP_DEVEL) && !defined(LDAP_TEST)
206 /* ASCII/EBCDIC converting replacements for stdio funcs
207 * vsnprintf and snprintf are used too, but they are already
208 * checked by the configure script
210 #define fputs ber_pvt_fputs
211 #define fgets ber_pvt_fgets
212 #define printf ber_pvt_printf
213 #define fprintf ber_pvt_fprintf
214 #define vfprintf ber_pvt_vfprintf
215 #define vsprintf ber_pvt_vsprintf
218 #include "ac/fdset.h"
220 #include "ldap_cdefs.h"
221 #include "ldap_features.h"
223 #include "ac/assert.h"
224 #include "ac/localize.h"
226 #endif /* _LDAP_PORTABLE_H */
227 /* end of portable.h.post */
230 AC_CONFIG_HEADERS([include/portable.h:include/portable.hin])
231 AC_CONFIG_HEADERS([include/ldap_features.h:include/ldap_features.hin])
232 AC_CONFIG_HEADERS([include/lber_types.h:include/lber_types.hin])
234 dnl ================================================================
236 AC_MSG_CHECKING(configure arguments)
237 AC_PREFIX_DEFAULT(/usr/local)
240 AC_SUBST(top_builddir)dnl
242 dnl ----------------------------------------------------------------
244 ldap_subdir="/openldap"
247 [ --with-subdir=DIR change default subdirectory used for installs],
254 ldap_subdir="$withval"
257 ldap_subdir="/$withval"
262 AC_SUBST(ldap_subdir)dnl
264 dnl ----------------------------------------------------------------
265 dnl General "enable" options
266 OL_ARG_ENABLE(debug,[ --enable-debug enable debugging], yes)dnl
267 OL_ARG_ENABLE(dynamic,[ --enable-dynamic enable linking built binaries with dynamic libs], no)dnl
268 OL_ARG_ENABLE(syslog,[ --enable-syslog enable syslog support], auto)dnl
269 OL_ARG_ENABLE(proctitle,[ --enable-proctitle enable proctitle support], yes)dnl
270 dnl OL_ARG_ENABLE(referrals,[ --enable-referrals enable LDAPv2+ Referrals (experimental)], no)dnl
271 ol_enable_referrals=${ol_enable_referrals-no}
272 dnl OL_ARG_ENABLE(kbind,[ --enable-kbind enable LDAPv2+ Kerberos IV bind (deprecated)], no)dnl
273 ol_enable_kbind=${ol_enable_kbind-no}
274 OL_ARG_ENABLE(ipv6,[ --enable-ipv6 enable IPv6 support], auto)dnl
275 OL_ARG_ENABLE(local,[ --enable-local enable AF_LOCAL (AF_UNIX) socket support], auto)dnl
277 dnl ----------------------------------------------------------------
278 dnl General "with" options
279 dnl OL_ARG_ENABLE(dmalloc,[ --enable-dmalloc enable debug malloc support], no)dnl
281 OL_ARG_WITH(cyrus_sasl,[ --with-cyrus-sasl with Cyrus SASL support],
282 auto, [auto yes no] )
283 OL_ARG_WITH(fetch,[ --with-fetch with fetch(3) URL support],
284 auto, [auto yes no] )
285 dnl OL_ARG_WITH(kerberos,[ --with-kerberos with Kerberos support],
286 dnl auto, [auto k5 k5only k425 kth k4 afs yes no])
287 ol_with_kerberos=${ol_with_kerberos-auto}
288 OL_ARG_WITH(threads,[ --with-threads with threads],
289 auto, [auto nt posix mach pth lwp yes no manual] )
290 OL_ARG_WITH(tls,[ --with-tls with TLS/SSL support],
291 auto, [auto ssleay openssl yes no] )
292 OL_ARG_WITH(yielding_select,[ --with-yielding-select with implicitly yielding select],
293 auto, [auto yes no manual] )
294 OL_ARG_WITH(multiple_precision,[ --with-multiple-precision
295 multiple precision support for statistics
297 auto, [auto bignum gmp yes no] )
299 dnl ----------------------------------------------------------------
301 dnl ----------------------------------------------------------------
303 dnl ----------------------------------------------------------------
305 AC_ARG_WITH(xxslapdoptions,[
306 SLAPD (Standalone LDAP Daemon) Options:])
307 OL_ARG_ENABLE(slapd,[ --enable-slapd enable building slapd], yes)dnl
308 OL_ARG_ENABLE(aci,[ --enable-aci enable per-object ACIs (experimental)], no)dnl
309 OL_ARG_ENABLE(cleartext,[ --enable-cleartext enable cleartext passwords], yes)dnl
310 OL_ARG_ENABLE(crypt,[ --enable-crypt enable crypt(3) passwords], no)dnl
311 OL_ARG_ENABLE(lmpasswd,[ --enable-lmpasswd enable LAN Manager passwords], no)dnl
312 OL_ARG_ENABLE(spasswd,[ --enable-spasswd enable (Cyrus) SASL password verification], no)dnl
313 OL_ARG_ENABLE(modules,[ --enable-modules enable dynamic module support], no)dnl
314 dnl OL_ARG_ENABLE(multimaster,[ --enable-multimaster enable multimaster replication], no)dnl
315 ol_enable_multimaster=${ol_enable_multimaster-no}
316 OL_ARG_ENABLE(rewrite,[ --enable-rewrite enable DN rewriting in back-ldap and rwm overlay], auto)dnl
317 OL_ARG_ENABLE(rlookups,[ --enable-rlookups enable reverse lookups of client hostnames], no)dnl
318 OL_ARG_ENABLE(slapi,[ --enable-slapi enable SLAPI support (experimental)], no)dnl
319 OL_ARG_ENABLE(slp,[ --enable-slp enable SLPv2 support], no)dnl
320 OL_ARG_ENABLE(wrappers,[ --enable-wrappers enable tcp wrapper support], no)dnl
322 dnl ----------------------------------------------------------------
323 dnl SLAPD Backend Options
324 Backends="bdb dnssrv hdb ldap ldbm meta monitor null \
325 passwd perl relay shell sql"
327 AC_ARG_WITH(xxslapbackends,[
328 SLAPD Backend Options:])
330 OL_ARG_ENABLE(backends,[ --enable-backends enable all available backends no|yes|mod],
332 test -n "$ol_enable_backends" && ol_dflt_backends="$ol_enable_backends"
333 OL_ARG_ENABLE(bdb,[ --enable-bdb enable Berkeley DB backend no|yes|mod],
334 ${ol_dflt_backends-yes}, [no yes mod])dnl
335 OL_ARG_ENABLE(dnssrv,[ --enable-dnssrv enable dnssrv backend no|yes|mod],
336 ${ol_dflt_backends-no}, [no yes mod])dnl
337 OL_ARG_ENABLE(hdb,[ --enable-hdb enable Hierarchical DB backend no|yes|mod],
338 ${ol_dflt_backends-yes}, [no yes mod])dnl
339 OL_ARG_ENABLE(ldap,[ --enable-ldap enable ldap backend no|yes|mod],
340 ${ol_dflt_backends-no}, [no yes mod])dnl
341 OL_ARG_ENABLE(ldbm,[ --enable-ldbm enable ldbm backend no|yes|mod],
342 ${ol_dflt_backends-no}, [no yes mod])dnl
343 OL_ARG_WITH(ldbm_api,[ --with-ldbm-api with LDBM API auto|berkeley|bcompat|mdbm|gdbm],
344 auto, [auto berkeley bcompat mdbm gdbm])
345 OL_ARG_WITH(ldbm_type,[ --with-ldbm-type use LDBM type auto|btree|hash],
346 auto, [auto btree hash])
347 OL_ARG_ENABLE(meta,[ --enable-meta enable metadirectory backend no|yes|mod],
348 ${ol_dflt_backends-no}, [no yes mod])dnl
349 OL_ARG_ENABLE(monitor,[ --enable-monitor enable monitor backend no|yes|mod],
350 ${ol_dflt_backends-yes}, [no yes mod])dnl
351 OL_ARG_ENABLE(null,[ --enable-null enable null backend no|yes|mod],
352 ${ol_dflt_backends-no}, [no yes mod])dnl
353 OL_ARG_ENABLE(passwd,[ --enable-passwd enable passwd backend no|yes|mod],
354 ${ol_dflt_backends-no}, [no yes mod])dnl
355 OL_ARG_ENABLE(perl,[ --enable-perl enable perl backend no|yes|mod],
356 ${ol_dflt_backends-no}, [no yes mod])dnl
357 OL_ARG_ENABLE(relay,[ --enable-relay enable relay backend no|yes|mod],
358 ${ol_dflt_backends-yes}, [no yes mod])dnl
359 OL_ARG_ENABLE(shell,[ --enable-shell enable shell backend no|yes|mod],
360 ${ol_dflt_backends-no}, [no yes mod])dnl
361 OL_ARG_ENABLE(sql,[ --enable-sql enable sql backend no|yes|mod],
362 ${ol_dflt_backends-no}, [no yes mod])dnl
364 dnl ----------------------------------------------------------------
365 dnl SLAPD Overlay Options
366 Overlays="accesslog denyop dyngroup dynlist glue lastmod ppolicy proxycache \
367 refint retcode rwm syncprov translucent unique"
369 AC_ARG_WITH(xxslapoverlays,[
370 SLAPD Overlay Options:])
372 OL_ARG_ENABLE(overlays,[ --enable-overlays enable all available overlays no|yes|mod],
374 test -n "$ol_enable_overlays" && ol_dflt_overlays="$ol_enable_overlays"
375 OL_ARG_ENABLE(accesslog,[ --enable-accesslog In-Directory Access Logging overlay no|yes|mod],
376 ${ol_dflt_overlays-no}, [no yes mod])
377 OL_ARG_ENABLE(denyop,[ --enable-denyop Deny Operation overlay no|yes|mod],
378 ${ol_dflt_overlays-no}, [no yes mod])
379 OL_ARG_ENABLE(dyngroup,[ --enable-dyngroup Dynamic Group overlay no|yes|mod],
380 ${ol_dflt_overlays-no}, [no yes mod])
381 OL_ARG_ENABLE(dynlist,[ --enable-dynlist Dynamic List overlay no|yes|mod],
382 ${ol_dflt_overlays-no}, [no yes mod])
383 OL_ARG_ENABLE(glue,[ --enable-glue Backend Glue overlay no|yes|mod],
384 ${ol_dflt_overlays-yes}, [no yes mod])
385 OL_ARG_ENABLE(lastmod,[ --enable-lastmod Last Modification overlay no|yes|mod],
386 ${ol_dflt_overlays-no}, [no yes mod])
387 OL_ARG_ENABLE(ppolicy,[ --enable-ppolicy Password Policy overlay no|yes|mod],
388 ${ol_dflt_overlays-no}, [no yes mod])
389 OL_ARG_ENABLE(proxycache,[ --enable-proxycache Proxy Cache overlay no|yes|mod],
390 ${ol_dflt_overlays-no}, [no yes mod])
391 OL_ARG_ENABLE(refint,[ --enable-refint Referential Integrity overlay no|yes|mod],
392 ${ol_dflt_overlays-no}, [no yes mod])
393 OL_ARG_ENABLE(retcode,[ --enable-retcode Return Code testing overlay no|yes|mod],
394 ${ol_dflt_overlays-no}, [no yes mod])
395 OL_ARG_ENABLE(rwm,[ --enable-rwm Rewrite/Remap overlay no|yes|mod],
396 ${ol_dflt_overlays-no}, [no yes mod])
397 OL_ARG_ENABLE(syncprov,[ --enable-syncprov Syncrepl Provider overlay no|yes|mod],
398 ${ol_dflt_overlays-yes}, [no yes mod])
399 OL_ARG_ENABLE(translucent,[ --enable-translucent Translucent Proxy overlay no|yes|mod],
400 ${ol_dflt_overlays-no}, [no yes mod])
401 OL_ARG_ENABLE(unique,[ --enable-unique Attribute Uniqueness overlay no|yes|mod],
402 ${ol_dflt_overlays-no}, [no yes mod])
405 dnl ----------------------------------------------------------------
407 AC_ARG_WITH(xxslurpdoptions,[
408 SLURPD (Replication Daemon) Options:])
409 OL_ARG_ENABLE(slurpd,[ --enable-slurpd enable building slurpd], auto)dnl
411 dnl ----------------------------------------------------------------
412 AC_ARG_WITH(xxliboptions,[
413 Library Generation & Linking Options])
417 dnl ----------------------------------------------------------------
420 if test $ol_enable_slapd = no ; then
421 dnl SLAPD was specificallly disabled
422 if test $ol_enable_slapi = yes ; then
423 AC_MSG_WARN([slapd disabled, ignoring --enable-slapi argument])
425 case "$ol_enable_backends" in yes | mod)
426 AC_MSG_WARN([slapd disabled, ignoring --enable-backends argument])
428 for i in $Backends; do
429 eval "ol_tmp=\$ol_enable_$i"
430 if test $ol_tmp != no ; then
431 AC_MSG_WARN([slapd disabled, ignoring --enable-$i argument])
432 eval "ol_enable_$i=no"
435 if test $ol_enable_modules = yes ; then
436 AC_MSG_WARN([slapd disabled, ignoring --enable-modules argument])
438 if test $ol_enable_multimaster = yes ; then
439 AC_MSG_WARN([slapd disabled, ignoring --enable-multimaster argument])
441 if test $ol_enable_wrappers = yes ; then
442 AC_MSG_WARN([slapd disabled, ignoring --enable-wrappers argument])
444 if test $ol_enable_rlookups = yes ; then
445 AC_MSG_WARN([slapd disabled, ignoring --enable-rlookups argument])
447 if test $ol_enable_aci = yes ; then
448 AC_MSG_WARN([slapd disabled, ignoring --enable-aci argument])
450 if test $ol_with_ldbm_api != auto ; then
451 AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-api argument])
453 if test $ol_with_ldbm_type != auto ; then
454 AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-type argument])
456 if test $ol_enable_slurpd = yes ; then
457 AC_MSG_ERROR([slurpd requires slapd])
459 if test $ol_enable_rewrite = yes ; then
460 AC_MSG_WARN([slapd disabled, ignoring --enable-rewrite argument])
463 case "$ol_enable_overlays" in yes | mod)
464 AC_MSG_WARN([slapd disabled, ignoring --enable-overlays argument])
466 for i in $Overlays; do
467 eval "ol_tmp=\$ol_enable_$i"
468 if test $ol_tmp != no ; then
469 AC_MSG_WARN([slapd disabled, ignoring --enable-$i argument])
470 eval "ol_enable_$i=no"
474 # force settings to no
480 ol_enable_multimaster=no
481 ol_enable_rlookups=no
483 ol_enable_wrappers=no
492 elif test $ol_enable_ldbm = no ; then
493 dnl SLAPD without LDBM
495 if test $ol_with_ldbm_api != auto ; then
496 AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-api argument])
499 if test $ol_with_ldbm_type != auto ; then
500 AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-type argument])
503 if test $ol_enable_modules != yes -a \
504 $ol_enable_bdb = no -a \
505 $ol_enable_dnssrv = no -a \
506 $ol_enable_hdb = no -a \
507 $ol_enable_ldap = no -a \
508 $ol_enable_meta = no -a \
509 $ol_enable_monitor = no -a \
510 $ol_enable_null = no -a \
511 $ol_enable_passwd = no -a \
512 $ol_enable_perl = no -a \
513 $ol_enable_relay = no -a \
514 $ol_enable_shell = no -a \
515 $ol_enable_sql = no ; then
517 if test $ol_enable_slapd = yes ; then
518 AC_MSG_ERROR([slapd requires a backend])
520 AC_MSG_WARN([skipping slapd, no backend specified])
528 if test $ol_enable_bdb != no -o $ol_enable_hdb != no; then
529 ol_with_ldbm_api=berkeley
534 if test $ol_with_ldbm_api = gdbm -a \
535 $ol_with_ldbm_type = btree ; then
536 AC_MSG_ERROR([GDBM only supports LDBM type hash])
538 if test $ol_with_ldbm_api = mdbm -a \
539 $ol_with_ldbm_type = btree ; then
540 AC_MSG_ERROR([MDBM only supports LDBM type hash])
542 if test $ol_with_ldbm_api = ndbm -a \
543 $ol_with_ldbm_type = btree ; then
544 AC_MSG_ERROR([NDBM only supports LDBM type hash])
547 if test $ol_enable_bdb != no -o $ol_enable_hdb != no ; then
548 if test $ol_with_ldbm_api = auto ; then
549 ol_with_ldbm_api=berkeley
550 elif test $ol_with_ldbm_api != berkeley ; then
551 AC_MSG_ERROR([LDBM API not compatible with BDB/HDB])
556 if test $ol_enable_meta = yes -a $ol_enable_ldap = no ; then
557 AC_MSG_ERROR([--enable-meta requires --enable-ldap])
560 if test $ol_enable_slurpd = yes ; then
561 dnl SLURPD was specifically enabled
562 if test $ol_with_threads = no ; then
563 AC_MSG_ERROR([slurpd requires threads])
567 if test $ol_enable_lmpasswd = yes ; then
568 if test $ol_with_tls = no ; then
569 AC_MSG_ERROR([LAN Manager passwords require OpenSSL])
573 if test $ol_enable_kbind = yes ; then
574 if test $ol_with_kerberos = no ; then
575 AC_MSG_ERROR([options require --with-kerberos])
576 elif test $ol_with_kerberos = auto ; then
580 elif test $ol_enable_kbind = no ; then
581 if test $ol_with_kerberos = auto ; then
583 elif test $ol_with_kerberos != no ; then
584 AC_MSG_WARN([Kerberos detection enabled unnecessarily]);
589 if test $ol_enable_spasswd = yes ; then
590 if test $ol_with_cyrus_sasl = no ; then
591 AC_MSG_ERROR([options require --with-cyrus-sasl])
593 ol_with_cyrus_sasl=yes
598 dnl ----------------------------------------------------------------
645 SLAPD_STATIC_OVERLAYS=
646 SLAPD_DYNAMIC_OVERLAYS=
648 SLAPD_MODULES_LDFLAGS=
649 SLAPD_MODULES_CPPFLAGS=
651 SLAPD_STATIC_BACKENDS=back-ldif
652 SLAPD_DYNAMIC_BACKENDS=
675 dnl ================================================================
676 dnl Checks for programs
678 AC_DEFINE(HAVE_MKVERSION, 1, [define this if you have mkversion])
680 dnl ----------------------------------------------------------------
682 dnl Determine which C translator to use
685 dnl AIX Thread requires we use cc_r or xlc_r.
686 dnl But only do this IF AIX and CC is not set
687 dnl and threads are auto|yes|posix.
689 dnl If we find cc_r|xlc_r, force pthreads and assume
690 dnl pthread_create is in $LIBS (ie: don't bring in
691 dnl any additional thread libraries)
692 dnl If we do not find cc_r|xlc_r, disable threads
696 *-*-aix*) dnl all AIX is not a good idea.
697 if test -z "$CC" ; then
698 case "$ol_with_threads" in
699 auto | yes | posix) ol_aix_threads=yes ;;
705 if test $ol_aix_threads = yes ; then
706 if test -z "${CC}" ; then
707 AC_CHECK_PROGS(CC,cc_r xlc_r cc)
709 if test "$CC" = cc ; then
710 dnl no CC! don't allow --with-threads
711 if test $ol_with_threads != auto ; then
712 AC_MSG_ERROR([--with-threads requires cc_r (or other suitable compiler) on AIX])
714 AC_MSG_WARN([disabling threads, no cc_r on AIX])
720 if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
721 ol_with_threads=posix
722 ol_cv_pthread_create=yes
726 if test -z "${CC}"; then
727 AC_CHECK_PROGS(CC,cc gcc,missing)
729 if test "${CC}" = "missing" ; then
730 AC_MSG_ERROR([Unable to locate cc(1) or suitable replacement. Check PATH or set CC.])
734 if test -z "${AR}"; then
735 AC_CHECK_PROGS(AR,ar gar,missing)
737 if test "${AR}" = "missing" ; then
738 AC_MSG_ERROR([Unable to locate ar(1) or suitable replacement. Check PATH or set AR.])
746 dnl ----------------------------------------------------------------
749 if test $ol_enable_perl != no ; then
750 AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl)
752 if test "no$PERLBIN" = "no" ; then
753 if test $ol_enable_perl = yes ; then
754 AC_MSG_ERROR([could not locate perl])
758 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
759 PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e 's/ -lc / /' -e 's/ -lc$//'`"
761 if test x"$ol_enable_perl" = "xyes" ; then
762 SLAPD_PERL_LDFLAGS="$PERL_LDFLAGS"
764 MOD_PERL_LDFLAGS="$PERL_LDFLAGS"
766 dnl should check perl version
773 dnl ----------------------------------------------------------------
774 dnl Checks for UNIX Variants
779 dnl ----------------------------------------------------------------
780 dnl Checks for file extensions
783 AC_DEFINE_UNQUOTED(EXEEXT, "${EXEEXT}", [defined to be the EXE extension])
785 dnl ----------------------------------------------------------------
786 dnl BeOS requires -lbe -lroot -lnet
787 AC_CHECK_LIB(be, be_app, [LIBS="$LIBS -lbe -lroot -lnet"], :, [-lroot -lnet])
789 dnl ----------------------------------------------------------------
790 dnl OpenLDAP requires STDC features
792 if test "X${ac_cv_prog_cc_stdc}" = "Xno" ; then
793 AC_MSG_ERROR([OpenLDAP requires compiler to support STDC constructs.])
796 dnl ----------------------------------------------------------------
797 dnl Check cc depend flags
799 if test "${ol_cv_mkdep}" = no ; then
800 # this will soon become an error
801 AC_MSG_WARN([do not know how to generate dependencies])
804 dnl ----------------------------------------------------------------
805 dnl Check for AIX security library
806 AC_CHECK_LIB(s, afopen, [
808 AC_DEFINE(HAVE_AIX_SECURITY,1,[define if you have AIX security lib])
811 dnl ----------------------------------------------------------------
812 dnl Check for IBM OS/390
816 AC_DEFINE(BOTH_STRINGS_H,1,[define to use both <string.h> and <strings.h>])
820 dnl ----------------------------------------------------------------
821 dnl Check for module support
823 WITH_MODULES_ENABLED=no
824 if test $ol_enable_modules != no ; then
825 AC_CHECK_HEADERS(ltdl.h)
827 if test $ac_cv_header_ltdl_h = no ; then
828 AC_MSG_ERROR([could not locate libtool ltdl.h])
831 AC_CHECK_LIB(ltdl, lt_dlinit, [
833 AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
836 if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
837 AC_MSG_ERROR([could not locate libtool -lltdl])
840 WITH_MODULES_ENABLED=yes
843 for i in $Backends; do
844 eval "ol_tmp=\$ol_enable_$i"
845 if test $ol_tmp = mod ; then
846 AC_MSG_WARN([building static $i backend])
847 eval "ol_enable_$i=yes"
850 for i in $Overlays; do
851 eval "ol_tmp=\$ol_enable_$i"
852 if test $ol_tmp = mod ; then
853 AC_MSG_WARN([building static $i overlay])
854 eval "ol_enable_$i=yes"
859 dnl ----------------------------------------------------------------
860 dnl Checks for header files.
863 if test $ol_cv_header_stdc != yes; then
864 AC_MSG_WARN([could not locate Standard C compliant headers])
923 dnl ----------------------------------------------------------------
924 dnl Checks for libraries
926 AC_CHECK_FUNCS( sigaction sigset )
928 dnl HP-UX requires -lV3
929 dnl this is not needed on newer versions of HP-UX
930 if test $ac_cv_func_sigaction = no && test $ac_cv_func_sigaction = no ; then
931 AC_CHECK_LIB(V3, sigset)
934 dnl The following is INTENTIONALLY scripted out because shell does not
935 dnl support variable names with the '@' character, which is what
936 dnl autoconf would try to generate if one merely used AC_SEARCH_LIBS
938 dnl Skip Winsock tests on Cygwin
939 if test "$ac_cv_cygwin" != yes && test "$ac_cv_header_winsock_h" = yes; then
940 AC_CACHE_CHECK([for winsock], [ol_cv_winsock],
942 for curlib in ws2_32 wsock32; do
943 LIBS="$LIBS -l$curlib"
944 AC_TRY_LINK([#include <winsock.h>
948 select(0,NULL,NULL,NULL,NULL);
952 ol_cv_winsock=yes, ol_cv_winsock=no)
954 if test $ol_cv_winsock = yes; then
955 AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
956 ac_cv_func_socket=yes
957 ac_cv_func_select=yes
958 ac_cv_func_closesocket=yes
959 ac_cv_func_gethostname=yes
960 if test $curlib = ws2_32; then
961 ol_cv_winsock=winsock2
962 AC_DEFINE(HAVE_WINSOCK2, 1,
963 [define if you have winsock2])
972 dnl Likely combinations:
973 dnl -lsocket [ -lnsl_s | -lnsl ]
976 AC_CHECK_FUNC(socket, :, [
977 dnl hopefully we won't include too many libraries
978 AC_CHECK_LIB(socket, main)
979 AC_CHECK_LIB(net, main)
980 AC_CHECK_LIB(nsl_s, main)
981 AC_CHECK_LIB(nsl, main)
982 AC_CHECK_LIB(inet, socket)
983 AC_CHECK_LIB(gen, main)
987 AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
989 if test "${ac_cv_header_winsock_h}" != yes; then
991 dnl (if this detection becomes permenent, it and the select() detection
992 dnl should be done before the yielding select test)
993 AC_FUNC_SELECT_ARGTYPES
996 dnl check to see if system call automatically restart
997 dnl AC_SYS_RESTARTABLE_SYSCALLS
999 dnl ----------------------------------------------------------------
1000 AC_CHECK_FUNCS( poll )
1001 AC_CHECK_HEADERS( poll.h )
1003 dnl ----------------------------------------------------------------
1004 AC_CHECK_HEADERS( sys/epoll.h )
1005 if test "${ac_cv_header_sys_epoll_h}" = yes; then
1006 AC_MSG_CHECKING(for epoll system call)
1008 int main(int argc, char *argv[])
1010 int epfd = epoll_create(256);
1011 exit (epfd == -1 ? 1 : 0);
1012 }, [AC_MSG_RESULT(yes)
1013 AC_DEFINE(HAVE_EPOLL,1, [define if your system supports epoll])],
1014 AC_MSG_RESULT(no),AC_MSG_RESULT(no))
1017 dnl ----------------------------------------------------------------
1021 dnl ----------------------------------------------------------------
1022 dnl require POSIX regex
1023 AC_CHECK_HEADERS( regex.h )
1024 if test "$ac_cv_header_regex_h" != yes ; then
1025 AC_MSG_ERROR([POSIX regex.h required.])
1027 AC_SEARCH_LIBS(regfree, [regex gnuregex],
1028 :, AC_MSG_ERROR([POSIX regex required.]))
1031 if test "$ol_cv_c_posix_regex" = no ; then
1032 AC_MSG_ERROR([broken POSIX regex!])
1035 dnl ----------------------------------------------------------------
1039 AC_CHECK_HEADERS(sys/uuid.h)
1040 if test $ac_cv_header_sys_uuid_h = yes ; then
1042 AC_SEARCH_LIBS(uuid_to_str, uuid, [have_uuid=yes], :)
1045 if test have_uuid = yes ; then
1046 AC_DEFINE(HAVE_UUID_TO_STR,1,
1047 [define if you have uuid_to_str()])
1049 test "$ac_cv_search_uuid_to_str" = "none required" || \
1050 SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
1054 dnl For windows, check for the need of RPCRT for UUID function support
1055 if test $have_uuid = no ; then
1056 AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support)
1058 LIBS="$LIBS -lrpcrt4"
1060 int __stdcall UuidCreate(void *);
1061 int __stdcall UuidToStringA(void *,void **);
1067 need_rpcrt=yes, need_rpcrt=no)
1068 if test $need_rpcrt = yes; then
1069 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
1072 AC_MSG_RESULT($need_rpcrt)
1075 dnl ----------------------------------------------------------------
1076 dnl Check for resolver routines
1080 if test "$ol_cv_lib_resolver" != no ; then
1081 AC_DEFINE(HAVE_RES_QUERY,1,
1082 [define if you have res_query()])
1084 if test "$ol_enable_dnssrv" != no ; then
1088 if test "$ol_cv_lib_resolver" != yes ; then
1089 LIBS="$ol_cv_lib_resolver $LIBS"
1093 if test "$ol_enable_dnssrv" = yes -o "$ol_enable_dnssrv" = mod ; then
1094 if test "$ol_link_dnssrv" = no ; then
1095 AC_MSG_ERROR([DNSSRV requires res_query()])
1101 AC_CHECK_FUNCS( hstrerror )
1103 dnl ----------------------------------------------------------------
1104 dnl PF_INET6 support requires getaddrinfo and INET6_ADDRSTRLEN
1105 dnl PF_LOCAL may use getaddrinfo in available
1106 AC_CHECK_FUNCS( getaddrinfo getnameinfo gai_strerror inet_ntop )
1109 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
1110 if test $ol_enable_ipv6 = yes ; then
1111 AC_MSG_ERROR([IPv6 support requires getaddrinfo() and inet_ntop()])
1113 elif test $ol_enable_ipv6 != no ; then
1114 AC_CACHE_CHECK([INET6_ADDRSTRLEN],[ol_cv_inet6_addrstrlen],[
1115 AC_EGREP_CPP(__has_inet6_addrstrlen__,[
1116 # include <netinet/in.h>
1117 # ifdef INET6_ADDRSTRLEN
1118 __has_inet6_addrstrlen__;
1120 ], [ol_cv_inet6_addrstrlen=yes], [ol_cv_inet6_addrstrlen=no])])
1123 AC_CACHE_CHECK([struct sockaddr_storage],ol_cv_struct_sockaddr_storage,[
1125 #include <sys/types.h>
1126 #include <sys/socket.h>
1128 struct sockaddr_storage ss;
1129 ], [ol_cv_struct_sockaddr_storage=yes],
1130 [ol_cv_struct_sockaddr_storage=no])])
1132 if test $ol_cv_inet6_addrstrlen = yes \
1133 -a $ol_cv_struct_sockaddr_storage = yes ; then
1135 elif test $ol_enable_ipv6 = yes \
1136 -a $ol_cv_inet6_addrstrlen = no ; then
1137 AC_MSG_ERROR([IPv6 support requires INET6_ADDRSTRLEN])
1138 elif test $ol_enable_ipv6 = yes \
1139 -a $ol_cv_struct_sockaddr_storage = no ; then
1140 AC_MSG_ERROR([IPv6 support requires struct sockaddr_storage])
1144 if test $ol_enable_local != no ; then
1145 AC_CHECK_HEADERS( sys/un.h )
1147 if test $ol_enable_local = auto ; then
1148 ol_enable_local=$ac_cv_header_sys_un_h
1149 elif test $ac_cv_header_sys_un_h = no ; then
1150 AC_MSG_ERROR([AF_LOCAL domain support requires sys/un.h])
1154 dnl ----------------------------------------------------------------
1160 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
1161 -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
1162 -o $ol_with_kerberos = k425 ; then
1164 AC_CHECK_HEADERS(krb5.h)
1166 if test $ac_cv_header_krb5_h = yes ; then
1167 dnl lazy check for Heimdal Kerberos
1168 AC_CHECK_HEADERS(heim_err.h)
1169 if test $ac_cv_header_heim_err_h = yes ; then
1175 if test $krb5_impl = mit; then
1176 AC_CHECK_LIB(k5crypto, main,
1177 [krb5crypto=k5crypto],
1178 [krb5crypto=crypto])
1180 AC_CHECK_LIB(krb5, main,
1182 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"],
1184 [-l$krb5crypto -lcom_err])
1186 elif test $krb5_impl = heimdal; then
1187 AC_CHECK_LIB(des, main,
1189 [krb5crypto=crypto])
1191 AC_CHECK_LIB(krb5, main,
1193 KRB5_LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err"],
1195 [-l$krb5crypto -lasn1 -lroken -lcom_err])
1197 AC_DEFINE(HAVE_HEIMDAL_KERBEROS, 1,
1198 [define if you have HEIMDAL Kerberos])
1202 AC_MSG_WARN([Unrecognized Kerberos5 Implementation])
1205 if test $have_krb5 = yes ; then
1208 AC_DEFINE(HAVE_KRB5, 1,
1209 [define if you have Kerberos V])
1211 if test $ol_with_kerberos = k5only ; then
1212 ol_with_kerberos=found
1215 elif test $ol_with_kerberos != auto ; then
1216 AC_MSG_ERROR([Required Kerberos 5 support not available])
1222 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
1223 $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
1225 AC_CHECK_HEADERS(kerberosIV/krb.h kerberosIV/des.h)
1227 if test $ac_cv_header_kerberosIV_krb_h = yes ; then
1228 if test $krb5_impl = mit; then
1229 AC_CHECK_LIB(krb4, main, [have_k425=yes
1230 KRB4_LIBS="-lkrb4 -ldes425"], [have_k425=no],
1231 [-ldes425 -lkrb5 -l$krb5crypto -lcom_err])
1233 elif test $krb5_impl = heimdal; then
1234 AC_CHECK_LIB(krb4, main, [have_k425=yes
1235 KRB4_LIBS="-lkrb4"], [have_k425=no],
1236 [-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err])
1240 AC_MSG_WARN([Unrecongized Kerberos V Implementation])
1243 if test $have_k425 = yes ; then
1244 ol_with_kerberos=found
1247 AC_DEFINE(HAVE_KRB425, 1,
1248 [define if you have Kerberos V with IV support])
1249 AC_DEFINE(HAVE_KRB4, 1,
1250 [define if you have Kerberos IV])
1252 AC_CACHE_CHECK([for des_debug in Kerberos libraries],
1253 [ol_cv_var_des_debug], [
1256 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
1258 #include <kerberosIV/krb.h>
1259 #include <kerberosIV/des.h>
1260 extern int des_debug;
1263 ], ol_cv_var_des_debug=yes, ol_cv_var_des_debug=no)
1264 dnl restore the LIBS
1268 if test $ol_cv_var_des_debug = yes ; then
1269 AC_DEFINE(HAVE_DES_DEBUG,1,
1270 [define if you have Kerberos des_debug])
1278 if test $ol_link_krb5 = yes ; then
1279 ol_with_kerberos=found
1282 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
1283 -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
1285 AC_CHECK_HEADERS(krb.h des.h krb-archaeology.h )
1287 if test $ac_cv_header_krb_h = yes ; then
1288 AC_CHECK_LIB(krb, main, [have_k4=yes], [have_k4=no], [-ldes])
1290 if test $have_k4 = yes ; then
1291 ol_with_kerberos=found
1294 AC_DEFINE(HAVE_KRB4, 1,
1295 [define if you have Kerberos IV])
1297 KRB4_LIBS="-lkrb -ldes"
1299 if test $ac_cv_header_krb_archaeology_h = yes ; then
1300 AC_DEFINE(HAVE_KTH_KERBEROS, 1,
1301 [define if you have Kth Kerberos])
1307 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
1310 elif test $ol_enable_kbind = yes ; then
1311 AC_MSG_ERROR([Kerberos IV detection failed])
1314 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
1315 AC_DEFINE(HAVE_KERBEROS, 1, [define if you have Kerberos])
1317 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
1318 AC_MSG_ERROR([Kerberos detection failed])
1321 dnl ----------------------------------------------------------------
1325 if test $ol_with_tls != no ; then
1326 AC_CHECK_HEADERS(openssl/ssl.h ssl.h)
1328 if test $ac_cv_header_openssl_ssl_h = yes \
1329 -o $ac_cv_header_ssl_h = yes ; then
1330 AC_CHECK_LIB(ssl, SSLeay_add_ssl_algorithms,
1336 if test $have_ssleay = no ; then
1337 AC_CHECK_LIB(ssl, SSL_library_init,
1339 need_rsaref=no], [have_ssleay=no],
1343 if test $have_ssleay = no ; then
1344 AC_CHECK_LIB(ssl, ssl3_accept,
1346 need_rsaref=yes], [have_ssleay=no],
1347 [-lcrypto -lRSAglue -lrsaref])
1350 if test $have_ssleay = yes ; then
1354 AC_DEFINE(HAVE_SSLEAY, 1,
1355 [define if you have SSLeay or OpenSSL])
1357 if test $need_rsaref = yes; then
1358 AC_DEFINE(HAVE_RSAREF, 1,
1359 [define if you have RSAref])
1361 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
1363 TLS_LIBS="-lssl -lcrypto"
1367 if test $ol_cv_ssl_crl_compat = no ; then
1370 AC_DEFINE(HAVE_OPENSSL_CRL, 1,
1371 [define if you have OpenSSL with CRL checking capability])
1376 AC_WARN([TLS data protection not supported!])
1380 if test $ol_link_tls = yes ; then
1381 AC_DEFINE(HAVE_TLS, 1, [define if you have TLS])
1384 elif test $ol_with_tls = auto ; then
1385 AC_WARN([Could not locate TLS/SSL package])
1386 AC_WARN([TLS data protection not supported!])
1388 elif test $ol_with_tls != no ; then
1389 AC_ERROR([Could not locate TLS/SSL package])
1392 dnl ----------------------------------------------------------------
1393 dnl LAN Manger password checking requires DES from OpenSSL
1394 if test $ol_enable_lmpasswd != no; then
1395 if test $ol_link_tls != yes ; then
1396 AC_ERROR([LAN Manager passwords require OpenSSL])
1399 AC_DEFINE(SLAPD_LMHASH, 1, [define to support LAN Manager passwords])
1402 dnl ----------------------------------------------------------------
1406 if test $ol_with_threads = auto -o $ol_with_threads = yes \
1407 -o $ol_with_threads = nt ; then
1411 if test "$ol_cv_nt_threads" = yes ; then
1413 ol_with_threads=found
1414 ol_with_yielding_select=yes
1416 AC_DEFINE(HAVE_NT_SERVICE_MANAGER,1,[if you have NT Service Manager])
1417 AC_DEFINE(HAVE_NT_EVENT_LOG,1,[if you have NT Event Log])
1420 if test $ol_with_threads = nt ; then
1421 AC_MSG_ERROR([could not locate NT Threads])
1425 if test $ol_with_threads = auto -o $ol_with_threads = yes \
1426 -o $ol_with_threads = posix ; then
1428 AC_CHECK_HEADERS(pthread.h)
1430 if test $ac_cv_header_pthread_h = yes ; then
1431 OL_POSIX_THREAD_VERSION
1433 if test $ol_cv_pthread_version != 0 ; then
1434 AC_DEFINE_UNQUOTED(HAVE_PTHREADS,$ol_cv_pthread_version,
1435 [define to pthreads API spec revision])
1437 AC_MSG_ERROR([unknown pthread version])
1440 # consider threads found
1441 ol_with_threads=found
1443 OL_HEADER_LINUX_THREADS
1444 OL_HEADER_GNU_PTH_PTHREAD_H
1446 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
1447 AC_CHECK_HEADERS(sched.h)
1450 dnl Now the hard part, how to link?
1452 dnl currently supported checks:
1454 dnl Check for no flags
1455 dnl pthread_create() in $LIBS
1457 dnl Check special pthread (final) flags
1458 dnl [skipped] pthread_create() with -mt (Solaris) [disabled]
1459 dnl pthread_create() with -kthread (FreeBSD)
1460 dnl pthread_create() with -pthread (FreeBSD/Digital Unix)
1461 dnl pthread_create() with -pthreads (?)
1462 dnl pthread_create() with -mthreads (AIX)
1463 dnl pthread_create() with -thread (?)
1465 dnl Check pthread (final) libraries
1466 dnl pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1)
1467 dnl pthread_mutex_lock() in -lpthread -lmach -lexc (OSF/1)
1468 dnl [skipped] pthread_mutex_trylock() in -lpthread -lexc (OSF/1)
1469 dnl pthread_join() -Wl,-woff,85 -lpthread (IRIX)
1470 dnl pthread_create() in -lpthread (many)
1471 dnl pthread_create() in -lc_r (FreeBSD)
1473 dnl Check pthread (draft4) flags (depreciated)
1474 dnl pthread_create() with -threads (OSF/1)
1476 dnl Check pthread (draft4) libraries (depreciated)
1477 dnl pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
1478 dnl pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
1479 dnl pthread_mutex_trylock() in -lpthreads -lexc (OSF/1)
1480 dnl pthread_create() in -lpthreads (many)
1483 dnl pthread_create in $LIBS
1484 AC_CACHE_CHECK([for pthread_create in default libraries],
1485 ol_cv_pthread_create,[
1486 AC_TRY_RUN(OL_PTHREAD_TEST_PROGRAM,
1487 [ol_cv_pthread_create=yes],
1488 [ol_cv_pthread_create=no],
1489 [AC_TRY_LINK(OL_PTHREAD_TEST_INCLUDES,OL_PTHREAD_TEST_FUNCTION,
1490 [ol_cv_pthread_create=yes],
1491 [ol_cv_pthread_create=no])])])
1493 if test $ol_cv_pthread_create != no ; then
1494 ol_link_threads=posix
1498 dnl OL_PTHREAD_TRY([-mt], [ol_cv_pthread_mt])
1499 OL_PTHREAD_TRY([-kthread], [ol_cv_pthread_kthread])
1500 OL_PTHREAD_TRY([-pthread], [ol_cv_pthread_pthread])
1501 OL_PTHREAD_TRY([-pthreads], [ol_cv_pthread_pthreads])
1502 OL_PTHREAD_TRY([-mthreads], [ol_cv_pthread_mthreads])
1503 OL_PTHREAD_TRY([-thread], [ol_cv_pthread_thread])
1505 OL_PTHREAD_TRY([-lpthread -lmach -lexc -lc_r],
1506 [ol_cv_pthread_lpthread_lmach_lexc_lc_r])
1507 OL_PTHREAD_TRY([-lpthread -lmach -lexc],
1508 [ol_cv_pthread_lpthread_lmach_lexc])
1509 dnl OL_PTHREAD_TRY([-lpthread -lexc],
1510 dnl [ol_cv_pthread_lpthread_lexc])
1512 OL_PTHREAD_TRY([-lpthread -Wl,-woff,85],
1513 [ol_cv_pthread_lib_lpthread_woff])
1515 OL_PTHREAD_TRY([-lpthread], [ol_cv_pthread_lpthread])
1516 OL_PTHREAD_TRY([-lc_r], [ol_cv_pthread_lc_r])
1518 OL_PTHREAD_TRY([-threads], [ol_cv_pthread_threads])
1520 OL_PTHREAD_TRY([-lpthreads -lmach -lexc -lc_r],
1521 [ol_cv_pthread_lpthreads_lmach_lexc_lc_r])
1522 OL_PTHREAD_TRY([-lpthreads -lmach -lexc],
1523 [ol_cv_pthread_lpthreads_lmach_lexc])
1524 OL_PTHREAD_TRY([-lpthreads -lexc],
1525 [ol_cv_pthread_lpthreads_lexc])
1527 OL_PTHREAD_TRY([-lpthreads],[ol_cv_pthread_lib_lpthreads])
1529 if test $ol_link_threads != no ; then
1530 LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
1533 save_CPPFLAGS="$CPPFLAGS"
1535 LIBS="$LTHREAD_LIBS $LIBS"
1537 dnl All POSIX Thread (final) implementations should have
1538 dnl sched_yield instead of pthread yield.
1539 dnl check for both, and thr_yield for Solaris
1540 AC_CHECK_FUNCS(sched_yield pthread_yield thr_yield)
1542 if test $ac_cv_func_sched_yield = no -a \
1543 $ac_cv_func_pthread_yield = no -a \
1544 $ac_cv_func_thr_yield = no ; then
1545 dnl Digital UNIX has sched_yield() in -lrt
1546 AC_CHECK_LIB(rt, sched_yield,
1547 [LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
1548 AC_DEFINE(HAVE_SCHED_YIELD,1,
1549 [Define if you have the sched_yield function.])
1550 ac_cv_func_sched_yield=yes],
1551 [ac_cv_func_sched_yield=no])
1553 if test $ac_cv_func_sched_yield = no -a \
1554 $ac_cv_func_pthread_yield = no -a \
1555 "$ac_cv_func_thr_yield" = no ; then
1556 AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
1559 dnl Check functions for compatibility
1560 AC_CHECK_FUNCS(pthread_kill pthread_rwlock_destroy)
1562 dnl Check for pthread_detach with <pthread.h> inclusion
1563 dnl as it's symbol may have been mangled.
1564 AC_CACHE_CHECK([for pthread_detach with <pthread.h>],
1565 [ol_cv_func_pthread_detach], [
1568 #include <pthread.h>
1570 #define NULL (void*)0
1573 [pthread_detach(NULL);],
1574 [ol_cv_func_pthread_detach=yes],
1575 [ol_cv_func_pthread_detach=no])
1578 if test $ol_cv_func_pthread_detach = no ; then
1579 AC_MSG_ERROR([could not locate pthread_detach()])
1582 AC_DEFINE(HAVE_PTHREAD_DETACH,1,
1583 [define if you have pthread_detach function])
1585 dnl Check for setconcurreny functions
1587 pthread_setconcurrency \
1588 pthread_getconcurrency \
1589 thr_setconcurrency \
1590 thr_getconcurrency \
1593 OL_SYS_LINUX_THREADS
1596 if test $ol_cv_linux_threads = error; then
1597 AC_MSG_ERROR([LinuxThreads header/library mismatch]);
1600 AC_CACHE_CHECK([if pthread_create() works],
1601 ol_cv_pthread_create_works,[
1602 AC_TRY_RUN(OL_PTHREAD_TEST_PROGRAM,
1603 [ol_cv_pthread_create_works=yes],
1604 [ol_cv_pthread_create_works=no],
1606 ol_cv_pthread_create_works=yes])])
1608 if test $ol_cv_pthread_create_works = no ; then
1609 AC_MSG_ERROR([pthread_create is not usable, check environment settings])
1612 dnl Check if select causes an yield
1613 if test $ol_with_yielding_select = auto ; then
1614 AC_CACHE_CHECK([if select yields when using pthreads],
1615 ol_cv_pthread_select_yields,[
1617 #include <sys/types.h>
1618 #include <sys/time.h>
1620 #include <pthread.h>
1622 #define NULL (void*) 0
1625 static int fildes[2];
1627 static void *task(p)
1639 FD_SET(fildes[0], &rfds);
1641 /* we're not interested in any fds */
1642 i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
1649 exit(0); /* if we exit here, the select blocked the whole process */
1652 int main(argc, argv)
1658 /* create a pipe to select */
1659 if(pipe(&fildes[0])) {
1664 #ifdef HAVE_PTHREAD_SETCONCURRENCY
1665 (void) pthread_setconcurrency(2);
1667 #ifdef HAVE_THR_SETCONCURRENCY
1668 /* Set Solaris LWP concurrency to 2 */
1669 thr_setconcurrency(2);
1673 #if HAVE_PTHREADS < 6
1674 pthread_create(&t, pthread_attr_default, task, NULL);
1676 pthread_create(&t, NULL, task, NULL);
1679 /* make sure task runs first */
1682 #elif defined( HAVE_SCHED_YIELD )
1684 #elif defined( HAVE_PTHREAD_YIELD )
1690 [ol_cv_pthread_select_yields=no],
1691 [ol_cv_pthread_select_yields=yes],
1692 [ol_cv_pthread_select_yields=cross])])
1694 if test $ol_cv_pthread_select_yields = cross ; then
1695 AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual])
1698 if test $ol_cv_pthread_select_yields = yes ; then
1699 ol_with_yielding_select=yes
1704 CPPFLAGS="$save_CPPFLAGS"
1707 AC_MSG_ERROR([could not locate usable POSIX Threads])
1711 if test $ol_with_threads = posix ; then
1712 AC_MSG_ERROR([could not locate POSIX Threads])
1716 if test $ol_with_threads = auto -o $ol_with_threads = yes \
1717 -o $ol_with_threads = mach ; then
1719 dnl check for Mach CThreads
1720 AC_CHECK_HEADERS(mach/cthreads.h cthreads.h)
1721 if test $ac_cv_header_mach_cthreads_h = yes ; then
1722 ol_with_threads=found
1724 dnl check for cthreads support in current $LIBS
1725 AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
1727 if test $ol_link_threads = no ; then
1729 dnl this test needs work
1730 AC_CACHE_CHECK([for cthread_fork with -all_load],
1731 [ol_cv_cthread_all_load], [
1734 LIBS="-all_load $LIBS"
1735 AC_TRY_LINK([#include <mach/cthreads.h>],[
1736 cthread_fork((void *)0, (void *)0);
1737 ], ol_cv_cthread_all_load=yes, ol_cv_cthread_all_load=no)
1738 dnl restore the LIBS
1742 if test $ol_cv_cthread_all_load = yes ; then
1743 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
1744 ol_link_threads=mach
1745 ol_with_threads=found
1749 elif test $ac_cv_header_cthreads_h = yes ; then
1750 dnl Hurd variant of Mach Cthreads
1751 dnl uses <cthreads.h> and -lthreads
1753 ol_with_threads=found
1757 LIBS="$LIBS -lthreads"
1758 AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
1761 if test $ol_link_threads = yes ; then
1762 LTHREAD_LIBS="-lthreads"
1763 ol_link_threads=mach
1764 ol_with_threads=found
1766 AC_MSG_ERROR([could not link with Mach CThreads])
1769 elif test $ol_with_threads = mach ; then
1770 AC_MSG_ERROR([could not locate Mach CThreads])
1773 if test $ol_link_threads = mach ; then
1774 AC_DEFINE(HAVE_MACH_CTHREADS,1,
1775 [define if you have Mach Cthreads])
1776 elif test $ol_with_threads = found ; then
1777 AC_MSG_ERROR([could not link with Mach CThreads])
1781 if test $ol_with_threads = auto -o $ol_with_threads = yes \
1782 -o $ol_with_threads = pth ; then
1784 AC_CHECK_HEADERS(pth.h)
1786 if test $ac_cv_header_pth_h = yes ; then
1787 AC_CHECK_LIB(pth, pth_version, [have_pth=yes], [have_pth=no])
1789 if test $have_pth = yes ; then
1790 AC_DEFINE(HAVE_GNU_PTH,1,[if you have GNU Pth])
1791 LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
1793 ol_with_threads=found
1795 if test $ol_with_yielding_select = auto ; then
1796 ol_with_yielding_select=yes
1802 if test $ol_with_threads = auto -o $ol_with_threads = yes \
1803 -o $ol_with_threads = lwp ; then
1805 dnl check for SunOS5 LWP
1806 AC_CHECK_HEADERS(thread.h synch.h)
1807 if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
1808 AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
1810 if test $have_thr = yes ; then
1811 AC_DEFINE(HAVE_THR,1,
1812 [if you have Solaris LWP (thr) package])
1813 LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
1816 if test $ol_with_yielding_select = auto ; then
1817 ol_with_yielding_select=yes
1820 dnl Check for setconcurreny functions
1822 thr_setconcurrency \
1823 thr_getconcurrency \
1828 dnl check for SunOS4 LWP
1829 AC_CHECK_HEADERS(lwp/lwp.h)
1830 if test $ac_cv_header_lwp_lwp_h = yes ; then
1831 AC_CHECK_LIB(lwp, lwp_create, [have_lwp=yes], [have_lwp=no])
1833 if test $have_lwp = yes ; then
1834 AC_DEFINE(HAVE_LWP,1,
1835 [if you have SunOS LWP package])
1836 LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
1839 if test $ol_with_yielding_select = auto ; then
1840 ol_with_yielding_select=no
1846 if test $ol_with_yielding_select = yes ; then
1847 AC_DEFINE(HAVE_YIELDING_SELECT,1,
1848 [define if select implicitly yields])
1851 if test $ol_with_threads = manual ; then
1852 dnl User thinks he can manually configure threads.
1855 AC_MSG_WARN([thread defines and link options must be set manually])
1857 AC_CHECK_HEADERS(pthread.h sched.h)
1858 AC_CHECK_FUNCS(sched_yield pthread_yield)
1859 OL_HEADER_LINUX_THREADS
1861 AC_CHECK_HEADERS(mach/cthreads.h)
1862 AC_CHECK_HEADERS(lwp/lwp.h)
1863 AC_CHECK_HEADERS(thread.h synch.h)
1866 if test $ol_link_threads != no -a $ol_link_threads != nt ; then
1867 dnl needed to get reentrant/threadsafe versions
1869 AC_DEFINE(REENTRANT,1)
1870 AC_DEFINE(_REENTRANT,1)
1871 AC_DEFINE(THREAD_SAFE,1)
1872 AC_DEFINE(_THREAD_SAFE,1)
1873 AC_DEFINE(THREADSAFE,1)
1874 AC_DEFINE(_THREADSAFE,1)
1875 AC_DEFINE(_SGI_MP_SOURCE,1)
1877 dnl The errno declaration may dependent upon _REENTRANT.
1878 dnl If it does, we must link with thread support.
1879 AC_CACHE_CHECK([for thread specific errno],
1880 [ol_cv_errno_thread_specific], [
1881 AC_TRY_LINK([#include <errno.h>], [errno = 0;],
1882 [ol_cv_errno_thread_specific=yes],
1883 [ol_cv_errno_thread_specific=no])
1886 dnl The h_errno declaration may dependent upon _REENTRANT.
1887 dnl If it does, we must link with thread support.
1888 AC_CACHE_CHECK([for thread specific h_errno],
1889 [ol_cv_h_errno_thread_specific], [
1890 AC_TRY_LINK([#include <netdb.h>], [h_errno = 0;],
1891 [ol_cv_h_errno_thread_specific=yes],
1892 [ol_cv_h_errno_thread_specific=no])
1895 if test $ol_cv_errno_thread_specific != yes \
1896 -o $ol_cv_h_errno_thread_specific != yes ; then
1897 LIBS="$LTHREAD_LIBS $LIBS"
1901 dnl When in thread environment, use
1902 dnl #if defined( HAVE_REENTRANT_FUNCTIONS ) || defined( HAVE_FUNC_R )
1905 dnl # if defined( HAVE_THREADS )
1909 dnl # if defined( HAVE_THREADS )
1914 dnl HAVE_REENTRANT_FUNCTIONS is derived from:
1915 dnl _POSIX_REENTRANT_FUNCTIONS
1916 dnl _POSIX_THREAD_SAFE_FUNCTIONS
1917 dnl _POSIX_THREADSAFE_FUNCTIONS
1919 dnl and is currently defined in <ldap_pvt_thread.h>
1921 dnl HAVE_THREADS is defined by <ldap_pvt_thread.h> iff -UNO_THREADS
1923 dnl libldap/*.c should only include <ldap_pvt_thread.h> iff
1924 dnl LDAP_R_COMPILE is defined. ie:
1925 dnl #ifdef LDAP_R_COMPILE
1926 dnl # include <ldap_pvt_thread.h>
1929 dnl LDAP_R_COMPILE is defined by libldap_r/Makefile.in
1930 dnl specifically for compiling the threadsafe version of
1931 dnl the ldap library (-lldap_r).
1933 dnl dnl check for reentrant/threadsafe functions
1935 dnl dnl note: these should only be used when linking
1936 dnl dnl with $LTHREAD_LIBS
1938 dnl save_CPPFLAGS="$CPPFLAGS"
1939 dnl save_LIBS="$LIBS"
1940 dnl LIBS="$LTHREAD_LIBS $LIBS"
1941 dnl AC_CHECK_FUNCS( \
1943 dnl gethostbyaddr_r gethostbyname_r \
1944 dnl feof_unlocked unlocked_feof \
1945 dnl putc_unlocked unlocked_putc \
1946 dnl flockfile ftrylockfile \
1948 dnl CPPFLAGS="$save_CPPFLAGS"
1949 dnl LIBS="$save_LIBS"
1952 if test $ol_link_threads = no ; then
1953 if test $ol_with_threads = yes ; then
1954 AC_MSG_ERROR([no suitable thread support])
1957 if test $ol_with_threads = auto ; then
1958 AC_MSG_WARN([no suitable thread support, disabling threads])
1962 AC_DEFINE(NO_THREADS,1,
1963 [define if you have (or want) no threads])
1967 if test $ol_link_threads != no ; then
1968 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE,1)
1971 dnl ----------------------------------------------------------------
1972 dnl Tests for reentrant functions necessary to build -lldap_r
1975 gethostbyname_r gethostbyaddr_r \
1978 if test "$ac_cv_func_ctime_r" = no ; then
1979 ol_cv_func_ctime_r_nargs=0
1981 OL_FUNC_CTIME_R_NARGS
1982 dnl OL_FUNC_CTIME_R_TYPE
1985 if test "$ac_cv_func_gethostbyname_r" = yes ; then
1986 OL_FUNC_GETHOSTBYNAME_R_NARGS
1988 ol_cv_func_gethostbyname_r_nargs=0
1991 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
1992 OL_FUNC_GETHOSTBYADDR_R_NARGS
1994 ol_cv_func_gethostbyaddr_r_nargs=0
1997 dnl ----------------------------------------------------------------
2000 if test $ol_with_ldbm_api = auto \
2001 -o $ol_with_ldbm_api = berkeley \
2002 -o $ol_with_ldbm_api = bcompat ; then
2004 if test $ol_with_ldbm_api = bcompat; then \
2005 OL_BERKELEY_COMPAT_DB
2010 if test $ol_cv_berkeley_db != no ; then
2011 AC_DEFINE(HAVE_BERKELEY_DB,1,
2012 [define this if Berkeley DB is available])
2014 ol_link_ldbm=berkeley
2015 ol_with_ldbm_api=berkeley
2017 if test $ol_with_ldbm_type = hash ; then
2018 AC_DEFINE(LDBM_USE_DBHASH,1,
2019 [define this to use DBHASH w/ LDBM backend])
2021 AC_DEFINE(LDBM_USE_DBBTREE,1,
2022 [define this to use DBBTREE w/ LDBM backend])
2025 dnl $ol_cv_lib_db should be yes or -ldb
2026 dnl (it could be no, but that would be an error
2027 if test $ol_cv_lib_db != yes ; then
2028 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
2033 if test $ol_enable_bdb != no -o $ol_enable_hdb != no; then
2034 if test $ol_link_ldbm != berkeley ; then
2035 AC_MSG_ERROR(BDB/HDB: BerkeleyDB not available)
2039 if test $ol_cv_bdb_compat != yes ; then
2040 AC_MSG_ERROR([BDB/HDB: BerkeleyDB version incompatible])
2045 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
2046 AC_MSG_WARN([Could not find LDBM with BTREE support])
2047 ol_with_ldbm_api=none
2050 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
2053 if test $ol_cv_mdbm = yes ; then
2055 ol_with_ldbm_api=mdbm
2056 if test $ol_cv_lib_mdbm != yes ; then
2057 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
2062 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
2065 if test $ol_cv_gdbm = yes ; then
2067 ol_with_ldbm_api=gdbm
2069 if test $ol_cv_lib_gdbm != yes ; then
2070 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
2075 if test $ol_with_ldbm_api = ndbm ; then
2078 if test $ol_cv_ndbm = yes ; then
2080 ol_with_ldbm_api=ndbm
2082 if test $ol_cv_lib_ndbm != yes ; then
2083 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
2088 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
2089 AC_MSG_ERROR([could not find suitable LDBM backend])
2092 if test $ol_enable_bdb = yes -o \
2093 $ol_enable_hdb = yes -o \
2094 $ol_enable_ldbm = yes ; then
2095 SLAPD_LIBS="$SLAPD_LIBS \$(LDBM_LIBS)"
2098 dnl ----------------------------------------------------------------
2100 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
2101 BUILD_LIBS_DYNAMIC=shared
2102 AC_DEFINE(LDAP_LIBS_DYNAMIC, 1, [define if LDAP libs are dynamic])
2105 BUILD_LIBS_DYNAMIC=static
2108 AC_SUBST(LTSTATIC)dnl
2110 dnl ----------------------------------------------------------------
2111 if test $ol_enable_wrappers != no ; then
2112 AC_CHECK_HEADERS(tcpd.h,[
2113 AC_MSG_CHECKING([for TCP wrappers library])
2118 int allow_severity = 0;
2119 int deny_severity = 0;
2121 struct request_info *req;
2124 ],[AC_MSG_RESULT([-lwrap])
2126 LIBS="$save_LIBS"],[
2131 int allow_severity = 0;
2132 int deny_severity = 0;
2134 struct request_info *req;
2137 ],[AC_MSG_RESULT([-lwrap -lnsl])
2139 LIBS="$save_LIBS -lnsl"],[
2142 LIBS=$save_LIBS])],[
2143 have_wrappers=no])],[have_wrappers=no])
2145 if test $have_wrappers = yes ; then
2146 AC_DEFINE(HAVE_TCPD,1, [define if you have -lwrap])
2148 elif test $ol_enable_wrappers = yes ; then
2149 AC_MSG_ERROR([could not find TCP wrappers, select apppropriate options or disable])
2151 AC_MSG_WARN([could not find TCP wrappers, support disabled])
2156 dnl ----------------------------------------------------------------
2157 if test $ol_enable_syslog != no ; then
2158 AC_CHECK_FUNC(openlog)
2159 if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
2160 AC_MSG_ERROR(could not find syslog, select appropriate options or disable)
2162 ol_enable_syslog=$ac_cv_func_openlog
2165 dnl ----------------------------------------------------------------
2166 dnl dmalloc support (deprecated in favor of -DCSRIMALLOC support)
2167 dnl if test $ol_enable_dmalloc != no ; then
2168 dnl AC_CHECK_HEADERS(dmalloc.h)
2169 dnl AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
2172 dnl ----------------------------------------------------------------
2175 if test $ol_enable_sql != no ; then
2176 AC_CHECK_HEADERS(sql.h sqlext.h,[],[
2177 AC_MSG_ERROR([could not locate SQL headers])
2181 LIBS="$LTHREAD_LIBS"
2183 AC_CHECK_LIB(iodbc,SQLDriverConnect,[have_iodbc=yes],[have_iodbc=no])
2184 if test $have_iodbc = yes ; then
2185 ol_link_sql="-liodbc"
2187 AC_CHECK_LIB(odbc,SQLDriverConnect,[have_odbc=yes],[have_odbc=no])
2188 if test $have_odbc = yes ; then
2189 ol_link_sql="-lodbc"
2195 if test $ol_link_sql != no ; then
2196 SLAPD_SQL_LIBS="$ol_link_sql"
2198 elif test $ol_enable_sql != auto ; then
2199 AC_MSG_ERROR([could not locate suitable ODBC library])
2203 dnl ----------------------------------------------------------------
2205 dnl Check for Cyrus SASL
2210 if test $ol_with_cyrus_sasl != no ; then
2211 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
2213 if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
2214 AC_CHECK_LIB(sasl2, sasl_client_init,
2215 [ol_link_sasl="-lsasl2"],
2216 [AC_CHECK_LIB(sasl, sasl_client_init,
2217 [ol_link_sasl="-lsasl"])])
2220 if test $ol_link_sasl = no ; then
2221 if test $ol_with_cyrus_sasl != auto ; then
2222 AC_MSG_ERROR([Could not locate Cyrus SASL])
2224 AC_MSG_WARN([Could not locate Cyrus SASL])
2225 AC_MSG_WARN([SASL authentication not supported!])
2226 if test $ol_link_tls = no ; then
2227 AC_MSG_WARN([Strong authentication not supported!])
2232 if test $ol_cv_sasl_compat = no ; then
2234 AC_MSG_ERROR([Cyrus SASL library located but is incompatible])
2237 AC_DEFINE(HAVE_CYRUS_SASL,1,[define if you have Cyrus SASL])
2238 SASL_LIBS="$ol_link_sasl"
2239 if test $ol_enable_spasswd != no ; then
2243 ac_save_LIBS="$LIBS"
2244 LIBS="$LIBS $ol_link_sasl"
2245 AC_CHECK_FUNC(sasl_version, [AC_DEFINE(HAVE_SASL_VERSION,1,
2246 [define if your SASL library has sasl_version()])])
2247 LIBS="$ac_save_LIBS"
2253 AC_MSG_WARN([SASL authentication not supported!])
2254 if test $ol_link_tls = no ; then
2255 AC_MSG_WARN([Strong authentication not supported!])
2259 dnl ----------------------------------------------------------------
2260 dnl Check for entropy sources
2261 if test $cross_compiling != yes -a "$ac_cv_mingw32" != yes ; then
2263 if test -r /dev/urandom ; then
2265 elif test -r /idev/urandom ; then
2266 dev="/idev/urandom";
2267 elif test -r /dev/srandom ; then
2269 elif test -r /dev/random ; then
2271 elif test -r /idev/random ; then
2275 if test $dev != no ; then
2276 AC_DEFINE_UNQUOTED(URANDOM_DEVICE,"$dev",[set to urandom device])
2280 dnl ----------------------------------------------------------------
2282 dnl Check for fetch URL support
2283 dnl should be extended to support other fetch URL APIs
2286 if test $ol_with_fetch != no ; then
2289 if test $ol_cv_lib_fetch != no ; then
2290 LUTIL_LIBS="$LUTIL_LIBS $ol_link_fetch"
2291 ol_link_fetch=freebsd
2293 elif test $ol_with_fetch != auto ; then
2294 AC_MSG_ERROR(no suitable API for --with-fetch=$ol_with_fetch)
2298 dnl ----------------------------------------------------------------
2299 dnl FreeBSD (and others) have crypt(3) in -lcrypt
2300 if test $ol_enable_crypt != no ; then
2302 LIBS="$TLS_LIBS $LIBS"
2304 AC_CHECK_FUNC(crypt, [have_crypt=yes], [
2306 AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
2307 have_crypt=yes], [have_crypt=no])])
2311 if test $have_crypt = yes ; then
2312 AC_DEFINE(HAVE_CRYPT,1, [define if crypt(3) is available])
2314 AC_MSG_WARN([could not find crypt])
2315 if test $ol_enable_crypt = yes ; then
2316 AC_MSG_ERROR([could not find crypt, select appropriate options or disable])
2319 AC_MSG_WARN([disabling crypt support])
2324 dnl ----------------------------------------------------------------
2325 dnl FreeBSD (and others) have setproctitle(3) in -lutil
2326 if test $ol_enable_proctitle != no ; then
2327 AC_CHECK_FUNC(setproctitle, [have_setproctitle=yes], [
2328 AC_CHECK_LIB(util, setproctitle,
2329 [have_setproctitle=yes
2330 LUTIL_LIBS="$LUTIL_LIBS -lutil"],
2331 [have_setproctitle=no
2332 AC_LIBOBJ(setproctitle)
2333 LIBSRCS="$LIBSRCS setproctitle.c"])])
2335 if test $have_setproctitle = yes ; then
2336 AC_DEFINE(HAVE_SETPROCTITLE,1,
2337 [define if setproctitle(3) is available])
2341 dnl ----------------------------------------------------------------
2342 dnl Check for SLPv2 Compliant API Library
2343 if test $ol_enable_slp != no ; then
2344 AC_CHECK_HEADERS( slp.h )
2346 if test $ac_cv_header_slp_h = yes ; then
2347 AC_CHECK_LIB(slp, SLPOpen, [have_slp=yes], [have_slp=no])
2348 if test $have_slp = yes ; then
2349 AC_DEFINE(HAVE_SLP, 1, [define if you have -lslp])
2350 SLAPD_SLP_LIBS=-lslp
2353 elif test $ol_enable_slp = yes ; then
2354 AC_MSG_ERROR([SLP not found])
2358 dnl ----------------------------------------------------------------
2359 dnl Check for multiple precision support
2360 if test "$ol_with_multiple_precision" != "no" ; then
2364 AC_CHECK_HEADERS(openssl/bn.h bn.h)
2365 AC_CHECK_HEADERS(openssl/crypto.h crypto.h)
2366 AC_CHECK_HEADERS( gmp.h )
2368 if test "$ol_with_tls" = "found" ; then
2372 if test "$ac_cv_header_openssl_bn_h" = "yes" \
2373 -o "$ac_cv_header_bn_h" = "yes" ; then
2377 if test "$ac_cv_header_openssl_crypto_h" = "yes" \
2378 -o "$ac_cv_header_crypto_h" = "yes" ; then
2379 ol_have_crypto_h=yes
2382 if test "$ol_have_bn_h" = "yes" \
2383 -a "$ol_have_crypto_h" = "yes" ; then
2388 if test $ac_cv_header_gmp_h = yes ; then
2389 AC_CHECK_LIB(gmp, __gmpz_add_ui, [have_gmp=yes], [have_gmp=no])
2390 if test $have_gmp = yes ; then
2395 AC_MSG_CHECKING([for multiple precision support])
2397 ol_mp_support="none"
2398 case "$ol_with_multiple_precision" in
2400 dnl preferred sequence:
2401 dnl - OpenSSL's BIGNUM (if libssl is already linked)
2404 if test "$ol_have_bignum" = "yes" ; then
2405 ol_mp_support="bignum"
2407 if test "$ol_have_gmp" = "yes" ; then
2413 if test "$ol_have_bignum" != "yes" ; then
2414 AC_MSG_ERROR([OpenSSL's BIGNUM not available])
2416 ol_mp_support="bignum"
2419 if test "$ol_have_gmp" != "yes" ; then
2420 AC_MSG_ERROR([GMP not available])
2425 if test "$ol_have_bignum" = "yes" ; then
2426 ol_mp_support="bignum"
2427 elif test "$ol_have_gmp" = "yes" ; then
2430 AC_MSG_ERROR([not available])
2435 case "$ol_mp_support" in
2437 AC_DEFINE(HAVE_BIGNUM, 1,
2438 [define if you have SSLeay or OpenSSL's BIGNUM])
2441 AC_DEFINE(HAVE_GMP, 1, [define if you have -lgmp])
2442 SLAPD_GMP_LIBS=-lgmp
2448 AC_MSG_RESULT($ol_mp_support)
2451 dnl ----------------------------------------------------------------
2452 dnl Checks for typedefs, structures, and compiler characteristics.
2454 dnl Checks for long long
2455 AC_CACHE_CHECK([long long], ol_cv_type_long_long, [
2456 AC_TRY_COMPILE([], [long long x;],
2457 [ol_cv_type_long_long=yes],
2458 [ol_cv_type_long_long=no])])
2459 if test $ol_cv_type_long_long = yes; then
2460 AC_DEFINE(HAVE_LONG_LONG, 1, [define if you have 'long long'])
2466 AC_CHECK_TYPES([ptrdiff_t])
2470 AC_CHECK_TYPE(ssize_t, [signed int])
2471 AC_CHECK_TYPE(caddr_t, [char *])
2474 AC_CHECK_MEMBERS([struct stat.st_blksize])
2478 OL_TYPE_SIG_ATOMIC_T
2480 dnl AC_TYPE_GETGROUPS
2482 OL_STRUCT_PASSWD_PW_GECOS
2483 OL_STRUCT_PASSWD_PW_PASSWD
2489 if test $cross_compiling = yes ; then
2490 AC_MSG_WARN([Crossing compiling... all bets are off!])
2491 AC_DEFINE(CROSS_COMPILING, 1, [define if cross compiling])
2496 AC_COMPILE_CHECK_SIZEOF(short)
2497 AC_COMPILE_CHECK_SIZEOF(int)
2498 AC_COMPILE_CHECK_SIZEOF(long)
2499 AC_COMPILE_CHECK_SIZEOF(wchar_t)
2501 if test "$ac_cv_sizeof_int" -lt 4 ; then
2502 AC_MSG_WARN([OpenLDAP requires 'int' to be 32 bits or greater.])
2504 AC_DEFINE(LBER_INT_T,long)
2506 AC_DEFINE(LBER_INT_T,int)
2509 AC_DEFINE(LBER_LEN_T,long)
2510 AC_DEFINE(LBER_SOCKET_T,int)
2511 AC_DEFINE(LBER_TAG_T,long)
2513 dnl ----------------------------------------------------------------
2514 dnl Checks for library functions.
2517 if test $ac_cv_func_memcmp_working = no ; then
2518 AC_DEFINE(NEED_MEMCMP_REPLACEMENT,1,
2519 [define if memcmp is not 8-bit clean or is otherwise broken])
2522 dnl AC_FUNC_MKTIME([]) dnl checks for sys/time.h and unistd.h
2524 dnl AC_FUNC_STRTOD([])
2528 dnl Check for NT specific routines
2529 AC_CHECK_FUNC(_spawnlp, AC_DEFINE(HAVE_SPAWNLP,1,[if you have spawnlp()]))
2531 AC_CHECK_FUNC(_snprintf, [ac_cv_func_snprintf=yes
2532 AC_DEFINE(snprintf, _snprintf, [define to snprintf routine])
2535 AC_CHECK_FUNC(_vsnprintf, [ac_cv_func_vsnprintf=yes
2536 AC_DEFINE(vsnprintf, _vsnprintf, [define to vsnprintf routine])
2541 if test $ac_cv_func_vprintf = yes ; then
2542 dnl check for vsnprintf
2543 AC_CHECK_FUNCS(snprintf vsnprintf)
2602 dnl We actually may need to replace more than this.
2603 AC_REPLACE_FUNCS(getopt getpeereid)
2605 if test "$ac_cv_func_getopt" != yes; then
2606 LIBSRCS="$LIBSRCS getopt.c"
2608 if test "$ac_cv_func_getpeereid" != yes; then
2609 OL_MSGHDR_MSG_ACCRIGHTS
2610 if test "$ac_cv_func_getpeereid" != yes; then
2611 OL_MSGHDR_MSG_CONTROL
2613 LIBSRCS="$LIBSRCS getpeereid.c"
2615 if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
2616 if test "$ac_cv_func_snprintf" != yes; then
2617 AC_DEFINE(snprintf, ber_pvt_snprintf, [define to snprintf routine])
2619 if test "$ac_cv_func_vsnprintf" != yes; then
2620 AC_DEFINE(vsnprintf, ber_pvt_vsnprintf, [define to snprintf routine])
2624 dnl ----------------------------------------------------------------
2625 dnl Sort out defines
2627 if test "$ol_enable_slapi" != no ; then
2628 dnl This check is done also if --enable-modules is used;
2629 dnl it is duplicated here, 'cause it'd be cached anyway
2630 AC_CHECK_HEADERS(ltdl.h)
2632 if test $ac_cv_header_ltdl_h != yes ; then
2633 AC_MSG_ERROR([could not locate <ltdl.h>])
2635 AC_CHECK_LIB(ltdl, lt_dlinit, [
2638 LIBSLAPITOOLS=../libslapi.a
2639 AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
2640 ],[AC_MSG_ERROR([could not locate libtool -lltdl])])
2642 AC_DEFINE(LDAP_SLAPI,1, [define this to add SLAPI code])
2645 if test "$ol_enable_debug" != no ; then
2646 AC_DEFINE(LDAP_DEBUG,1,
2647 [define this to add debugging code])
2649 if test "$ol_enable_syslog" = yes ; then
2650 AC_DEFINE(LDAP_SYSLOG,1,
2651 [define this to add syslog code])
2653 if test "$ol_link_kbind" != no ; then
2654 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND,LDAP_VENDOR_VERSION)
2656 if test "$ol_enable_proctitle" != no ; then
2657 AC_DEFINE(LDAP_PROCTITLE,1,
2658 [define this for LDAP process title support])
2660 if test "$ol_enable_referrals" != no ; then
2661 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS,LDAP_VENDOR_VERSION)
2663 if test "$ol_enable_local" != no; then
2664 AC_DEFINE(LDAP_PF_LOCAL,1,[define to support PF_LOCAL])
2666 if test "$ol_link_ipv6" != no; then
2667 AC_DEFINE(LDAP_PF_INET6,1,[define to support PF_INET6])
2669 if test "$ol_enable_cleartext" != no ; then
2670 AC_DEFINE(SLAPD_CLEARTEXT,1,[define to support cleartext passwords])
2672 if test "$ol_enable_crypt" != no ; then
2673 AC_DEFINE(SLAPD_CRYPT,1,[define to support crypt(3) passwords])
2675 if test "$ol_link_spasswd" != no ; then
2676 AC_DEFINE(SLAPD_SPASSWD,1,[define to support SASL passwords])
2678 if test "$ol_enable_multimaster" != no ; then
2679 AC_DEFINE(SLAPD_MULTIMASTER,1,[define to support multimaster replication])
2681 if test "$ol_enable_rlookups" != no ; then
2682 AC_DEFINE(SLAPD_RLOOKUPS,1,[define to support reverse lookups])
2684 if test "$ol_enable_aci" != no ; then
2685 AC_DEFINE(SLAPD_ACI_ENABLED,1,[define to support per-object ACIs])
2688 if test "$ol_link_modules" != no ; then
2689 AC_DEFINE(SLAPD_MODULES,1,[define to support modules])
2691 SLAPD_MODULES_LDFLAGS="-dlopen self"
2694 AC_DEFINE(SLAPD_MOD_STATIC,1,[statically linked module])
2695 AC_DEFINE(SLAPD_MOD_DYNAMIC,2,[dynamically linked module])
2697 if test "$ol_enable_bdb" != no ; then
2699 BUILD_BDB=$ol_enable_bdb
2700 if test "$ol_enable_bdb" = mod ; then
2701 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
2702 MFLAG=SLAPD_MOD_DYNAMIC
2704 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
2705 MFLAG=SLAPD_MOD_STATIC
2707 AC_DEFINE_UNQUOTED(SLAPD_BDB,$MFLAG,[define to support BDB backend])
2710 if test "$ol_enable_dnssrv" != no ; then
2712 BUILD_DNSSRV=$ol_enable_dnssrv
2713 if test "$ol_enable_dnssrv" = mod ; then
2714 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
2715 MFLAG=SLAPD_MOD_DYNAMIC
2717 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
2718 MFLAG=SLAPD_MOD_STATIC
2720 AC_DEFINE_UNQUOTED(SLAPD_DNSSRV,$MFLAG,[define to support DNS SRV backend])
2723 if test "$ol_enable_hdb" != no ; then
2725 BUILD_HDB=$ol_enable_hdb
2726 if test "$ol_enable_hdb" = mod ; then
2727 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-hdb"
2728 MFLAG=SLAPD_MOD_DYNAMIC
2730 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-hdb"
2731 MFLAG=SLAPD_MOD_STATIC
2733 AC_DEFINE_UNQUOTED(SLAPD_HDB,$MFLAG,[define to support HDB backend])
2736 if test "$ol_enable_ldap" != no ; then
2738 BUILD_LDAP=$ol_enable_ldap
2739 if test "$ol_enable_ldap" = mod ; then
2740 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
2741 MFLAG=SLAPD_MOD_DYNAMIC
2743 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
2744 MFLAG=SLAPD_MOD_STATIC
2746 AC_DEFINE_UNQUOTED(SLAPD_LDAP,$MFLAG,[define to support LDAP backend])
2749 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
2751 BUILD_LDBM=$ol_enable_ldbm
2752 if test "$ol_enable_ldbm" = mod ; then
2753 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
2754 MFLAG=SLAPD_MOD_DYNAMIC
2756 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
2757 MFLAG=SLAPD_MOD_STATIC
2759 AC_DEFINE_UNQUOTED(SLAPD_LDBM,$MFLAG,[define to support LDBM backend])
2762 if test "$ol_enable_meta" != no ; then
2764 BUILD_META=$ol_enable_meta
2766 if test "$ol_enable_meta" = mod ; then
2767 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
2768 MFLAG=SLAPD_MOD_DYNAMIC
2770 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
2771 MFLAG=SLAPD_MOD_STATIC
2773 AC_DEFINE_UNQUOTED(SLAPD_META,$MFLAG,[define to support LDAP Metadirectory backend])
2776 if test "$ol_enable_monitor" != no ; then
2778 BUILD_MONITOR=$ol_enable_monitor
2779 if test "$ol_enable_monitor" = mod ; then
2780 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
2781 MFLAG=SLAPD_MOD_DYNAMIC
2783 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
2784 MFLAG=SLAPD_MOD_STATIC
2786 AC_DEFINE_UNQUOTED(SLAPD_MONITOR,$MFLAG,[define to support cn=Monitor backend])
2789 if test "$ol_enable_null" != no ; then
2791 BUILD_NULL=$ol_enable_null
2792 if test "$ol_enable_null" = mod ; then
2793 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
2794 MFLAG=SLAPD_MOD_DYNAMIC
2796 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
2797 MFLAG=SLAPD_MOD_STATIC
2799 AC_DEFINE_UNQUOTED(SLAPD_NULL,$MFLAG,[define to support NULL backend])
2802 if test "$ol_enable_passwd" != no ; then
2804 BUILD_PASSWD=$ol_enable_passwd
2805 if test "$ol_enable_passwd" = mod ; then
2806 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
2807 MFLAG=SLAPD_MOD_DYNAMIC
2809 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
2810 MFLAG=SLAPD_MOD_STATIC
2812 AC_DEFINE_UNQUOTED(SLAPD_PASSWD,$MFLAG,[define to support PASSWD backend])
2815 if test "$ol_link_perl" != no ; then
2817 BUILD_PERL=$ol_enable_perl
2818 if test "$ol_enable_perl" = mod ; then
2819 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
2820 MFLAG=SLAPD_MOD_DYNAMIC
2822 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
2823 MFLAG=SLAPD_MOD_STATIC
2825 AC_DEFINE_UNQUOTED(SLAPD_PERL,$MFLAG,[define to support PERL backend])
2828 if test "$ol_enable_relay" != no ; then
2830 BUILD_RELAY=$ol_enable_relay
2831 if test "$ol_enable_relay" = mod ; then
2832 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-relay"
2833 MFLAG=SLAPD_MOD_DYNAMIC
2835 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-relay"
2836 MFLAG=SLAPD_MOD_STATIC
2838 AC_DEFINE_UNQUOTED(SLAPD_RELAY,$MFLAG,[define to support relay backend])
2841 if test "$ol_enable_shell" != no ; then
2842 if test "$ol_link_thread" != no ; then
2843 AC_MSG_WARN([Use of --without-threads is recommended with back-shell])
2846 BUILD_SHELL=$ol_enable_shell
2847 if test "$ol_enable_shell" = mod ; then
2848 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
2849 MFLAG=SLAPD_MOD_DYNAMIC
2851 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
2852 MFLAG=SLAPD_MOD_STATIC
2854 AC_DEFINE_UNQUOTED(SLAPD_SHELL,$MFLAG,[define to support SHELL backend])
2857 if test "$ol_link_sql" != no ; then
2859 BUILD_SQL=$ol_enable_sql
2860 if test "$ol_enable_sql" = mod; then
2861 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
2862 MFLAG=SLAPD_MOD_DYNAMIC
2864 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
2865 MFLAG=SLAPD_MOD_STATIC
2867 AC_DEFINE_UNQUOTED(SLAPD_SQL,$MFLAG,[define to support SQL backend])
2870 if test "$ol_enable_accesslog" != no ; then
2871 BUILD_ACCESSLOG=$ol_enable_accesslog
2872 if test "$ol_enable_accesslog" = mod ; then
2873 MFLAG=SLAPD_MOD_DYNAMIC
2874 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS accesslog.la"
2876 MFLAG=SLAPD_MOD_STATIC
2877 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS accesslog.o"
2879 AC_DEFINE_UNQUOTED(SLAPD_OVER_ACCESSLOG,$MFLAG,[define for In-Directory Access Logging overlay])
2882 if test "$ol_enable_denyop" != no ; then
2883 BUILD_DENYOP=$ol_enable_denyop
2884 if test "$ol_enable_denyop" = mod ; then
2885 MFLAG=SLAPD_MOD_DYNAMIC
2886 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS denyop.la"
2888 MFLAG=SLAPD_MOD_STATIC
2889 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS denyop.o"
2891 AC_DEFINE_UNQUOTED(SLAPD_OVER_DENYOP,$MFLAG,[define for Dynamic Group overlay])
2894 if test "$ol_enable_dyngroup" != no ; then
2895 BUILD_DYNGROUP=$ol_enable_dyngroup
2896 if test "$ol_enable_dyngroup" = mod ; then
2897 MFLAG=SLAPD_MOD_DYNAMIC
2898 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dyngroup.la"
2900 MFLAG=SLAPD_MOD_STATIC
2901 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dyngroup.o"
2903 AC_DEFINE_UNQUOTED(SLAPD_OVER_DYNGROUP,$MFLAG,[define for Dynamic Group overlay])
2906 if test "$ol_enable_dynlist" != no ; then
2907 BUILD_DYNLIST=$ol_enable_dynlist
2908 if test "$ol_enable_dynlist" = mod ; then
2909 MFLAG=SLAPD_MOD_DYNAMIC
2910 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dynlist.la"
2912 MFLAG=SLAPD_MOD_STATIC
2913 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dynlist.o"
2915 AC_DEFINE_UNQUOTED(SLAPD_OVER_DYNLIST,$MFLAG,[define for Dynamic List overlay])
2918 if test "$ol_enable_glue" != no ; then
2919 BUILD_GLUE=$ol_enable_glue
2920 if test "$ol_enable_glue" = mod ; then
2921 MFLAG=SLAPD_MOD_DYNAMIC
2922 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS glue.la"
2924 MFLAG=SLAPD_MOD_STATIC
2925 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS glue.o"
2927 AC_DEFINE_UNQUOTED(SLAPD_OVER_GLUE,$MFLAG,[define for Backend Glue overlay])
2930 if test "$ol_enable_lastmod" != no ; then
2931 BUILD_LASTMOD=$ol_enable_lastmod
2932 if test "$ol_enable_lastmod" = mod ; then
2933 MFLAG=SLAPD_MOD_DYNAMIC
2934 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS lastmod.la"
2936 MFLAG=SLAPD_MOD_STATIC
2937 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS lastmod.o"
2939 AC_DEFINE_UNQUOTED(SLAPD_OVER_LASTMOD,$MFLAG,[define for Last Modification overlay])
2942 if test "$ol_enable_ppolicy" != no ; then
2943 BUILD_PPOLICY=$ol_enable_ppolicy
2944 if test "$ol_enable_ppolicy" = mod ; then
2945 MFLAG=SLAPD_MOD_DYNAMIC
2946 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS ppolicy.la"
2948 MFLAG=SLAPD_MOD_STATIC
2949 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS ppolicy.o"
2951 AC_DEFINE_UNQUOTED(SLAPD_OVER_PPOLICY,$MFLAG,[define for Password Policy overlay])
2954 if test "$ol_enable_proxycache" != no ; then
2955 BUILD_PROXYCACHE=$ol_enable_proxycache
2956 if test "$ol_enable_proxycache" = mod ; then
2957 MFLAG=SLAPD_MOD_DYNAMIC
2958 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS pcache.la"
2960 MFLAG=SLAPD_MOD_STATIC
2961 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS pcache.o"
2963 AC_DEFINE_UNQUOTED(SLAPD_OVER_PROXYCACHE,$MFLAG,[define for Proxy Cache overlay])
2966 if test "$ol_enable_refint" != no ; then
2967 BUILD_REFINT=$ol_enable_refint
2968 if test "$ol_enable_refint" = mod ; then
2969 MFLAG=SLAPD_MOD_DYNAMIC
2970 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS refint.la"
2972 MFLAG=SLAPD_MOD_STATIC
2973 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS refint.o"
2975 AC_DEFINE_UNQUOTED(SLAPD_OVER_REFINT,$MFLAG,[define for Referential Integrity overlay])
2978 if test "$ol_enable_retcode" != no ; then
2979 BUILD_RETCODE=$ol_enable_retcode
2980 if test "$ol_enable_retcode" = mod ; then
2981 MFLAG=SLAPD_MOD_DYNAMIC
2982 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS retcode.la"
2984 MFLAG=SLAPD_MOD_STATIC
2985 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS retcode.o"
2987 AC_DEFINE_UNQUOTED(SLAPD_OVER_RETCODE,$MFLAG,[define for Referential Integrity overlay])
2990 if test "$ol_enable_rwm" != no ; then
2992 BUILD_RWM=$ol_enable_rwm
2993 if test "$ol_enable_rwm" = mod ; then
2994 MFLAG=SLAPD_MOD_DYNAMIC
2995 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS rwm.la"
2997 MFLAG=SLAPD_MOD_STATIC
2998 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS rwm_x.o"
3000 AC_DEFINE_UNQUOTED(SLAPD_OVER_RWM,$MFLAG,[define for Rewrite/Remap overlay])
3003 if test "$ol_enable_syncprov" != no ; then
3004 BUILD_SYNCPROV=$ol_enable_syncprov
3005 if test "$ol_enable_syncprov" = mod ; then
3006 MFLAG=SLAPD_MOD_DYNAMIC
3007 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS syncprov.la"
3009 MFLAG=SLAPD_MOD_STATIC
3010 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS syncprov.o"
3012 AC_DEFINE_UNQUOTED(SLAPD_OVER_SYNCPROV,$MFLAG,[define for Syncrepl Provider overlay])
3015 if test "$ol_enable_translucent" != no ; then
3016 BUILD_TRANSLUCENT=$ol_enable_translucent
3017 if test "$ol_enable_translucent" = mod ; then
3018 MFLAG=SLAPD_MOD_DYNAMIC
3019 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS translucent.la"
3021 MFLAG=SLAPD_MOD_STATIC
3022 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS translucent.o"
3024 AC_DEFINE_UNQUOTED(SLAPD_OVER_TRANSLUCENT,$MFLAG,[define for Translucent Proxy overlay])
3027 if test "$ol_enable_unique" != no ; then
3028 BUILD_UNIQUE=$ol_enable_unique
3029 if test "$ol_enable_unique" = mod ; then
3030 MFLAG=SLAPD_MOD_DYNAMIC
3031 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS unique.la"
3033 MFLAG=SLAPD_MOD_STATIC
3034 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS unique.o"
3036 AC_DEFINE_UNQUOTED(SLAPD_OVER_UNIQUE,$MFLAG,[define for Attribute Uniqueness overlay])
3039 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
3040 $BUILD_SLAPD = yes ; then
3044 if test "$ol_enable_rewrite" != no ; then
3045 AC_DEFINE(ENABLE_REWRITE,1,[define to enable rewriting in back-ldap and back-meta])
3049 if test "$ol_enable_slapi" != no ; then
3050 AC_DEFINE(ENABLE_SLAPI,1,[define to enable slapi library])
3052 SLAPD_SLAPI_DEPEND=libslapi.a
3055 dnl ----------------------------------------------------------------
3058 dnl For Windows build, we don't want to include -dlopen flags.
3059 dnl They hurt more than they help.
3062 if test "$ac_cv_mingw32" = yes ; then
3064 SLAPD_MODULES_LDFLAGS=
3073 AC_SUBST(WITH_MODULES_ENABLED)
3074 AC_SUBST(BUILD_LIBS_DYNAMIC)
3076 AC_SUBST(BUILD_SLAPD)
3078 AC_SUBST(BUILD_SLAPI)
3079 AC_SUBST(SLAPD_SLAPI_DEPEND)
3082 AC_SUBST(BUILD_DNSSRV)
3084 AC_SUBST(BUILD_LDAP)
3085 AC_SUBST(BUILD_LDBM)
3086 AC_SUBST(BUILD_META)
3087 AC_SUBST(BUILD_MONITOR)
3088 AC_SUBST(BUILD_NULL)
3089 AC_SUBST(BUILD_PASSWD)
3090 AC_SUBST(BUILD_RELAY)
3091 AC_SUBST(BUILD_PERL)
3092 AC_SUBST(BUILD_SHELL)
3095 AC_SUBST(BUILD_ACCESSLOG)
3096 AC_SUBST(BUILD_DENYOP)
3097 AC_SUBST(BUILD_DYNGROUP)
3098 AC_SUBST(BUILD_DYNLIST)
3099 AC_SUBST(BUILD_GLUE)
3100 AC_SUBST(BUILD_LASTMOD)
3101 AC_SUBST(BUILD_PPOLICY)
3102 AC_SUBST(BUILD_PROXYCACHE)
3103 AC_SUBST(BUILD_REFINT)
3104 AC_SUBST(BUILD_RETCODE)
3106 AC_SUBST(BUILD_SYNCPROV)
3107 AC_SUBST(BUILD_TRANSLUCENT)
3108 AC_SUBST(BUILD_UNIQUE)
3109 AC_SUBST(BUILD_SLURPD)
3112 AC_SUBST(SLAPD_LIBS)
3113 AC_SUBST(SLURPD_LIBS)
3115 AC_SUBST(LTHREAD_LIBS)
3116 AC_SUBST(LUTIL_LIBS)
3119 AC_SUBST(SLAPD_MODULES_CPPFLAGS)
3120 AC_SUBST(SLAPD_MODULES_LDFLAGS)
3122 AC_SUBST(SLAPD_NO_STATIC)
3123 AC_SUBST(SLAPD_STATIC_BACKENDS)
3124 AC_SUBST(SLAPD_DYNAMIC_BACKENDS)
3125 AC_SUBST(SLAPD_STATIC_OVERLAYS)
3126 AC_SUBST(SLAPD_DYNAMIC_OVERLAYS)
3128 AC_SUBST(PERL_CPPFLAGS)
3129 AC_SUBST(SLAPD_PERL_LDFLAGS)
3130 AC_SUBST(MOD_PERL_LDFLAGS)
3136 AC_SUBST(MODULES_LIBS)
3137 AC_SUBST(SLAPI_LIBS)
3139 AC_SUBST(LIBSLAPITOOLS)
3142 AC_SUBST(SLAPD_SLP_LIBS)
3143 AC_SUBST(SLAPD_GMP_LIBS)
3145 AC_SUBST(SLAPD_SQL_LDFLAGS)
3146 AC_SUBST(SLAPD_SQL_LIBS)
3147 AC_SUBST(SLAPD_SQL_INCLUDES)
3149 dnl ----------------------------------------------------------------
3150 dnl final help output
3151 AC_ARG_WITH(xxinstall,[
3152 See INSTALL file for further details.])
3154 dnl ----------------------------------------------------------------
3159 Makefile:build/top.mk:Makefile.in:build/dir.mk \
3160 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
3161 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
3162 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
3163 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
3164 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
3165 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
3166 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
3167 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
3168 include/Makefile:build/top.mk:include/Makefile.in \
3169 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk \
3170 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk \
3171 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk \
3172 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk \
3173 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk \
3174 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk \
3175 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-shared.mk \
3176 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
3177 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
3178 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
3179 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
3180 servers/slapd/back-hdb/Makefile:build/top.mk:servers/slapd/back-hdb/Makefile.in:build/mod.mk \
3181 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
3182 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
3183 servers/slapd/back-ldif/Makefile:build/top.mk:servers/slapd/back-ldif/Makefile.in:build/mod.mk \
3184 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
3185 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
3186 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
3187 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
3188 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
3189 servers/slapd/back-relay/Makefile:build/top.mk:servers/slapd/back-relay/Makefile.in:build/mod.mk \
3190 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
3191 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
3192 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
3193 servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk \
3194 servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.mk \
3195 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
3196 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
3198 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
3200 AC_CONFIG_COMMANDS([default],[[
3203 BACKENDSC="servers/slapd/backends.c"
3204 echo "Making $BACKENDSC"
3206 cat > $BACKENDSC << ENDX
3207 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3209 * Copyright 1998-2005 The OpenLDAP Foundation.
3210 * All rights reserved.
3212 * Redistribution and use in source and binary forms, with or without
3213 * modification, are permitted only as authorized by the OpenLDAP
3216 * A copy of this license is available in the file LICENSE in the
3217 * top-level directory of the distribution or, alternatively, at
3218 * <http://www.OpenLDAP.org/license.html>.
3220 /* This file is automatically generated by configure; please do not edit. */
3222 #include "portable.h"
3226 if test "${STATIC_BACKENDS}"; then
3227 for b in config ${STATIC_BACKENDS}; do
3228 bb=`echo "${b}" | sed -e 's/back-//'`
3229 cat >> $BACKENDSC << ENDX
3230 extern BI_init ${bb}_back_initialize;
3234 cat >> $BACKENDSC << ENDX
3236 BackendInfo slap_binfo[] = {
3239 for b in config ${STATIC_BACKENDS}; do
3240 bb=`echo "${b}" | sed -e 's/back-//'`
3241 echo " Add ${bb} ..."
3242 cat >> $BACKENDSC << ENDX
3243 { "${bb}", ${bb}_back_initialize },
3247 cat >> $BACKENDSC << ENDX
3251 /* end of generated file */
3255 echo Please run \"make depend\" to build dependencies
3256 ]],[[STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"]])