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)
338 KRB_LIBS="-lkrb -ldes"
340 AC_CHECK_FUNCS(des_string_to_key)
346 if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
347 AC_CHECK_HEADERS(pthread.h sched.h)
349 if test $ac_cv_header_pthread_h = yes ; then
350 OL_POSIX_THREAD_VERSION
352 if test $ol_cv_pthread_version = final ; then
353 AC_DEFINE(HAVE_PTHREADS_FINAL)
354 elif test $ol_cv_pthread_version = draft4 ; then
355 AC_DEFINE(HAVE_PTHREADS_D4)
357 AC_MSG_ERROR([unknown pthread version])
360 # consider threads found
361 ol_with_threads=found
365 if test $ol_cv_linux_threads = yes ; then
366 AC_DEFINE(HAVE_LINUX_THREADS,1)
369 dnl Now the hard part, how to link
371 dnl Check for pthread support in current $LIBS
372 AC_CHECK_FUNC(pthread_create,[ol_link_threads=yes])
374 if test $ol_link_threads = no ; then
376 AC_CACHE_CHECK([for pthread_create with -pthread],
377 [ol_cv_pthread_flag], [
380 LIBS="-pthread $LIBS"
381 AC_TRY_LINK([char pthread();],[
383 ], ol_cv_pthread_flag=yes, ol_cv_pthread_flag=no)
388 if test $ol_cv_pthread_flag = yes ; then
389 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
390 ol_link_threads=posix
394 if test $ol_link_threads = no ; then
396 AC_CACHE_CHECK([for pthread_create with -thread],
397 [ol_cv_thread_flag], [
401 AC_TRY_LINK([char pthread();],[
403 ], ol_cv_thread_flag=yes, ol_cv_thread_flag=no)
408 if test $ol_cv_thread_flag = yes ; then
409 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
410 ol_link_threads=posix
414 if test $ol_link_threads = no ; then
415 dnl try DEC Threads -lpthread -lexc
417 AC_CHECK_LIB(pthread, pthread_join, [
418 ol_link_threads=posix
419 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
420 if test $ol_with_yielding_select = auto ; then
421 ol_with_yielding_select=yes
427 if test $ol_link_threads = no ; then
428 dnl try DEC Threads -lpthreads -lmach -lexc -lc_r
430 AC_CHECK_LIB(pthreads, pthread_join, [
431 ol_link_threads=posix
432 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
433 if test $ol_with_yielding_select = auto ; then
434 ol_with_yielding_select=yes
436 ],,[-lmach -lexc -lc_r])
440 if test $ol_link_threads = no ; then
443 AC_CHECK_LIB(pthread, pthread_create, [
444 ol_link_threads=posix
445 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"])
449 if test $ol_link_threads = no ; then
452 AC_CHECK_LIB(c_r, pthread_create, [
453 ol_link_threads=posix
454 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"])
458 if test $ol_link_threads != no ; then
459 AC_DEFINE(HAVE_PTHREADS)
462 save_CPPFLAGS="$CPPFLAGS"
464 LIBS="$LTHREAD_LIBS $LIBS"
466 dnl All POSIX Thread (final) implementations should have
467 dnl sched_yield instead of pthread yield.
469 AC_CHECK_FUNCS(sched_yield pthread_yield)
471 if test $ac_cv_func_sched_yield = no -a \
472 $ac_cv_func_pthread_yield = no ; then
473 dnl Digital UNIX has sched_yield() in -lrt
474 AC_CHECK_LIB(rt, sched_yield,
475 [LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
476 AC_DEFINE(HAVE_SCHED_YIELD,1)
477 ac_cv_func_sched_yield=yes],
478 [ac_cv_func_sched_yield=no])
480 if test $ac_cv_func_sched_yield = no -a \
481 $ac_cv_func_pthread_yield = no ; then
482 dnl Solaris has sched_yield() in -lposix4
483 AC_CHECK_LIB(posix4, sched_yield,
484 [LTHREAD_LIBS="$LTHREAD_LIBS -lposix4"
485 AC_DEFINE(HAVE_SCHED_YIELD,1)
486 ac_cv_func_sched_yield=yes],
487 [ac_cv_func_sched_yield=no])
489 if test $ac_cv_func_sched_yield = no -a \
490 $ac_cv_func_pthread_yield = no ; then
491 AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
492 AC_MSG_ERROR([POSIX Threads are not usable])
495 dnl Check functions for compatibility
496 AC_CHECK_FUNCS(pthread_kill)
498 pthread_attr_create pthread_attr_init \
499 pthread_attr_destroy pthread_attr_delete \
500 pthread_attr_setdetachstate pthread_attr_setdetach_np \
503 dnl Check for setconcurreny functions
505 pthread_setconcurrency \
509 dnl Check if select causes an yield
510 if test $ol_with_yielding_select = auto ; then
511 AC_MSG_CHECKING([if select yields])
513 #include <sys/types.h>
514 #include <sys/time.h>
535 FD_SET(fildes[0], &rfds);
537 /* we're not interested in any fds */
538 i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
545 exit(1); /* if we exit here, the select blocked the whole process */
554 /* create a pipe to select */
555 if(pipe(&fildes[0])) {
560 #ifdef HAVE_PTHREAD_SETCONCURRENCY
561 (void) pthread_setconcurrency(2);
563 #ifdef HAVE_THR_SETCONCURRENCY
564 /* Set Solaris LWP concurrency to 2 */
565 thr_setconcurrency(2);
569 pthread_create(&t, NULL, (void *) task, NULL);
572 sched_yield(); /* make sure task runs first */
574 #ifdef HAVE_PTHREAD_YIELD
575 pthread_yield(); /* make sure task runs first */
580 ], [ol_pthread_select_yields=yes], [ol_pthread_select_yields=no], [
581 AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual])])
582 AC_MSG_RESULT($ol_pthread_select_yields)
584 if test $ol_pthread_select_yields = yes ; then
585 ol_with_yielding_select=yes
589 dnl dnl check for reentrant/threadsafe functions
590 dnl AC_CHECK_FUNCS( \
601 CPPFLAGS="$save_CPPFLAGS"
604 AC_MSG_ERROR([could not link with POSIX Threads])
608 if test $ol_with_threads = posix ; then
609 AC_MSG_ERROR([could not locate POSIX Threads])
613 if test $ol_with_threads = auto -o $ol_with_threads = mach ; then
614 dnl check for Mach CThreads
615 AC_CHECK_HEADERS(mach/cthreads.h)
616 if test $ac_cv_header_mach_cthreads_h = yes ; then
617 ol_with_threads=found
619 dnl check for cthread support in current $LIBS
620 AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
622 if test $ol_link_threads = no ; then
624 dnl this test needs work
625 AC_CACHE_CHECK([for cthread_fork with -all_load],
626 [ol_cv_cthread_all_load], [
629 LIBS="-all_load $LIBS"
630 AC_TRY_LINK([#include <mach/cthreads.h>],[
631 cthread_fork((void *)0, (void *)0);
632 ], ol_cv_cthread_all_load=yes, ol_cv_cthread_all_load=no)
637 if test $ol_cv_cthread_all_load = yes ; then
638 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
643 if test $ol_link_threads != no ; then
644 : check for cthread specific functionality here
645 AC_DEFINE(HAVE_MACH_CTHREADS,1)
647 AC_MSG_ERROR([could not link with Mach CThreads])
651 if test $ol_with_threads = mach ; then
652 AC_MSG_ERROR([could not locate Mach CThreads])
656 if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
657 dnl check for SunOS5 LWP
658 AC_CHECK_HEADERS(thread.h synch.h)
659 if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
660 AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
662 if test $have_thr = yes ; then
664 LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
667 if test $ol_with_yielding_select = auto ; then
668 ol_with_yielding_select=yes
673 dnl check for SunOS4 LWP
674 AC_CHECK_HEADERS(lwp/lwp.h)
675 if test $ac_cv_header_lwp_lwp_h = yes ; then
676 AC_CHECK_LIB(lwp, lwp_create, [have_lwp=yes], [have_lwp=no])
678 if test $have_lwp = yes ; then
680 LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
683 if test $ol_with_yielding_select = auto ; then
684 ol_with_yielding_select=no
690 if test $ol_with_yielding_select = yes ; then
691 AC_DEFINE(HAVE_YIELDING_SELECT,1)
694 if test $ol_with_threads = manual ; then
695 dnl User thinks he can manually configure threads.
698 AC_MSG_WARN([thread defines and link options must be set manually])
700 AC_CHECK_HEADERS(pthread.h sched.h)
701 AC_CHECK_FUNCS(sched_yield pthread_yield)
704 AC_CHECK_HEADERS(mach/cthreads.h)
705 AC_CHECK_HEADERS(lwp/lwp.h)
706 AC_CHECK_HEADERS(thread.h synch.h)
709 if test $ol_with_threads != no ; then
710 dnl needed to get reentrant/threadsafe versions
712 AC_DEFINE(_REENTRANT,1)
713 AC_DEFINE(_THREAD_SAFE,1)
714 AC_DEFINE(_THREADSAFE,1)
716 dnl this might cause the errno symbol to be
717 dnl replaced with a function to get a thread specific errno.
718 dnl check to see if everything needs to be compiled
719 dnl with the thread libraries
720 AC_CACHE_CHECK([for thread specific errno],
721 [ol_cv_errno_thread_specific], [
727 [ol_cv_errno_thread_specific=yes],
728 [ol_cv_errno_thread_specific=no])
731 if test $ol_cv_errno_thread_specific != yes ; then
732 LIBS="$LTHREAD_LIBS $LIBS"
737 dnl ----------------------------------------------------------------
739 if test $ol_link_threads = no ; then
740 if test $ol_with_threads = yes ; then
741 AC_MSG_ERROR([no suitable thread support])
744 if test $ol_with_threads = auto ; then
745 AC_MSG_WARN([no suitable thread support, disabling threads])
749 AC_DEFINE(NO_THREADS,1)
754 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
757 if test $ol_cv_berkeley_db2 = yes ; then
761 if test $ol_with_ldbm_type = hash ; then
762 AC_DEFINE(LDBM_USE_DBHASH,1)
764 AC_DEFINE(LDBM_USE_DBBTREE,1)
767 dnl $ol_cv_lib_db2 should be yes or -ldb
768 dnl (it could be no, but that would be an error
769 if test $ol_cv_lib_db2 != yes ; then
770 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
775 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
778 if test $ol_cv_berkeley_db = yes ; then
782 if test $ol_with_ldbm_type = hash ; then
783 AC_DEFINE(LDBM_USE_DBHASH,1)
785 AC_DEFINE(LDBM_USE_DBBTREE,1)
788 dnl $ol_cv_lib_db should be yes or -ldb
789 dnl (it could be no, but that would be an error
790 if test $ol_cv_lib_db != yes ; then
791 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
796 if test $ol_with_ldbm_api = manual ; then
797 dnl User thinks he can manually configure LDBM api.
800 AC_MSG_WARN([LDBM defines and link options must be set manually])
802 AC_CHECK_HEADERS(db.h db_185.h gdbm.h ndbm.h)
805 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
806 AC_MSG_WARN(Could not find LDBM with BTREE support)
807 ol_with_ldbm_api=none
810 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
813 if test $ol_cv_gdbm = yes ; then
815 ol_with_ldbm_api=gdbm
817 if test $ol_cv_lib_gdbm != yes ; then
818 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
823 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then
826 if test $ol_cv_ndbm = yes ; then
827 if test $ol_with_ldbm_api = auto ; then
828 AC_MSG_WARN([Attempting to use NDBM. Functionality will be limited.])
832 ol_with_ldbm_api=ndbm
834 if test $ol_cv_lib_ndbm != yes ; then
835 LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
840 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
841 AC_MSG_WARN(could not find suitable LDBM backend)
842 if test $ol_enable_ldbm = yes ; then
843 AC_MSG_ERROR(select appropriate LDBM options or disable)
846 AC_MSG_WARN(disabling LDBM)
850 if test $ol_enable_wrappers = yes ; then
851 AC_CHECK_LIB(wrap, hosts_access,
852 [have_wrappers=yes], [have_wrappers=no])
854 if test $have_wrappers = yes ; then
856 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
858 AC_MSG_WARN(could not find -lwrap)
859 if test $ol_enable_wrappers = yes ; then
860 AC_MSG_ERROR(could not find wrappers, select appropriate options or disable)
863 AC_MSG_WARN(disabling wrappers support)
864 ol_enable_wrappers=no
869 # ud needs termcap (should insert check here)
871 AC_CHECK_HEADERS(termcap.h ncurses.h)
873 if test $ol_link_termcap = no ; then
874 AC_CHECK_LIB(termcap, tputs, [have_termcap=yes], [have_termcap=no])
875 if test $have_termcap = yes ; then
876 AC_DEFINE(HAVE_TERMCAP)
878 TERMCAP_LIBS=-ltermcap
882 if test $ol_link_termcap = no ; then
883 AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
884 if test $have_ncurses = yes ; then
885 AC_DEFINE(HAVE_NCURSES)
887 TERMCAP_LIBS=-lncurses
891 if test $ol_link_termcap = no ; then
892 AC_DEFINE(NO_TERMCAP,1)
896 # FreeBSD (and others) have crypt(3) in -lcrypt
897 if test $ol_enable_crypt != no ; then
898 AC_CHECK_FUNC(crypt, [have_crypt=yes], [
899 AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
900 have_crypt=yes], [have_crypt=no])])
902 if test $have_crypt = yes ; then
903 AC_DEFINE(HAVE_CRYPT,1)
905 AC_MSG_WARN(could not find crypt)
906 if test $ol_enable_crypt = yes ; then
907 AC_MSG_ERROR(could not find crypt, select appropriate options or disable)
910 AC_MSG_WARN(disabling crypt support)
915 # FreeBSD (and others) have setproctitle(3) in -lutil
916 if test $ol_enable_proctitle != no ; then
917 AC_CHECK_FUNC(setproctitle, [have_setproctitle=yes], [
918 AC_CHECK_LIB(util, setproctitle,
919 [have_setproctitle=yes
920 LUTIL_LIBS="$LUTIL_LIBS -lutil"],
921 [have_setproctitle=no
922 LIBOBJS="$LIBOBJS setproctitle.o"])])
924 if test $have_setproctitle = yes ; then
925 AC_DEFINE(HAVE_SETPROCTITLE,1)
929 dnl ----------------------------------------------------------------
930 dnl Checks for header files.
933 if test $ac_cv_header_stdc != yes; then
934 AC_MSG_WARN([could not Standard C compliant headers])
939 AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
940 if test $am_cv_sys_posix_termios = yes ; then
941 AC_DEFINE(HAVE_POSIX_TERMIOS,1)
977 dnl ----------------------------------------------------------------
978 dnl Checks for typedefs, structures, and compiler characteristics.
979 AC_TYPE_GETGROUPS dnl requires AC_TYPE_UID_T
993 if test $cross_compiling = yes ; then
994 AC_DEFINE(CROSS_COMPILING, 1)
997 AC_CHECK_SIZEOF(short)
999 AC_CHECK_SIZEOF(long)
1002 dnl ----------------------------------------------------------------
1003 dnl Checks for library functions.
1005 dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
1010 if test $ac_cv_func_vprintf = yes ; then
1011 dnl check for vsnprintf
1012 AC_CHECK_FUNCS(vsnprintf)
1048 dnl We actually may need to replace more than this.
1049 AC_REPLACE_FUNCS(getopt strdup tempnam)
1051 dnl ----------------------------------------------------------------
1052 # Check Configuration
1055 dnl ----------------------------------------------------------------
1056 dnl Sort out defines
1058 if test $ol_enable_debug != no ; then
1059 AC_DEFINE(LDAP_DEBUG,1)
1061 dnl if test $ol_enable_syslog != no ; then
1062 dnl AC_DEFINE(LDAP_SYSLOG,1)
1064 if test $ol_enable_libui = yes ; then
1065 AC_DEFINE(LDAP_LIBUI,1)
1067 if test $ol_enable_cache = no ; then
1068 AC_DEFINE(LDAP_NOCACHE,1)
1070 if test $ol_enable_dns != no ; then
1071 AC_DEFINE(LDAP_DNS,1)
1073 if test $ol_enable_proctitle != no ; then
1074 AC_DEFINE(LDAP_PROCTITLE,1)
1076 if test $ol_enable_referrals != no ; then
1077 AC_DEFINE(LDAP_REFERRALS,1)
1079 if test $ol_enable_cldap != no ; then
1080 AC_DEFINE(LDAP_CONNECTIONLESS,1)
1083 if test $ol_enable_aclgroups != no ; then
1084 AC_DEFINE(SLAPD_ACLGROUPS,1)
1086 if test $ol_enable_crypt != no ; then
1087 AC_DEFINE(SLAPD_CRYPT,1)
1089 if test $ol_enable_md5 != no ; then
1090 AC_DEFINE(SLAPD_MD5,1)
1092 if test $ol_enable_sha1 != no ; then
1093 AC_DEFINE(SLAPD_SHA1,1)
1095 if test $ol_enable_phonetic != no ; then
1096 AC_DEFINE(SLAPD_PHONETIC,1)
1098 if test $ol_enable_rlookups != no ; then
1099 AC_DEFINE(SLAPD_RLOOKUPS,1)
1102 if test $ol_link_ldbm != no ; then
1103 AC_DEFINE(SLAPD_LDBM,1)
1108 if test $ol_enable_passwd != no ; then
1109 AC_DEFINE(SLAPD_PASSWD,1)
1114 if test $ol_enable_shell != no ; then
1115 AC_DEFINE(SLAPD_SHELL,1)
1120 if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
1121 $BUILD_SLAPD = yes ; then
1125 if test $ol_link_isode != no ; then
1129 dnl ----------------------------------------------------------------
1131 AC_SUBST(BUILD_LDAPD)
1132 AC_SUBST(BUILD_SLAPD)
1133 AC_SUBST(BUILD_LDBM)
1134 AC_SUBST(BUILD_PASSWD)
1135 AC_SUBST(BUILD_SHELL)
1136 AC_SUBST(BUILD_SLURPD)
1140 AC_SUBST(LDAPD_LIBS)
1141 AC_SUBST(SLAPD_LIBS)
1142 AC_SUBST(SLURPD_LIBS)
1144 AC_SUBST(LTHREAD_LIBS)
1145 AC_SUBST(LUTIL_LIBS)
1148 AC_SUBST(TERMCAP_LIBS)
1150 dnl ----------------------------------------------------------------
1155 Makefile:build/top.mk:Makefile.in:build/dir.mk \
1156 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
1157 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
1158 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
1159 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
1160 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
1161 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
1162 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
1163 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
1164 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
1165 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
1166 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
1167 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
1168 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
1169 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
1170 include/Makefile:build/top.mk:include/Makefile.in \
1171 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk \
1172 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk \
1173 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk \
1174 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk \
1175 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk \
1176 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk \
1177 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk:build/lib-static.mk \
1178 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk \
1179 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
1180 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
1181 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
1182 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
1183 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
1184 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
1185 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
1186 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
1187 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
1188 tests/Makefile:build/top.mk:tests/Makefile.in \
1191 echo Please \"make depend\" to build dependencies