2 dnl Copyright 1998,1999 The OpenLDAP Foundation. All Rights Reserved.
4 dnl Redistribution and use in source and binary forms are permitted only
5 dnl as authorized by the OpenLDAP Public License. A copy of this
6 dnl license is available at http://www.OpenLDAP.org/license.html or
7 dnl in file LICENSE in the top-level directory of the distribution.
10 dnl Configure.in for OpenLDAP
11 AC_INIT(include/ldap.h)dnl
12 AC_CONFIG_AUX_DIR(build)dnl
13 AM_INIT_AUTOMAKE(OpenLDAP,[2.0-devel], [no ac_define])dnl
15 dnl We use autoconf features new to 2.13.
16 dnl aclocal.m4 should be built using aclocal from automake 1.4
17 AC_PREREQ(2.13)dnl Required Autoconf version
19 AC_CONFIG_HEADER(include/portable.h include/ldap_features.h)dnl
23 AC_MSG_CHECKING(configure arguments)
24 AC_PREFIX_DEFAULT(/usr/local)
27 AC_SUBST(top_builddir)dnl
29 ldap_subdir="openldap"
31 AC_ARG_WITH(subdir, [ --with-subdir=DIR change default subdirectory used for installs], [
32 if test "$withval" = "no"; then
34 elif test "$withval" != "yes"; then
35 ldap_subdir="$withval"
39 AC_SUBST(ldap_subdir)dnl
41 OL_ARG_ENABLE(debug,[ --enable-debug enable debugging], yes)dnl
42 dnl ol_enable_syslog=no
43 OL_ARG_ENABLE(syslog,[ --enable-syslog enable syslog support], auto)dnl
44 OL_ARG_ENABLE(proctitle,[ --enable-proctitle enable proctitle support], yes)dnl
45 OL_ARG_ENABLE(cache,[ --enable-cache enable caching], yes)dnl
46 OL_ARG_ENABLE(dns,[ --enable-dns enable V2 DNS extension], no)dnl
47 OL_ARG_ENABLE(referrals,[ --enable-referrals enable V2 Referrals extension], yes)dnl
48 OL_ARG_ENABLE(cldap,[ --enable-cldap enable connectionless ldap], no)dnl
49 OL_ARG_ENABLE(x_compile,[ --enable-x-compile enable cross compiling],
52 dnl General "with" options
53 OL_ARG_ENABLE(dmalloc,[ --enable-dmalloc enable debug malloc support], no)dnl
55 OL_ARG_WITH(kerberos,[ --with-kerberos with Kerberos support],
56 auto, [auto k5 k4 afs yes no])
57 OL_ARG_WITH(readline,[ --with-readline with readline support],
59 OL_ARG_WITH(threads,[ --with-threads use threads],
60 auto, [auto posix mach lwp yes no manual] )
61 OL_ARG_WITH(tls,[ --with-tls with TLS/SSL support],
62 auto, [auto ssleay openssl yes no] )
63 OL_ARG_WITH(yielding_select,[ --with-yielding-select with implicitly yielding select],
64 auto, [auto yes no manual] )
69 AC_ARG_WITH(xxldapdoptions,[LDAPD Options:])
70 OL_ARG_ENABLE(ldapd,[ --enable-ldapd enable building ldapd], no)dnl
73 AC_ARG_WITH(xxslapdoptions,[SLAPD Options:])
74 OL_ARG_ENABLE(slapd,[ --enable-slapd enable building slapd], yes)dnl
75 OL_ARG_ENABLE(aclgroups,[ --enable-aclgroups enable ACL group support], auto)dnl
76 OL_ARG_ENABLE(cleartext,[ --enable-cleartext enable cleartext passwords], yes)dnl
77 OL_ARG_ENABLE(crypt,[ --enable-crypt enable crypt(3) passwords], auto)dnl
78 OL_ARG_ENABLE(modules,[ --enable-modules enable dynamic module support], no)dnl
79 OL_ARG_ENABLE(phonetic,[ --enable-phonetic enable phonetic/soundex], no)dnl
80 OL_ARG_ENABLE(rlookups,[ --enable-rlookups enable reverse lookups], auto)dnl
81 OL_ARG_ENABLE(wrappers,[ --enable-wrappers enable tcp wrapper support], no)dnl
83 dnl SLAPD Backend options
84 OL_ARG_ENABLE(bdb2,[ --enable-bdb2 enable bdb2 backend], no)dnl
85 OL_ARG_ENABLE(ldbm,[ --enable-ldbm enable ldbm backend], yes)dnl
86 OL_ARG_WITH(ldbm_api,[ --with-ldbm-api use LDBM API], auto,
87 [auto db2 db mdbm gdbm ndbm manual])
88 OL_ARG_WITH(ldbm_type,[ --with-ldbm-type use LDBM type], auto,
91 OL_ARG_ENABLE(passwd,[ --enable-passwd enable passwd backend], no)dnl
92 OL_ARG_ENABLE(perl,[ --enable-perl enable perl backend], no)dnl
93 OL_ARG_ENABLE(shell,[ --enable-shell enable shell backend], no)dnl
94 OL_ARG_ENABLE(tcl,[ --enable-tcl enable tcl backend], no)dnl
97 AC_ARG_WITH(xxslurpdoptions,[SLURPD Options:])
98 OL_ARG_ENABLE(slurpd,[ --enable-slurpd enable building slurpd], auto)dnl
100 AC_ARG_WITH(xxliboptions,[Library Generation & Linking Options])
102 dnl AM_DISABLE_SHARED
105 dnl General "enable" options
107 if test $ol_enable_dns = yes ; then
108 if test $ol_enable_referrals = no ; then
109 AC_MSG_ERROR([DNS requires --enable-referrals])
111 if test $ol_enable_referrals = auto ; then
112 AC_MSG_WARN([DNS requires referrals, adding --enable-referrals])
113 ol_enable_referrals=yes
117 if test $ol_enable_slapd = no ; then
118 dnl SLAPD was specificallly disabled
119 if test $ol_enable_bdb2 = yes ; then
120 AC_MSG_WARN([slapd disabled, ignoring --enable_bdb2 argument])
122 if test $ol_enable_ldbm = yes ; then
123 AC_MSG_WARN([slapd disabled, ignoring --enable_ldbm argument])
125 if test $ol_enable_passwd = yes ; then
126 AC_MSG_WARN([slapd disabled, ignoring --enable_passwd argument])
128 if test $ol_enable_perl = yes ; then
129 AC_MSG_WARN([slapd disabled, ignoring --enable_perl argument])
131 if test $ol_enable_shell = yes ; then
132 AC_MSG_WARN([slapd disabled, ignoring --enable_shell argument])
134 if test $ol_enable_tcl = yes ; then
135 AC_MSG_WARN([slapd disabled, ignoring --enable_tcl argument])
137 if test $ol_enable_aclgroups = yes ; then
138 AC_MSG_WARN([slapd disabled, ignoring --enable_aclgroups argument])
140 if test $ol_enable_modules = yes ; then
141 AC_MSG_WARN([slapd disabled, ignoring --enable_modules argument])
143 if test $ol_enable_wrappers = yes ; then
144 AC_MSG_WARN([slapd disabled, ignoring --enable_wrappers argument])
146 if test $ol_enable_phonetic = yes ; then
147 AC_MSG_WARN([slapd disabled, ignoring --enable_phonetic argument])
149 if test $ol_enable_rlookups = yes ; then
150 AC_MSG_WARN([slapd disabled, ignoring --enable_rlookups argument])
152 if test $ol_with_ldbm_api != auto ; then
153 AC_MSG_WARN([slapd disabled, ignoring --with_ldbm_api argument])
155 if test $ol_with_ldbm_type != auto ; then
156 AC_MSG_WARN([slapd disabled, ignoring --with_ldbm_type argument])
158 if test $ol_enable_slurpd = yes ; then
159 AC_MSG_ERROR([slurpd requires slapd])
162 # force settings to no
170 ol_enable_aclgroups=no
172 ol_enable_phonetic=no
173 ol_enable_rlookups=no
174 ol_enable_wrappers=no
181 elif test $ol_enable_ldbm = no ; then
182 dnl SLAPD without LDBM
184 if test $ol_with_ldbm_api != auto ; then
185 AC_MSG_WARN([LDBM disabled, ignoring --with_ldbm_api argument])
188 if test $ol_with_ldbm_type != auto ; then
189 AC_MSG_WARN([LDBM disabled, ignoring --with_ldbm_type argument])
192 if test $ol_enable_bdb2 = yes ; then
193 AC_MSG_ERROR([BDB2 requires --enable-ldbm])
196 if test $ol_enable_modules != yes -a \
197 $ol_enable_passwd = no -a \
198 $ol_enable_perl = no -a \
199 $ol_enable_shell = no -a \
200 $ol_enable_tcl = no ; then
201 AC_MSG_ERROR([slapd requires a backend])
207 elif test $ol_enable_bdb2 = yes ; then
210 if test $ol_with_ldbm_api != auto -a \
211 $ol_with_ldbm_api != db2 ; then
212 AC_MSG_ERROR([BDB2 requires LDBM API DB2])
220 if test $ol_enable_bdb2 != no ; then
221 if test $ol_with_ldbm_api != auto -a \
222 $ol_with_ldbm_api != db2 ; then
223 AC_MSG_WARN([BDB2 requires LDBM api db2 or auto])
228 if test $ol_with_ldbm_api = gdbm -a \
229 $ol_with_ldbm_type = btree ; then
230 AC_MSG_ERROR([GDBM only supports LDBM type hash])
232 if test $ol_with_ldbm_api = mdbm -a \
233 $ol_with_ldbm_type = btree ; then
234 AC_MSG_ERROR([MDBM only supports LDBM type hash])
236 if test $ol_with_ldbm_api = ndbm -a \
237 $ol_with_ldbm_type = btree ; then
238 AC_MSG_ERROR([NDBM only supports LDBM type hash])
242 if test $ol_enable_slurpd = yes ; then
243 dnl SLURPD was specifically enabled
244 if test $ol_with_threads = no ; then
245 AC_MSG_ERROR([slurpd requires threads])
273 SLAPD_MODULES_LDFLAGS=
274 SLAPD_MODULES_CPPFLAGS=
284 dnl ----------------------------------------------------------------
285 dnl Checks for programs
289 dnl The default compiler is cc (NOT gcc)
291 dnl The default CFLAGS is empty NOT whatever AC_PROG_CC sets.
292 dnl CFLAGS=${CFLAGS-""}
301 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
305 AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail,
306 $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc)
307 AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi, $PATH:/usr/ucb)
308 AC_PATH_PROG(FINGER, finger, /usr/ucb/finger, $PATH:/usr/ucb)
311 if test $ol_enable_modules != no ; then
312 AC_PATH_PROG(GLIBCONFIG, glib-config)
314 if test "no$GLIBCONFIG" = "no" ; then
315 if test $ol_enable_modules = yes ; then
316 AC_MSG_ERROR([could not locate glib-config])
320 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
321 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
322 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
324 dnl should check glib version
330 if test $ol_enable_perl != no ; then
331 AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl)
333 if test "no$PERLBIN" = "no" ; then
334 if test $ol_enable_perl = yes ; then
335 AC_MSG_ERROR([could not locate perl])
339 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
340 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
342 dnl should check perl version
349 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
350 AC_MSG_WARN([cross compiling.... some functionality will be removed.])
352 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
353 AC_MSG_WARN([programs compiled here do run here...])
354 AC_MSG_ERROR([ if not cross compiling, use --disable-x-compile.])
356 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
357 AC_MSG_WARN([programs compiled here do not run here...])
358 AC_MSG_ERROR([ if cross compiling, add --enable-x-compile.])
361 dnl Checks for UNIX Variants
366 dnl BeOS requires -lbe -lroot
367 AC_CHECK_LIB(be, be_app, [LIBS="$LIBS -lbe -lroot"], :, [-lroot])
369 dnl Checks for system services
375 dnl OpenLDAP requires STDC features
377 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
378 AC_MSG_ERROR([OpenLDAP requires compiler to support STDC prototypes.])
383 dnl Checks for libraries
386 dnl Likely combinations:
387 dnl -lsocket [ -lnsl_s | -lnsl ]
390 AC_CHECK_FUNC(socket, :, [
392 dnl hopefully we won't include too many libraries
394 AC_CHECK_LIB(socket, main)
395 AC_CHECK_LIB(net, main)
396 AC_CHECK_LIB(nsl_s, main)
397 AC_CHECK_LIB(nsl, main)
398 AC_CHECK_LIB(inet, socket)
399 AC_CHECK_LIB(gen, main)
402 dnl Check for resolver routines
403 AC_CHECK_FUNCS(res_search)
404 if test $ac_cv_func_res_search = "no" ; then
405 AC_CHECK_LIB(bind, res_search)
406 if test "$ac_cv_lib_bind_res_search" = "yes" ; then
407 AC_DEFINE(HAVE_RES_SEARCH,1)
409 AC_CHECK_LIB(resolv, res_search)
410 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
411 AC_DEFINE(HAVE_RES_SEARCH,1)
416 dnl HP-UX requires -lV3
417 AC_CHECK_LIB(V3, sigset)
419 AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
422 dnl (if this detection becomes permenent, it and the select() detection
423 dnl should be done before the yielding select test)
424 AC_FUNC_SELECT_ARGTYPES
428 if test $ol_enable_ldapd != no ; then
429 dnl look for ISODE libraries
430 AC_CHECK_LIB(xtpp, main, [
432 AC_DEFINE(HAVE_XTPP,1, [define if you have -lxttp])
433 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
434 ],:,[-lxtdsap -lxtisode -losi])
435 AC_CHECK_LIB(dsap, main, [
437 AC_DEFINE(HAVE_DSAP,1, [define if you have -ldsap])
438 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
440 AC_CHECK_LIB(isode, main, [
442 AC_DEFINE(HAVE_ISODE,1, [define if you have -lisode])
443 LDAPD_LIBS="$LDAPD_LIBS -lisode"
447 if test $ol_link_isode != no; then
448 AC_CHECK_LIB(pp, main, [
449 AC_DEFINE(HAVE_PP,1, [define if you have -lpp])
450 LDAPD_LIBS="-lpp $LDAPD_LIBS"
453 AC_PATH_PROG(PEPSY, pepsy)
457 dnl check for kerberos
461 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
462 AC_CHECK_HEADERS(kerberosIV/krb.h kerberosIV/des.h)
464 if test $ac_cv_header_kerberosIV_krb_h = yes ; then
465 AC_CHECK_LIB(krb4, main, [have_k5=yes], [have_k5=no],
468 if test $have_k5 = yes ; then
469 ol_with_kerberos=found
472 KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
474 LIBS="$KRB_LIBS $LIBS"
476 AC_CACHE_CHECK([for des_debug in Kerberos libraries],
477 [ol_cv_var_des_debug], [
480 LIBS="$KRB_LIBS $LIBS"
482 #include <kerberosIV/krb.h>
483 #include <kerberosIV/des.h>
484 extern int des_debug;
487 ], ol_cv_var_des_debug=yes, ol_cv_var_des_debug=no)
492 if test $ol_cv_var_des_debug = yes ; then
493 AC_DEFINE(HAVE_DES_DEBUG,1,
494 [define if you have Kerberos des_debug])
502 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
503 AC_CHECK_HEADERS(krb.h des.h)
505 if test $ac_cv_header_krb_h = yes ; then
506 AC_CHECK_LIB(krb, main, [have_k4=yes], [have_k4=no], [-ldes])
508 if test $have_k4 = yes ; then
509 ol_with_kerberos=found
512 KRB_LIBS="-lkrb -ldes"
517 if test $ol_link_kerberos = yes ; then
518 AC_DEFINE(HAVE_KERBEROS, 1, [define if you have Kerberos])
522 dnl Check for SSL/TLS
525 if test $ol_with_tls != no ; then
527 AC_CHECK_HEADERS(ssl.h)
529 if test $ac_cv_header_ssl_h = yes ; then
530 AC_CHECK_LIB(ssl, SSLeay_add_ssl_algorithms,
536 if test $have_ssleay = no ; then
537 AC_CHECK_LIB(ssl, ssl3_accept,
539 need_rsaref=yes], [have_ssleay=no],
540 [-lcrypto -lRSAglue -lrsaref])
543 if test $have_ssleay = yes ; then
547 AC_DEFINE(HAVE_SSLEAY, 1,
548 [define if you have SSLeay or OpenSSL])
550 if test $need_rsaref = yes; then
551 AC_DEFINE(HAVE_RSAREF, 1,
552 [define if you have RSAref])
554 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
556 TLS_LIBS="-lssl -lcrypto"
562 if test $ol_link_tls = yes ; then
563 AC_DEFINE(HAVE_TLS, 1, [define if you have TLS])
566 dnl Tests for reentrant functions necessary to build a
567 dnl thread_safe -lldap.
570 gethostbyname_r gethostbyaddr_r \
573 if test "$ac_cv_func_ctime_r" = no ; then
574 ol_cv_func_ctime_r_nargs=0
576 OL_FUNC_CTIME_R_NARGS
577 dnl OL_FUNC_CTIME_R_TYPE
580 if test "$ac_cv_func_gethostbyname_r" = yes ; then
581 OL_FUNC_GETHOSTBYNAME_R_NARGS
583 ol_cv_func_gethostbyname_r_nargs=0
586 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
587 OL_FUNC_GETHOSTBYADDR_R_NARGS
589 ol_cv_func_gethostbyaddr_r_nargs=0
592 if test "$ac_cv_func_ctime_r" = yes \
593 -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
594 -a "$ol_cv_func_ctime_r_nargs" -le 3 \
595 -a "$ac_cv_func_gethostbyname_r" = yes \
596 -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
597 -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
598 -a "$ac_cv_func_gethostbyaddr_r" = yes \
599 -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
600 -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
603 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_REENTRANT,1)
607 if test $ol_with_threads = auto -o $ol_with_threads = yes \
608 -o $ol_with_threads = posix ; then
610 AC_CHECK_HEADERS(pthread.h sched.h)
612 if test $ac_cv_header_pthread_h = yes ; then
613 OL_POSIX_THREAD_VERSION
615 if test $ol_cv_pthread_version = final ; then
616 AC_DEFINE(HAVE_PTHREADS_FINAL,1,
617 [define if pthreads API compatible with final spec])
618 elif test $ol_cv_pthread_version = draft4 ; then
619 AC_DEFINE(HAVE_PTHREADS_D4,1,
620 [define if pthreads API compatible with draft4 spec])
622 AC_MSG_ERROR([unknown pthread version])
625 # consider threads found
626 ol_with_threads=found
628 OL_HEADER_LINUX_THREADS
630 dnl Now the hard part, how to link?
632 dnl currently supported checks:
634 dnl Check for no flags
635 dnl pthread_create() in $LIBS
637 dnl Check special pthread (final) flags
638 dnl pthread_create() with -mt (Solaris)
639 dnl pthread_create() with -kthread (FreeBSD)
640 dnl pthread_create() with -pthread (FreeBSD/Digital Unix)
641 dnl pthread_create() with -pthreads (?)
642 dnl pthread_create() with -thread (?)
644 dnl Check pthread (final) libraries
645 dnl pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1)
646 dnl pthread_mutex_lock() in -lpthread -lmach -lexc (OSF/1)
647 dnl (skipped) pthread_mutex_trylock() in -lpthread -lexc (OSF/1)
648 dnl pthread_join() -Wl,-woff,85 -lpthread (IRIX)
649 dnl pthread_create() in -lpthread (many)
650 dnl pthread_create() in -lc_r (FreeBSD)
652 dnl Check pthread (draft4) flags (depreciated)
653 dnl pthread_create() with -threads (OSF/1)
655 dnl Check pthread (draft4) libraries (depreciated)
656 dnl pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
657 dnl pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
658 dnl pthread_mutex_trylock() in -lpthreads -lexc (OSF/1)
659 dnl pthread_create() in -lpthreads (many)
662 dnl pthread_create in $LIBS
663 AC_MSG_CHECKING([for pthread_create in default libraries])
664 AC_CACHE_VAL(ol_cv_pthread_create,[
668 #define NULL (void*)0
674 return (void *) (p == NULL);
684 /* make sure pthread_create() isn't just a stub */
686 status = pthread_create(&t, pthread_attr_default, task, NULL);
688 status = pthread_create(&t, NULL, task, NULL);
691 if( status ) return status;
693 /* make sure pthread_detach() isn't just a stub */
695 status = pthread_detach( &t );
697 status = pthread_detach( t );
700 if( status ) return status;
705 [ol_cv_pthread_create=yes],
706 [ol_cv_pthread_create=no],
708 ol_cv_pthread_create=yes])])
709 AC_MSG_RESULT($ol_cv_pthread_create)
711 if test $ol_cv_pthread_create != no ; then
712 ol_link_threads=posix
716 OL_PTHREAD_TRY_LINK([-mt], [ol_cv_pthread_mt])
717 OL_PTHREAD_TRY_LINK([-kthread], [ol_cv_pthread_kthread])
718 OL_PTHREAD_TRY_LINK([-pthread], [ol_cv_pthread_pthread])
719 OL_PTHREAD_TRY_LINK([-pthreads],[ol_cv_pthread_pthreads])
720 OL_PTHREAD_TRY_LINK([-thread], [ol_cv_pthread_thread])
722 OL_PTHREAD_TRY_LINK([-lpthread -lmach -lexc -lc_r],
723 [ol_cv_pthread_lpthread_lmach_lexc_lc_r])
724 OL_PTHREAD_TRY_LINK([-lpthread -lmach -lexc],
725 [ol_cv_pthread_lpthread_lmach_lexc])
726 dnl OL_PTHREAD_TRY_LINK([-lpthread -lexc],
727 dnl [ol_cv_pthread_lpthread_lexc])
729 OL_PTHREAD_TRY_LINK([-lpthread -Wl,-woff,85],
730 [ol_cv_pthread_lib_lpthread_woff])
732 OL_PTHREAD_TRY_LINK([-lpthread],[ol_cv_pthread_lpthread])
733 OL_PTHREAD_TRY_LINK([-lc_r], [ol_cv_pthread_lc_r])
735 OL_PTHREAD_TRY_LINK([-threads], [ol_cv_pthread_threads])
737 OL_PTHREAD_TRY_LINK([-lpthreads -lmach -lexc -lc_r],
738 [ol_cv_pthread_lpthreads_lmach_lexc_lc_r])
739 OL_PTHREAD_TRY_LINK([-lpthreads -lmach -lexc],
740 [ol_cv_pthread_lpthreads_lmach_lexc])
741 OL_PTHREAD_TRY_LINK([-lpthreads -lexc],
742 [ol_cv_pthread_lpthreads_lexc])
744 OL_PTHREAD_TRY_LINK([-lpthreads], [ol_cv_pthread_lib_lpthreads])
746 if test $ol_link_threads != no ; then
747 AC_DEFINE(HAVE_PTHREADS,1,
748 [define if you have POSIX Threads])
750 LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
753 save_CPPFLAGS="$CPPFLAGS"
755 LIBS="$LTHREAD_LIBS $LIBS"
757 dnl All POSIX Thread (final) implementations should have
758 dnl sched_yield instead of pthread yield.
760 AC_CHECK_FUNCS(sched_yield pthread_yield)
762 if test $ac_cv_func_sched_yield = no -a \
763 $ac_cv_func_pthread_yield = no ; then
764 dnl Digital UNIX has sched_yield() in -lrt
765 AC_CHECK_LIB(rt, sched_yield,
766 [LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
767 AC_DEFINE(HAVE_SCHED_YIELD,1)
768 ac_cv_func_sched_yield=yes],
769 [ac_cv_func_sched_yield=no])
771 if test $ac_cv_func_sched_yield = no -a \
772 $ac_cv_func_pthread_yield = no ; then
773 dnl Solaris has sched_yield() in -lposix4
774 dnl but we'll use thr_yield instead.
775 AC_CHECK_FUNCS(thr_yield)
777 if test $ac_cv_func_sched_yield = no -a \
778 $ac_cv_func_pthread_yield = no -a \
779 "$ac_cv_func_thr_yield" = no ; then
780 AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
783 dnl Check functions for compatibility
784 AC_CHECK_FUNCS(pthread_kill)
786 dnl Check for pthread_detach with <pthread.h> inclusion
787 dnl as it's symbol may have been mangled.
788 AC_CACHE_CHECK([for pthread_detach with <pthread.h>],
789 [ol_cv_func_pthread_detach], [
794 #define NULL (void*)0
797 [pthread_detach(NULL);],
798 [ol_cv_func_pthread_detach=yes],
799 [ol_cv_func_pthread_detach=no])
802 if test $ol_cv_func_pthread_detach = no ; then
803 AC_MSG_ERROR([could not locate pthread_detach()])
806 AC_DEFINE(HAVE_PTHREAD_DETACH,1,
807 [define if you have pthread_detach function])
809 dnl Check for setconcurreny functions
811 pthread_setconcurrency \
812 pthread_getconcurrency \
820 if test $ol_cv_linux_threads = error; then
821 AC_MSG_ERROR([LinuxThreads header/library mismatch]);
824 AC_MSG_CHECKING([if pthread_create() works])
825 AC_CACHE_VAL(ol_cv_pthread_create_works,[
829 #define NULL (void*)0
835 return (void *) (p == NULL);
844 exit(pthread_create(&t, pthread_attr_default, task, NULL));
846 exit(pthread_create(&t, NULL, task, NULL));
850 [ol_cv_pthread_create_works=yes],
851 [ol_cv_pthread_create_works=no],
853 ol_cv_pthread_create_works=yes])])
854 AC_MSG_RESULT($ol_cv_pthread_create_works)
856 if test $ol_cv_pthread_create_works = no ; then
857 AC_MSG_ERROR([pthread_create is not usable, check environment settings])
860 dnl Check if select causes an yield
861 if test $ol_with_yielding_select = auto ; then
862 AC_MSG_CHECKING([if select yields when using pthreads])
863 AC_CACHE_VAL(ol_cv_pthread_select_yields,[
865 #include <sys/types.h>
866 #include <sys/time.h>
870 #define NULL (void*) 0
873 static int fildes[2];
887 FD_SET(fildes[0], &rfds);
889 /* we're not interested in any fds */
890 i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
897 exit(0); /* if we exit here, the select blocked the whole process */
906 /* create a pipe to select */
907 if(pipe(&fildes[0])) {
912 #ifdef HAVE_PTHREAD_SETCONCURRENCY
913 (void) pthread_setconcurrency(2);
915 #ifdef HAVE_THR_SETCONCURRENCY
916 /* Set Solaris LWP concurrency to 2 */
917 thr_setconcurrency(2);
922 pthread_create(&t, pthread_attr_default, task, NULL);
924 pthread_create(&t, NULL, task, NULL);
928 sched_yield(); /* make sure task runs first */
930 #ifdef HAVE_PTHREAD_YIELD
931 pthread_yield(); /* make sure task runs first */
937 [ol_cv_pthread_select_yields=no],
938 [ol_cv_pthread_select_yields=yes], [
939 AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual])])])
940 AC_MSG_RESULT($ol_cv_pthread_select_yields)
942 if test $ol_cv_pthread_select_yields = yes ; then
943 ol_with_yielding_select=yes
948 CPPFLAGS="$save_CPPFLAGS"
951 AC_MSG_ERROR([could not link with POSIX Threads])
955 if test $ol_with_threads = posix ; then
956 AC_MSG_ERROR([could not locate POSIX Threads])
960 if test $ol_with_threads = auto -o $ol_with_threads = yes \
961 -o $ol_with_threads = mach ; then
963 dnl check for Mach CThreads
964 AC_CHECK_HEADERS(mach/cthreads.h)
965 if test $ac_cv_header_mach_cthreads_h = yes ; then
966 ol_with_threads=found
968 dnl check for cthread support in current $LIBS
969 AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
971 if test $ol_link_threads = no ; then
973 dnl this test needs work
974 AC_CACHE_CHECK([for cthread_fork with -all_load],
975 [ol_cv_cthread_all_load], [
978 LIBS="-all_load $LIBS"
979 AC_TRY_LINK([#include <mach/cthreads.h>],[
980 cthread_fork((void *)0, (void *)0);
981 ], ol_cv_cthread_all_load=yes, ol_cv_cthread_all_load=no)
986 if test $ol_cv_cthread_all_load = yes ; then
987 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
992 if test $ol_link_threads != no ; then
993 : check for cthread specific functionality here
994 AC_DEFINE(HAVE_MACH_CTHREADS,1,
995 [define if you have Mach Cthreads])
997 AC_MSG_ERROR([could not link with Mach CThreads])
1001 if test $ol_with_threads = mach ; then
1002 AC_MSG_ERROR([could not locate Mach CThreads])
1006 if test $ol_with_threads = auto -o $ol_with_threads = yes \
1007 -o $ol_with_threads = lwp ; then
1009 dnl check for SunOS5 LWP
1010 AC_CHECK_HEADERS(thread.h synch.h)
1011 if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
1012 AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
1014 if test $have_thr = yes ; then
1015 AC_DEFINE(HAVE_THR,1,
1016 [if you have Solaris LWP (thr) package])
1017 LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
1020 if test $ol_with_yielding_select = auto ; then
1021 ol_with_yielding_select=yes
1024 dnl Check for setconcurreny functions
1026 thr_setconcurrency \
1027 thr_getconcurrency \
1032 dnl check for SunOS4 LWP
1033 AC_CHECK_HEADERS(lwp/lwp.h)
1034 if test $ac_cv_header_lwp_lwp_h = yes ; then
1035 AC_CHECK_LIB(lwp, lwp_create, [have_lwp=yes], [have_lwp=no])
1037 if test $have_lwp = yes ; then
1038 AC_DEFINE(HAVE_LWP,1,
1039 [if you have SunOS LWP package])
1040 LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
1043 if test $ol_with_yielding_select = auto ; then
1044 ol_with_yielding_select=no
1050 if test $ol_with_yielding_select = yes ; then
1051 AC_DEFINE(HAVE_YIELDING_SELECT,1,
1052 [define if select implicitly yields])
1055 if test $ol_with_threads = manual ; then
1056 dnl User thinks he can manually configure threads.
1059 AC_MSG_WARN([thread defines and link options must be set manually])
1061 AC_CHECK_HEADERS(pthread.h sched.h)
1062 AC_CHECK_FUNCS(sched_yield pthread_yield)
1063 OL_HEADER_LINUX_THREADS
1065 AC_CHECK_HEADERS(mach/cthreads.h)
1066 AC_CHECK_HEADERS(lwp/lwp.h)
1067 AC_CHECK_HEADERS(thread.h synch.h)
1070 if test $ol_link_threads != no ; then
1071 dnl needed to get reentrant/threadsafe versions
1073 AC_DEFINE(REENTRANT,1)
1074 AC_DEFINE(_REENTRANT,1)
1075 AC_DEFINE(THREAD_SAFE,1)
1076 AC_DEFINE(_THREAD_SAFE,1)
1077 AC_DEFINE(THREADSAFE,1)
1078 AC_DEFINE(_THREADSAFE,1)
1080 dnl The errno declaration may dependent upon _REENTRANT.
1081 dnl If it does, we must link with thread support.
1082 AC_CACHE_CHECK([for thread specific errno],
1083 [ol_cv_errno_thread_specific], [
1084 AC_TRY_LINK([#include <errno.h>], [errno = 0;],
1085 [ol_cv_errno_thread_specific=yes],
1086 [ol_cv_errno_thread_specific=no])
1089 if test $ol_cv_errno_thread_specific != yes ; then
1090 LIBS="$LTHREAD_LIBS $LIBS"
1094 dnl When in thread environment, use
1095 dnl #if defined( HAVE_REENTRANT_FUNCTIONS ) \
1096 dnl || defined( HAVE_FUNC_R )
1099 dnl # if defined( HAVE_THREADS )
1103 dnl # if defined( HAVE_THREADS )
1108 dnl HAVE_REENTRANT_FUNCTIONS is derived from:
1109 dnl _POSIX_REENTRANT_FUNCTIONS
1110 dnl _POSIX_THREAD_SAFE_FUNCTIONS
1111 dnl _POSIX_THREADSAFE_FUNCTIONS
1113 dnl and is currently defined in lthread.h
1115 dnl HAVE_THREADS is defined by lthread.h iff -UNO_THREADS
1117 dnl libldap/*.c should only include <lthread.h> iff
1118 dnl LDAP_R_COMPILE is defined. ie:
1119 dnl #ifdef LDAP_R_COMPILE
1120 dnl # include LDAP_R_COMPILE
1123 dnl LDAP_R_COMIPLE is defined by libldap_r/Makefile.in
1124 dnl specifically for compiling the threadsafe version of
1125 dnl the ldap library (-lldap_r).
1127 dnl dnl check for reentrant/threadsafe functions
1129 dnl dnl note: these should only be used when linking
1130 dnl dnl with $LTHREAD_LIBS
1132 dnl save_CPPFLAGS="$CPPFLAGS"
1133 dnl save_LIBS="$LIBS"
1134 dnl LIBS="$LTHREAD_LIBS $LIBS"
1135 dnl AC_CHECK_FUNCS( \
1137 dnl gethostbyaddr_r gethostbyname_r \
1138 dnl feof_unlocked unlocked_feof \
1139 dnl putc_unlocked unlocked_putc \
1140 dnl flockfile ftrylockfile \
1142 dnl CPPFLAGS="$save_CPPFLAGS"
1143 dnl LIBS="$save_LIBS"
1146 if test $ol_link_threads = no ; then
1147 if test $ol_with_threads = yes ; then
1148 AC_MSG_ERROR([no suitable thread support])
1151 if test $ol_with_threads = auto ; then
1152 AC_MSG_WARN([no suitable thread support, disabling threads])
1156 AC_DEFINE(NO_THREADS,1,
1157 [define if you have (or want) no threads])
1161 if test $ol_link_threads != no ; then
1162 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE,1)
1165 dnl ----------------------------------------------------------------
1168 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
1171 if test $ol_cv_berkeley_db2 = yes ; then
1173 ol_with_ldbm_api=db2
1175 if test $ol_with_ldbm_type = hash ; then
1176 AC_DEFINE(LDBM_USE_DBHASH,1)
1178 AC_DEFINE(LDBM_USE_DBBTREE,1)
1181 dnl $ol_cv_lib_db2 should be yes or -ldb
1182 dnl (it could be no, but that would be an error
1183 if test $ol_cv_lib_db2 != yes ; then
1184 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
1190 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
1194 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
1197 if test $ol_cv_berkeley_db = yes ; then
1201 if test $ol_with_ldbm_type = hash ; then
1202 AC_DEFINE(LDBM_USE_DBHASH,1)
1204 AC_DEFINE(LDBM_USE_DBBTREE,1)
1207 dnl $ol_cv_lib_db should be yes or -ldb
1208 dnl (it could be no, but that would be an error
1209 if test $ol_cv_lib_db != yes ; then
1210 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
1215 if test $ol_with_ldbm_api = manual ; then
1216 dnl User thinks he can manually configure LDBM api.
1219 AC_MSG_WARN([LDBM defines and link options must be set manually])
1221 AC_CHECK_HEADERS(db.h db_185.h gdbm.h ndbm.h)
1224 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
1225 AC_MSG_WARN(Could not find LDBM with BTREE support)
1226 ol_with_ldbm_api=none
1229 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
1232 if test $ol_cv_mdbm = yes ; then
1234 ol_with_ldbm_api=mdbm
1235 if test $ol_cv_lib_mdbm != yes ; then
1236 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
1241 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
1244 if test $ol_cv_gdbm = yes ; then
1246 ol_with_ldbm_api=gdbm
1248 if test $ol_cv_lib_gdbm != yes ; then
1249 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
1254 if test $ol_with_ldbm_api = auto ; then
1255 AC_MSG_WARN([skipping automatic checking for NDBM, must be manually enabled.])
1256 elif test $ol_with_ldbm_api = ndbm ; then
1259 if test $ol_cv_ndbm = yes ; then
1261 ol_with_ldbm_api=ndbm
1263 if test $ol_cv_lib_ndbm != yes ; then
1264 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
1269 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
1270 AC_MSG_WARN(could not find suitable LDBM backend)
1271 if test $ol_enable_ldbm = yes ; then
1272 AC_MSG_ERROR(select appropriate LDBM options or disable)
1275 AC_MSG_WARN(disabling LDBM)
1279 if test $ol_enable_wrappers != no ; then
1280 AC_CHECK_HEADERS(tcpd.h)
1282 if test $ac_cv_header_tcpd_h != yes ; then
1285 AC_CHECK_LIB(wrap, main,
1286 [have_wrappers=yes], [have_wrappers=no])
1289 if test $have_wrappers = yes ; then
1290 AC_DEFINE(HAVE_TCPD,1, [define if you have -lwrap])
1291 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
1293 AC_MSG_WARN(could not find -lwrap)
1294 if test $ol_enable_wrappers = yes ; then
1295 AC_MSG_ERROR(could not find wrappers, select appropriate options or disable)
1298 AC_MSG_WARN(disabling wrappers support)
1299 ol_enable_wrappers=no
1303 if test $ol_enable_syslog != no ; then
1304 AC_CHECK_FUNC(openlog)
1305 if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
1306 AC_MSG_ERROR(could not find syslog, select appropriate options or disable)
1308 ol_enable_syslog=$ac_cv_func_openlog
1311 if test $ol_enable_dmalloc != no ; then
1312 AC_CHECK_HEADERS(dmalloc.h)
1313 AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
1316 if test $ol_enable_tcl != no ; then
1317 AC_CHECK_HEADERS(tcl.h)
1319 if test $ac_cv_header_tcl_h != yes ; then
1322 AC_CHECK_LIB(tcl,main,
1323 [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"],
1326 if test $have_tcl != yes; then
1327 AC_CHECK_LIB(tcl7.6,main,
1328 [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"],
1332 if test $have_tcl != yes; then
1333 AC_CHECK_LIB(tcl8.0,main,
1334 [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"],
1339 if test $have_tcl != yes ; then
1340 AC_MSG_WARN([could not find -ltcl])
1341 if test $ol_enable_tcl = yes ; then
1342 AC_MSG_ERROR([could not find tcl, select appropriate options or disable])
1349 # ud needs termcap (should insert check here)
1351 AC_CHECK_HEADERS(termcap.h ncurses.h)
1353 if test $ol_link_termcap = no ; then
1354 AC_CHECK_LIB(termcap, tputs, [have_termcap=yes], [have_termcap=no])
1355 if test $have_termcap = yes ; then
1356 AC_DEFINE(HAVE_TERMCAP, 1, [define if you have -ltermcap])
1358 TERMCAP_LIBS=-ltermcap
1362 if test $ol_link_termcap = no ; then
1363 AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
1364 if test $have_ncurses = yes ; then
1365 AC_DEFINE(HAVE_NCURSES, 1, [define if you have -lncurses])
1367 TERMCAP_LIBS=-lncurses
1371 if test $ol_link_termcap = no ; then
1372 AC_DEFINE(NO_TERMCAP,1, [define if you have no termcap support])
1377 dnl Check for GNU readline
1380 if test $ol_with_readline != no ; then
1381 AC_CHECK_HEADERS(readline/readline.h readline/history.h)
1383 if test $ac_cv_header_readline_readline_h = yes ; then
1385 LIBS="$TERMCAP_LIBS $LIBS"
1386 AC_CHECK_LIB(readline, readline,
1387 [have_readline=yes], [have_readline=no])
1390 if test $have_readline = yes ; then
1391 ol_with_readline=found
1392 ol_link_readline=yes
1394 READLINE_LIBS="-lreadline"
1399 if test $ol_link_readline = yes ; then
1400 AC_DEFINE(HAVE_READLINE, 1, [define if you have -lreadline])
1404 # FreeBSD (and others) have crypt(3) in -lcrypt
1405 if test $ol_enable_crypt != no ; then
1406 AC_CHECK_FUNC(crypt, [have_crypt=yes], [
1407 AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
1408 have_crypt=yes], [have_crypt=no])])
1410 if test $have_crypt = yes ; then
1411 AC_DEFINE(HAVE_CRYPT,1)
1413 AC_MSG_WARN(could not find crypt)
1414 if test $ol_enable_crypt = yes ; then
1415 AC_MSG_ERROR(could not find crypt, select appropriate options or disable)
1418 AC_MSG_WARN(disabling crypt support)
1423 # FreeBSD (and others) have setproctitle(3) in -lutil
1424 if test $ol_enable_proctitle != no ; then
1425 AC_CHECK_FUNC(setproctitle, [have_setproctitle=yes], [
1426 AC_CHECK_LIB(util, setproctitle,
1427 [have_setproctitle=yes
1428 LUTIL_LIBS="$LUTIL_LIBS -lutil"],
1429 [have_setproctitle=no
1430 LIBOBJS="$LIBOBJS setproctitle.o"])])
1432 if test $have_setproctitle = yes ; then
1433 AC_DEFINE(HAVE_SETPROCTITLE,1)
1437 dnl ----------------------------------------------------------------
1438 dnl Checks for header files.
1441 if test $ol_cv_header_stdc != yes; then
1442 AC_MSG_WARN([could not locate Standard C compliant headers])
1447 AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
1448 if test $am_cv_sys_posix_termios = yes ; then
1449 AC_DEFINE(HAVE_POSIX_TERMIOS,1,
1450 [define if you have POSIX termios])
1493 dnl ----------------------------------------------------------------
1494 dnl Checks for typedefs, structures, and compiler characteristics.
1495 AC_TYPE_GETGROUPS dnl requires AC_TYPE_UID_T
1501 OL_TYPE_SIG_ATOMIC_T
1503 AC_STRUCT_ST_BLKSIZE
1506 OL_STRUCT_PASSWD_PW_GECOS
1512 if test $cross_compiling = yes ; then
1513 AC_DEFINE(CROSS_COMPILING, 1, [define if cross compiling])
1516 AC_CHECK_SIZEOF(short)
1517 AC_CHECK_SIZEOF(int)
1518 AC_CHECK_SIZEOF(long)
1521 dnl ----------------------------------------------------------------
1522 dnl Checks for library functions.
1524 dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
1530 if test $ac_cv_func_vprintf = yes ; then
1531 dnl check for vsnprintf
1532 AC_CHECK_FUNCS(vsnprintf vsprintf)
1571 dnl We actually may need to replace more than this.
1572 AC_REPLACE_FUNCS(getopt tempnam)
1574 dnl ----------------------------------------------------------------
1575 # Check Configuration
1578 dnl ----------------------------------------------------------------
1579 dnl Check our declaration of strdup()
1582 dnl ----------------------------------------------------------------
1583 dnl Sort out defines
1585 if test "$ol_enable_debug" != no ; then
1586 AC_DEFINE(LDAP_DEBUG,1)
1588 if test "$ol_enable_syslog" = yes ; then
1589 AC_DEFINE(LDAP_SYSLOG,1)
1591 if test "$ol_enable_libui" = yes ; then
1592 AC_DEFINE(LDAP_LIBUI,1)
1594 if test "$ol_enable_cache" = no ; then
1595 AC_DEFINE(LDAP_NOCACHE,1)
1597 if test "$ol_enable_dns" != no ; then
1598 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_DNS,LDAP_VENDOR_VERSION)
1600 if test "$ol_enable_proctitle" != no ; then
1601 AC_DEFINE(LDAP_PROCTITLE,1)
1603 if test "$ol_enable_referrals" != no ; then
1604 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS,LDAP_VENDOR_VERSION)
1606 if test "$ol_enable_cldap" != no ; then
1607 AC_DEFINE(LDAP_CONNECTIONLESS,1)
1610 if test "$ol_enable_aclgroups" != no ; then
1611 AC_DEFINE(SLAPD_ACLGROUPS,1)
1613 if test "$ol_enable_crypt" != no ; then
1614 AC_DEFINE(SLAPD_CRYPT,1)
1616 if test "$ol_enable_cleartext" != no ; then
1617 AC_DEFINE(SLAPD_CLEARTEXT,1)
1619 if test "$ol_enable_phonetic" != no ; then
1620 AC_DEFINE(SLAPD_PHONETIC,1)
1622 if test "$ol_enable_rlookups" != no ; then
1623 AC_DEFINE(SLAPD_RLOOKUPS,1)
1626 if test "$ol_link_modules" != no ; then
1627 AC_DEFINE(SLAPD_MODULES,1)
1631 if test "$ol_link_bdb2" != no ; then
1632 AC_DEFINE(SLAPD_BDB2,1)
1637 if test "$ol_link_ldbm" != no ; then
1638 AC_DEFINE(SLAPD_LDBM,1)
1643 if test "$ol_enable_passwd" != no ; then
1644 AC_DEFINE(SLAPD_PASSWD,1)
1649 if test "$ol_link_perl" != no ; then
1650 AC_DEFINE(SLAPD_PERL,1)
1655 if test "$ol_enable_shell" != no ; then
1656 AC_DEFINE(SLAPD_SHELL,1)
1661 if test "$ol_enable_tcl" != no ; then
1662 AC_DEFINE(SLAPD_TCL,1)
1667 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
1668 $BUILD_SLAPD = yes ; then
1672 if test "$ol_link_isode" != no ; then
1676 dnl ----------------------------------------------------------------
1678 AC_SUBST(BUILD_LDAPD)
1679 AC_SUBST(BUILD_SLAPD)
1680 AC_SUBST(BUILD_BDB2)
1681 AC_SUBST(BUILD_LDBM)
1682 AC_SUBST(BUILD_PASSWD)
1683 AC_SUBST(BUILD_PERL)
1684 AC_SUBST(BUILD_SHELL)
1686 AC_SUBST(BUILD_SLURPD)
1689 AC_SUBST(LDAPD_LIBS)
1690 AC_SUBST(SLAPD_LIBS)
1691 AC_SUBST(SLURPD_LIBS)
1693 AC_SUBST(LTHREAD_LIBS)
1694 AC_SUBST(LUTIL_LIBS)
1696 AC_SUBST(SLAPD_MODULES_CPPFLAGS)
1697 AC_SUBST(SLAPD_MODULES_LDFLAGS)
1699 AC_SUBST(SLAPD_PERL_CPPFLAGS)
1700 AC_SUBST(SLAPD_PERL_LDFLAGS)
1703 AC_SUBST(READLINE_LIBS)
1704 AC_SUBST(TERMCAP_LIBS)
1707 dnl ----------------------------------------------------------------
1712 Makefile:build/top.mk:Makefile.in:build/dir.mk \
1713 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
1714 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
1715 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
1716 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
1717 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
1718 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
1719 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
1720 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
1721 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
1722 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
1723 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
1724 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
1725 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
1726 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
1727 include/Makefile:build/top.mk:include/Makefile.in \
1728 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk \
1729 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk \
1730 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk \
1731 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk \
1732 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk \
1733 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk \
1734 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk \
1735 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk \
1736 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
1737 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
1738 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
1739 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
1740 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
1741 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
1742 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
1743 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
1744 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
1745 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
1746 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
1747 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
1748 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
1749 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
1750 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
1751 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
1752 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
1755 echo Please \"make depend\" to build dependencies