1 dnl Copyright 1998 The OpenLDAP Foundation. All Rights Reserved.
3 dnl Redistribution and use in source and binary forms are permitted only
4 dnl as authorized by the OpenLDAP Public License. A copy of this
5 dnl license is available at http://www.OpenLDAP.org/license.html or
6 dnl in file LICENSE in the top-level directory of the distribution.
9 dnl Configure.in for OpenLDAP
10 AC_INIT(include/ldap.h)dnl
11 AC_CONFIG_AUX_DIR(build)dnl
12 AM_INIT_AUTOMAKE(OpenLDAP,[1.1-alpha3], [no ac_define])dnl
14 dnl Do not use AutoConf 2.12; it produces a configuration script
15 dnl that causes an "internal 2K buffer" error on HPUX when run
16 dnl with /bin/sh. Autoconf 2.10 seems to be okay.
17 AC_PREREQ(2.10)dnl Required Autoconf version
19 AC_CONFIG_AUX_DIR(build)
20 AC_CONFIG_HEADER(include/portable.h)dnl
24 AC_MSG_CHECKING(configure arguments)
25 AC_PREFIX_DEFAULT(/usr/local)
28 AC_SUBST(top_builddir)dnl
30 OL_ARG_ENABLE(debug,[ --enable-debug enable debugging], yes)dnl
31 dnl OL_ARG_ENABLE(syslog,[ --enable-syslog enable syslog support], auto)dnl
32 OL_ARG_ENABLE(proctitle,[ --enable-proctitle enable proctitle support], yes)dnl
33 OL_ARG_ENABLE(libui,[ --enable-libui enable library user interface], yes)dnl
34 OL_ARG_ENABLE(cache,[ --enable-cache enable caching], yes)dnl
35 OL_ARG_ENABLE(dns,[ --enable-dns enable dns support], no)dnl
36 OL_ARG_ENABLE(referrals,[ --enable-referrals enable referrals], yes)dnl
37 OL_ARG_ENABLE(cldap,[ --enable-cldap enable connectionless ldap], no)dnl
38 OL_ARG_ENABLE(x_compile,[ --enable-x-compile enable cross compiling],
41 dnl General "with" options
42 OL_ARG_WITH(kerberos,[ --with-kerberos use Kerberos],
43 auto, [auto k5 k4 afs yes no])
44 OL_ARG_WITH(threads,[ --with-threads use threads],
45 auto, [auto posix mach lwp yes no manual] )
46 OL_ARG_WITH(yielding_select,[ --with-yielding-select with implicitly yielding select],
47 auto, [auto yes no manual] )
52 AC_ARG_WITH(xxldapdoptions,[LDAPD Options:])
53 OL_ARG_ENABLE(ldapd,[ --enable-ldapd enable building ldapd], no)dnl
56 AC_ARG_WITH(xxslapdoptions,[SLAPD Options:])
57 OL_ARG_ENABLE(slapd,[ --enable-slapd enable building slapd], yes)dnl
58 OL_ARG_ENABLE(aclgroups,[ --enable-aclgroups enable ACL group support], auto)dnl
59 OL_ARG_ENABLE(crypt,[ --enable-crypt enable crypt(3) passwords], auto)dnl
60 OL_ARG_ENABLE(md5,[ --enable-md5 enable MD5 passwords], auto)dnl
61 OL_ARG_ENABLE(sha1,[ --enable-sha1 enable SHA1 passwords], auto)dnl
62 OL_ARG_ENABLE(wrappers,[ --enable-wrappers enable tcp wrapper support], no)dnl
63 OL_ARG_ENABLE(phonetic,[ --enable-phonetic enable phonetic/soundex], no)dnl
64 OL_ARG_ENABLE(rlookups,[ --enable-rlookups enable reverse lookups], auto)dnl
66 dnl SLAPD Backend options
67 OL_ARG_ENABLE(ldbm,[ --enable-ldbm enable ldbm backend], yes)dnl
68 OL_ARG_WITH(ldbm_api,[ --with-ldbm-api use LDBM API], auto,
69 [auto db2 db gdbm ndbm manual])
70 OL_ARG_WITH(ldbm_type,[ --with-ldbm-type use LDBM type], auto,
73 OL_ARG_ENABLE(passwd,[ --enable-passwd enable passwd backend], no)dnl
74 OL_ARG_ENABLE(shell,[ --enable-shell enable shell backend], no)dnl
77 AC_ARG_WITH(xxslurpdoptions,[SLURPD Options:])
78 OL_ARG_ENABLE(slurpd,[ --enable-slurpd enable building slurpd], auto)dnl
80 AC_ARG_WITH(xxliboptions,[Library Generation & Linking Options])
85 dnl General "enable" options
87 if test $ol_enable_referrals = no ; then
88 if test $ol_enable_dns = yes ; then
89 AC_MSG_WARN([dns disabled, ignoring --enable-dns argument])
94 if test $ol_enable_slapd = no ; then
95 dnl SLAPD was specificallly disabled
96 if test $ol_enable_ldbm = yes ; then
97 AC_MSG_WARN([slapd disabled, ignoring --enable_ldbm argument])
99 if test $ol_enable_passwd = yes ; then
100 AC_MSG_WARN([slapd disabled, ignoring --enable_passwd argument])
102 if test $ol_enable_shell = yes ; then
103 AC_MSG_WARN([slapd disabled, ignoring --enable_shell argument])
105 if test $ol_enable_aclgroups = yes ; then
106 AC_MSG_WARN([slapd disabled, ignoring --enable_aclgroups argument])
108 if test $ol_enable_crypt = yes ; then
109 AC_MSG_WARN([slapd disabled, ignoring --enable_crypt argument])
111 if test $ol_enable_md5 = yes ; then
112 AC_MSG_WARN([slapd disabled, ignoring --enable_md5 argument])
114 if test $ol_enable_sha1 = yes ; then
115 AC_MSG_WARN([slapd disabled, ignoring --enable_sha1 argument])
117 if test $ol_enable_wrappers = yes ; then
118 AC_MSG_WARN([slapd disabled, ignoring --enable_wrappers argument])
120 if test $ol_enable_phonetic = yes ; then
121 AC_MSG_WARN([slapd disabled, ignoring --enable_phonetic argument])
123 if test $ol_enable_rlookups = yes ; then
124 AC_MSG_WARN([slapd disabled, ignoring --enable_rlookups argument])
126 if test $ol_with_ldbm_api != auto ; then
127 AC_MSG_WARN([slapd disabled, ignoring --with_ldbm_api argument])
129 if test $ol_with_ldbm_type != auto ; then
130 AC_MSG_WARN([slapd disabled, ignoring --with_ldbm_type argument])
132 if test $ol_enable_slurpd = yes ; then
133 AC_MSG_ERROR([slurpd requires slapd])
136 # force settings to no
140 ol_enable_aclgroups=no
144 ol_enable_wrappers=no
145 ol_enable_phonetic=no
146 ol_enable_rlookups=no
151 elif test $ol_enable_ldbm = no ; then
152 dnl SLAPD without LDBM
154 if test $ol_with_ldbm_api != auto ; then
155 AC_MSG_WARN([LDBM disabled, ignoring --with_ldbm_api argument])
158 if test $ol_with_ldbm_type != auto ; then
159 AC_MSG_WARN([LDBM disabled, ignoring --with_ldbm_type argument])
162 if test $ol_enable_passwd = no -a $ol_enable_shell = no ; then
163 AC_MSG_ERROR([slapd requires a backend])
172 if test $ol_with_ldbm_api = gdbm -a \
173 $ol_with_ldbm_type = btree ; then
174 AC_MSG_ERROR([GDBM only supports LDBM type hash])
176 if test $ol_with_ldbm_api = ndbm -a \
177 $ol_with_ldbm_type = btree ; then
178 AC_MSG_ERROR([NDBM only supports LDBM type hash])
182 if test $ol_enable_slurpd = yes ; then
183 dnl SLURPD was specifically enabled
184 if test $ol_with_threads = no ; then
185 AC_MSG_ERROR([slurpd requires threads])
215 dnl ----------------------------------------------------------------
216 dnl Checks for programs
222 AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail,
223 $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc)
224 AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi, $PATH:/usr/ucb)
225 AC_PATH_PROG(FINGER, finger, /usr/ucb/finger, $PATH:/usr/ucb)
227 dnl Checks the compiler and UNIX Variants
229 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
230 AC_MSG_WARN([cross compiling.... some functionality will be removed.])
232 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
233 AC_MSG_WARN([programs compiled here do run here...])
234 AC_MSG_ERROR([ if not cross compiling, use --disable-x-compile.])
236 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
237 AC_MSG_WARN([programs compiled here do not run here...])
238 AC_MSG_ERROR([ if cross compiling, add --enable-x-compile.])
247 dnl OpenLDAP requires STDC features
249 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
250 AC_MSG_ERROR([OpenLDAP requires compiler to support STDC prototypes.])
255 dnl Checks for libraries
258 dnl Likely combinations:
259 dnl -lsocket [ -lnsl_s | -lnsl ]
262 AC_CHECK_FUNC(socket, [have_socket=yes], [
264 dnl hopefully we won't include too many libraries
266 AC_CHECK_LIB(socket, main)
267 AC_CHECK_LIB(net, main)
268 AC_CHECK_LIB(nsl_s, main)
269 AC_CHECK_LIB(nsl, main)
270 AC_CHECK_LIB(inet, socket)
271 AC_CHECK_LIB(gen, main)
275 AC_CHECK_LIB(resolv, res_search)
277 dnl HP-UX requires -lV3
278 AC_CHECK_LIB(V3, sigset)
282 if test $ol_enable_ldapd != no ; then
283 dnl look for ISODE libraries
284 AC_CHECK_LIB(xtpp, main, [
286 AC_DEFINE(HAVE_XTPP,1)
287 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
288 ],:,[-lxtdsap -lxtisode -losi])
289 AC_CHECK_LIB(dsap, main, [
291 AC_DEFINE(HAVE_DSAP,1)
292 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
294 AC_CHECK_LIB(isode, main, [
296 AC_DEFINE(HAVE_ISODE,1)
297 LDAPD_LIBS="$LDAPD_LIBS -lisode"
301 if test $ol_link_isode != no; then
302 AC_CHECK_LIB(pp, main, [
304 LDAPD_LIBS="-lpp $LDAPD_LIBS"
307 AC_PATH_PROG(PEPSY, pepsy)
310 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
311 AC_CHECK_HEADERS(kerberosIV/krb.h kerberosIV/des.h)
313 if test $ac_cv_header_kerberosIV_krb_h = yes ; then
314 AC_CHECK_LIB(krb4, main, [have_k5=yes], [have_k5=no],
317 if test $have_k5 = yes ; then
318 ol_with_kerberos=found
321 AC_DEFINE(HAVE_KERBEROS)
323 KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
327 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
328 AC_CHECK_HEADERS(krb.h des.h)
330 if test $ac_cv_header_krb_h = yes ; then
331 AC_CHECK_LIB(krb, main, [have_k4=yes], [have_k4=no], [-ldes])
333 if test $have_k4 = yes ; then
334 ol_with_kerberos=found
337 AC_DEFINE(HAVE_KERBEROS)
339 KRB_LIBS="-lkrb -ldes"
345 if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
346 AC_CHECK_HEADERS(pthread.h sched.h)
348 if test $ac_cv_header_pthread_h = yes ; then
349 OL_POSIX_THREAD_VERSION
351 if test $ol_cv_pthread_version = final ; then
352 AC_DEFINE(HAVE_PTHREADS_FINAL)
353 elif test $ol_cv_pthread_version = draft4 ; then
354 AC_DEFINE(HAVE_PTHREADS_D4)
356 AC_MSG_ERROR([unknown pthread version])
359 # consider threads found
360 ol_with_threads=found
364 if test $ol_cv_linux_threads = yes ; then
365 AC_DEFINE(HAVE_LINUX_THREADS,1)
368 dnl Now the hard part, how to link
370 dnl Check for pthread support in current $LIBS
371 AC_CHECK_FUNC(pthread_create,[ol_link_threads=yes])
373 if test $ol_link_threads = no ; then
375 AC_CACHE_CHECK([for pthread_create with -pthread],
376 [ol_cv_pthread_flag], [
379 LIBS="-pthread $LIBS"
380 AC_TRY_LINK([char pthread();],[
382 ], ol_cv_pthread_flag=yes, ol_cv_pthread_flag=no)
387 if test $ol_cv_pthread_flag = yes ; then
388 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
389 ol_link_threads=posix
393 if test $ol_link_threads = no ; then
395 AC_CACHE_CHECK([for pthread_create with -thread],
396 [ol_cv_thread_flag], [
400 AC_TRY_LINK([char pthread();],[
402 ], ol_cv_thread_flag=yes, ol_cv_thread_flag=no)
407 if test $ol_cv_thread_flag = yes ; then
408 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
409 ol_link_threads=posix
413 if test $ol_link_threads = no ; then
414 dnl try DEC Threads -lpthread -lexc
416 AC_CHECK_LIB(pthread, pthread_join, [
417 ol_link_threads=posix
418 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
419 if test $ol_with_yielding_select = auto ; then
420 ol_with_yielding_select=yes
426 if test $ol_link_threads = no ; then
427 dnl try DEC Threads -lpthreads -lmach -lexc -lc_r
429 AC_CHECK_LIB(pthreads, pthread_join, [
430 ol_link_threads=posix
431 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
432 if test $ol_with_yielding_select = auto ; then
433 ol_with_yielding_select=yes
435 ],,[-lmach -lexc -lc_r])
439 if test $ol_link_threads = no ; then
442 AC_CHECK_LIB(pthread, pthread_create, [
443 ol_link_threads=posix
444 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"])
448 if test $ol_link_threads = no ; then
451 AC_CHECK_LIB(c_r, pthread_create, [
452 ol_link_threads=posix
453 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"])
457 if test $ol_link_threads != no ; then
458 AC_DEFINE(HAVE_PTHREADS)
461 save_CPPFLAGS="$CPPFLAGS"
463 LIBS="$LTHREAD_LIBS $LIBS"
465 dnl All POSIX Thread (final) implementations should have
466 dnl sched_yield instead of pthread yield.
468 AC_CHECK_FUNCS(sched_yield pthread_yield)
470 if test $ac_cv_func_sched_yield = no -a \
471 $ac_cv_func_pthread_yield = no ; then
472 dnl Digital UNIX has sched_yield() in -lrt
473 AC_CHECK_LIB(rt, sched_yield,
474 [LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
475 AC_DEFINE(HAVE_SCHED_YIELD,1)
476 ac_cv_func_sched_yield=yes],
477 [ac_cv_func_sched_yield=no])
479 if test $ac_cv_func_sched_yield = no -a \
480 $ac_cv_func_pthread_yield = no ; then
481 dnl Solaris has sched_yield() in -lposix4
482 AC_CHECK_LIB(posix4, sched_yield,
483 [LTHREAD_LIBS="$LTHREAD_LIBS -lposix4"
484 AC_DEFINE(HAVE_SCHED_YIELD,1)
485 ac_cv_func_sched_yield=yes],
486 [ac_cv_func_sched_yield=no])
488 if test $ac_cv_func_sched_yield = no -a \
489 $ac_cv_func_pthread_yield = no ; then
490 AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
491 AC_MSG_ERROR([POSIX Threads are not usable])
494 dnl Check functions for compatibility
495 AC_CHECK_FUNCS(pthread_kill)
497 pthread_attr_create pthread_attr_init \
498 pthread_attr_destroy pthread_attr_delete \
499 pthread_attr_setdetachstate pthread_attr_setdetach_np \
502 dnl Check for setconcurreny functions
504 pthread_setconcurrency \
508 dnl Check if select causes an yield
509 if test $ol_with_yielding_select = auto ; then
510 AC_MSG_CHECKING([if select yields])
512 #include <sys/types.h>
513 #include <sys/time.h>
534 FD_SET(fildes[0], &rfds);
536 /* we're not interested in any fds */
537 i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
544 exit(1); /* if we exit here, the select blocked the whole process */
553 /* create a pipe to select */
554 if(pipe(&fildes[0])) {
559 #ifdef HAVE_PTHREAD_SETCONCURRENCY
560 (void) pthread_setconcurrency(2);
562 #ifdef HAVE_THR_SETCONCURRENCY
563 /* Set Solaris LWP concurrency to 2 */
564 thr_setconcurrency(2);
568 pthread_create(&t, NULL, (void *) task, NULL);
571 sched_yield(); /* make sure task runs first */
573 #ifdef HAVE_PTHREAD_YIELD
574 pthread_yield(); /* make sure task runs first */
579 ], [ol_pthread_select_yields=yes], [ol_pthread_select_yields=no], [
580 AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual])])
581 AC_MSG_RESULT($ol_pthread_select_yields)
583 if test $ol_pthread_select_yields = yes ; then
584 ol_with_yielding_select=yes
588 dnl dnl check for reentrant/threadsafe functions
589 dnl AC_CHECK_FUNCS( \
600 CPPFLAGS="$save_CPPFLAGS"
603 AC_MSG_ERROR([could not link with POSIX Threads])
607 if test $ol_with_threads = posix ; then
608 AC_MSG_ERROR([could not locate POSIX Threads])
612 if test $ol_with_threads = auto -o $ol_with_threads = mach ; then
613 dnl check for Mach CThreads
614 AC_CHECK_HEADERS(mach/cthreads.h)
615 if test $ac_cv_header_mach_cthreads_h = yes ; then
616 ol_with_threads=found
618 dnl check for cthread support in current $LIBS
619 AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
621 if test $ol_link_threads = no ; then
623 dnl this test needs work
624 AC_CACHE_CHECK([for cthread_fork with -all_load],
625 [ol_cv_cthread_all_load], [
628 LIBS="-all_load $LIBS"
629 AC_TRY_LINK([#include <mach/cthreads.h>],[
630 cthread_fork((void *)0, (void *)0);
631 ], ol_cv_cthread_all_load=yes, ol_cv_cthread_all_load=no)
636 if test $ol_cv_cthread_all_load = yes ; then
637 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
642 if test $ol_link_threads != no ; then
643 : check for cthread specific functionality here
644 AC_DEFINE(HAVE_MACH_CTHREADS,1)
646 AC_MSG_ERROR([could not link with Mach CThreads])
650 if test $ol_with_threads = mach ; then
651 AC_MSG_ERROR([could not locate Mach CThreads])
655 if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
656 dnl check for SunOS5 LWP
657 AC_CHECK_HEADERS(thread.h synch.h)
658 if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
659 AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
661 if test $have_thr = yes ; then
663 LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
666 if test $ol_with_yielding_select = auto ; then
667 ol_with_yielding_select=yes
672 dnl check for SunOS4 LWP
673 AC_CHECK_HEADERS(lwp/lwp.h)
674 if test $ac_cv_header_lwp_lwp_h = yes ; then
675 AC_CHECK_LIB(lwp, lwp_create, [have_lwp=yes], [have_lwp=no])
677 if test $have_lwp = yes ; then
679 LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
682 if test $ol_with_yielding_select = auto ; then
683 ol_with_yielding_select=no
689 if test $ol_with_yielding_select = yes ; then
690 AC_DEFINE(HAVE_YIELDING_SELECT,1)
693 if test $ol_with_threads = manual ; then
694 dnl User thinks he can manually configure threads.
697 AC_MSG_WARN([thread defines and link options must be set manually])
699 AC_CHECK_HEADERS(pthread.h sched.h)
700 AC_CHECK_FUNCS(sched_yield pthread_yield)
703 AC_CHECK_HEADERS(mach/cthreads.h)
704 AC_CHECK_HEADERS(lwp/lwp.h)
705 AC_CHECK_HEADERS(thread.h synch.h)
708 if test $ol_with_threads != no ; then
709 dnl needed to get reentrant/threadsafe versions
711 AC_DEFINE(_REENTRANT,1)
712 AC_DEFINE(_THREAD_SAFE,1)
713 AC_DEFINE(_THREADSAFE,1)
715 dnl this might cause the errno symbol to be
716 dnl replaced with a function to get a thread specific errno.
717 dnl check to see if everything needs to be compiled
718 dnl with the thread libraries
719 AC_CACHE_CHECK([for thread specific errno],
720 [ol_cv_errno_thread_specific], [
726 [ol_cv_errno_thread_specific=yes],
727 [ol_cv_errno_thread_specific=no])
730 if test $ol_cv_errno_thread_specific != yes ; then
731 LIBS="$LTHREAD_LIBS $LIBS"
736 dnl ----------------------------------------------------------------
738 if test $ol_link_threads = no ; then
739 if test $ol_with_threads = yes ; then
740 AC_MSG_ERROR([no suitable thread support])
743 if test $ol_with_threads = auto ; then
744 AC_MSG_WARN([no suitable thread support, disabling threads])
748 AC_DEFINE(NO_THREADS,1)
753 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
756 if test $ol_cv_berkeley_db2 = yes ; then
760 if test $ol_with_ldbm_type = hash ; then
761 AC_DEFINE(LDBM_USE_DBHASH,1)
763 AC_DEFINE(LDBM_USE_DBBTREE,1)
766 dnl $ol_cv_lib_db2 should be yes or -ldb
767 dnl (it could be no, but that would be an error
768 if test $ol_cv_lib_db2 != yes ; then
769 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
774 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
777 if test $ol_cv_berkeley_db = yes ; then
781 if test $ol_with_ldbm_type = hash ; then
782 AC_DEFINE(LDBM_USE_DBHASH,1)
784 AC_DEFINE(LDBM_USE_DBBTREE,1)
787 dnl $ol_cv_lib_db should be yes or -ldb
788 dnl (it could be no, but that would be an error
789 if test $ol_cv_lib_db != yes ; then
790 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
795 if test $ol_with_ldbm_api = manual ; then
796 dnl User thinks he can manually configure LDBM api.
799 AC_MSG_WARN([LDBM defines and link options must be set manually])
801 AC_CHECK_HEADERS(db.h db_185.h gdbm.h ndbm.h)
804 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
805 AC_MSG_WARN(Could not find LDBM with BTREE support)
806 ol_with_ldbm_api=none
809 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
812 if test $ol_cv_gdbm = yes ; then
814 ol_with_ldbm_api=gdbm
816 if test $ol_cv_lib_gdbm != yes ; then
817 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
822 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then
825 if test $ol_cv_ndbm = yes ; then
826 if test $ol_with_ldbm_api = auto ; then
827 AC_MSG_WARN([Attempting to use NDBM. Functionality will be limited.])
831 ol_with_ldbm_api=ndbm
833 if test $ol_cv_lib_ndbm != yes ; then
834 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
839 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
840 AC_MSG_WARN(could not find suitable LDBM backend)
841 if test $ol_enable_ldbm = yes ; then
842 AC_MSG_ERROR(select appropriate LDBM options or disable)
845 AC_MSG_WARN(disabling LDBM)
849 if test $ol_enable_wrappers = yes ; then
850 AC_CHECK_LIB(wrap, hosts_access,
851 [have_wrappers=yes], [have_wrappers=no])
853 if test $have_wrappers = yes ; then
855 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
857 AC_MSG_WARN(could not find -lwrap)
858 if test $ol_enable_wrappers = yes ; then
859 AC_MSG_ERROR(could not find wrappers, select appropriate options or disable)
862 AC_MSG_WARN(disabling wrappers support)
863 ol_enable_wrappers=no
868 # ud needs termcap (should insert check here)
870 AC_CHECK_HEADERS(termcap.h ncurses.h)
872 if test $ol_link_termcap = no ; then
873 AC_CHECK_LIB(termcap, tputs, [have_termcap=yes], [have_termcap=no])
874 if test $have_termcap = yes ; then
875 AC_DEFINE(HAVE_TERMCAP)
877 TERMCAP_LIBS=-ltermcap
881 if test $ol_link_termcap = no ; then
882 AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
883 if test $have_ncurses = yes ; then
884 AC_DEFINE(HAVE_NCURSES)
886 TERMCAP_LIBS=-lncurses
890 if test $ol_link_termcap = no ; then
891 AC_DEFINE(NO_TERMCAP,1)
895 # FreeBSD (and others) have crypt(3) in -lcrypt
896 if test $ol_enable_crypt != no ; then
897 AC_CHECK_FUNC(crypt, [have_crypt=yes], [
898 AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
899 have_crypt=yes], [have_crypt=no])])
901 if test $have_crypt = yes ; then
902 AC_DEFINE(HAVE_CRYPT,1)
904 AC_MSG_WARN(could not find crypt)
905 if test $ol_enable_crypt = yes ; then
906 AC_MSG_ERROR(could not find crypt, select appropriate options or disable)
909 AC_MSG_WARN(disabling crypt support)
914 # FreeBSD (and others) have setproctitle(3) in -lutil
915 if test $ol_enable_proctitle != no ; then
916 AC_CHECK_FUNC(setproctitle, [have_setproctitle=yes], [
917 AC_CHECK_LIB(util, setproctitle,
918 [have_setproctitle=yes
919 LUTIL_LIBS="$LUTIL_LIBS -lutil"],
920 [have_setproctitle=no
921 LIBOBJS="$LIBOBJS setproctitle.o"])])
923 if test $have_setproctitle = yes ; then
924 AC_DEFINE(HAVE_SETPROCTITLE,1)
928 dnl ----------------------------------------------------------------
929 dnl Checks for header files.
932 if test $ac_cv_header_stdc != yes; then
933 AC_MSG_WARN([could not Standard C compliant headers])
938 AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
939 if test $am_cv_sys_posix_termios = yes ; then
940 AC_DEFINE(HAVE_POSIX_TERMIOS,1)
976 dnl ----------------------------------------------------------------
977 dnl Checks for typedefs, structures, and compiler characteristics.
978 AC_TYPE_GETGROUPS dnl requires AC_TYPE_UID_T
992 if test $cross_compiling = yes ; then
993 AC_DEFINE(CROSS_COMPILING, 1)
996 AC_CHECK_SIZEOF(short)
998 AC_CHECK_SIZEOF(long)
1001 dnl ----------------------------------------------------------------
1002 dnl Checks for library functions.
1004 dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
1009 if test $ac_cv_func_vprintf = yes ; then
1010 dnl check for vsnprintf
1011 AC_CHECK_FUNCS(vsnprintf)
1047 dnl We actually may need to replace more than this.
1048 AC_REPLACE_FUNCS(getopt strdup tempnam)
1050 dnl ----------------------------------------------------------------
1051 # Check Configuration
1054 dnl ----------------------------------------------------------------
1055 dnl Sort out defines
1057 if test $ol_enable_debug != no ; then
1058 AC_DEFINE(LDAP_DEBUG,1)
1060 dnl if test $ol_enable_syslog != no ; then
1061 dnl AC_DEFINE(LDAP_SYSLOG,1)
1063 if test $ol_enable_libui = yes ; then
1064 AC_DEFINE(LDAP_LIBUI,1)
1066 if test $ol_enable_cache = no ; then
1067 AC_DEFINE(LDAP_NOCACHE,1)
1069 if test $ol_enable_dns != no ; then
1070 AC_DEFINE(LDAP_DNS,1)
1072 if test $ol_enable_proctitle != no ; then
1073 AC_DEFINE(LDAP_PROCTITLE,1)
1075 if test $ol_enable_referrals != no ; then
1076 AC_DEFINE(LDAP_REFERRALS,1)
1078 if test $ol_enable_cldap != no ; then
1079 AC_DEFINE(LDAP_CONNECTIONLESS,1)
1082 if test $ol_enable_aclgroups != no ; then
1083 AC_DEFINE(SLAPD_ACLGROUPS,1)
1085 if test $ol_enable_crypt != no ; then
1086 AC_DEFINE(SLAPD_CRYPT,1)
1088 if test $ol_enable_md5 != no ; then
1089 AC_DEFINE(SLAPD_MD5,1)
1091 if test $ol_enable_sha1 != no ; then
1092 AC_DEFINE(SLAPD_SHA1,1)
1094 if test $ol_enable_phonetic != no ; then
1095 AC_DEFINE(SLAPD_PHONETIC,1)
1097 if test $ol_enable_rlookups != no ; then
1098 AC_DEFINE(SLAPD_RLOOKUPS,1)
1101 if test $ol_link_ldbm != no ; then
1102 AC_DEFINE(SLAPD_LDBM,1)
1107 if test $ol_enable_passwd != no ; then
1108 AC_DEFINE(SLAPD_PASSWD,1)
1113 if test $ol_enable_shell != no ; then
1114 AC_DEFINE(SLAPD_SHELL,1)
1119 if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
1120 $BUILD_SLAPD = yes ; then
1124 if test $ol_link_isode != no ; then
1128 dnl ----------------------------------------------------------------
1130 AC_SUBST(BUILD_LDAPD)
1131 AC_SUBST(BUILD_SLAPD)
1132 AC_SUBST(BUILD_LDBM)
1133 AC_SUBST(BUILD_PASSWD)
1134 AC_SUBST(BUILD_SHELL)
1135 AC_SUBST(BUILD_SLURPD)
1139 AC_SUBST(LDAPD_LIBS)
1140 AC_SUBST(SLAPD_LIBS)
1141 AC_SUBST(SLURPD_LIBS)
1143 AC_SUBST(LTHREAD_LIBS)
1144 AC_SUBST(LUTIL_LIBS)
1147 AC_SUBST(TERMCAP_LIBS)
1149 dnl ----------------------------------------------------------------
1154 Makefile:build/top.mk:Makefile.in:build/dir.mk \
1155 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
1156 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
1157 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
1158 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
1159 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
1160 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
1161 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
1162 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
1163 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
1164 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
1165 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
1166 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
1167 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
1168 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
1169 include/Makefile:build/top.mk:include/Makefile.in \
1170 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk \
1171 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk \
1172 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk \
1173 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk \
1174 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk \
1175 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk \
1176 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk:build/lib-static.mk \
1177 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk \
1178 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
1179 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
1180 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
1181 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
1182 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
1183 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
1184 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
1185 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
1186 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
1187 tests/Makefile:build/top.mk:tests/Makefile.in \
1190 echo Please \"make depend\" to build dependencies