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.
8 dnl Configure.in for OpenLDAP
10 AC_INIT(include/ldap.h)
13 AC_PREREQ(2.10)dnl Required Autoconf version
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_CONFIG_AUX_DIR(build)
18 AC_CONFIG_HEADER(include/portable.h)dnl
21 AC_MSG_CHECKING(arguments)
22 AC_PREFIX_DEFAULT(/usr/local)
24 dnl General "enable" options
25 CF_ARG_OPTION(debug,[ --enable-debug enable debugging (yes)],[
26 LDAP_DEBUG=no],[LDAP_DEBUG=yes],yes)dnl
27 CF_ARG_OPTION(libui,[ --enable-libui enable library user interface (yes)],[
28 LDAP_LIBUI=no],[LDAP_LIBUI=yes],yes)dnl
29 CF_ARG_OPTION(cache,[ --enable-cache enable caching (yes)],[
30 LDAP_CACHE=no],[LDAP_CACHE=yes],yes)dnl
31 CF_ARG_OPTION(referrals,[ --enable-referrals enable referrals (yes)],[
32 LDAP_REFERRALS=no],[LDAP_REFERRALS=yes],yes)dnl
34 CF_ARG_OPTION(cldap,[ --enable-clapd enable connectionless ldap (no)],[
35 LDAP_CLDAP=yes],[LDAP_CLDAP=no],no)dnl
37 dnl General "with" options
38 AC_ARG_WITH(kerberos,[ --with-kerberos use Kerberos (no)],[
39 opt_kerberos=yes],[opt_kerberos=no])
40 AC_ARG_WITH(kerberos-afs,[ --with-kerberos-afs use AFS Kerberos (no)],[
41 opt_kerberos_afs=yes],[opt_kerberos_afs=no])
42 AC_ARG_WITH(threads,[ --with-threads use threads (yes)],[
43 opt_threads=yes],[opt_threads=no])
48 CF_ARG_OPTION(ldapd,[ --enable-ldapd enable building ldapd (no)],[
49 BUILD_LDAPD=yes],[BUILD_LDAPD=no],no)dnl
52 CF_ARG_OPTION(slapd,[ --enable-slapd enable building slapd (yes)],[
53 BUILD_SLAPD=no],[BUILD_SLAPD=yes],yes)dnl
54 CF_ARG_OPTION(aclgroup,[ --enable-aclgroup enable ACL group support (yes)],[
55 SLAPD_ACLGROUP=no],[SLAPD_ALCGROUP=yes],yes)dnl
56 CF_ARG_OPTION(crypt,[ --enable-crypt enable crypt(3) passwords (yes)],[
57 SLAPD_CRYPT=no],[SLAPD_CRYPT=yes],yes)dnl
58 CF_ARG_OPTION(md5,[ --enable-md5 enable MD5 passwords (yes)],[
59 SLAPD_MD5=no],[SLAPD_MD5=yes],yes)dnl
60 CF_ARG_OPTION(sha1,[ --enable-sha1 enable SHA1 passwords (yes)],[
61 SLAPD_SHA1=no],[SLAPD_SHA1=yes],yes)dnl
62 CF_ARG_OPTION(wrappers,[ --enable-wrappers enable tcp wrapper support (no)],[
63 SLAPD_TCP_WRAPPERS=yes],[LDAP_TCP_WRAPPERS=no],no)dnl
64 CF_ARG_OPTION(phonetic,[ --enable-phonetic enable phonetic/soundex (no)],[
65 SLAPD_PHONETIC=yes],[SLAPD_PHONETIC=no],no)dnl
66 CF_ARG_OPTION(rlookups,[ --enable-rlookups enable reverse lookups (yes)],[
67 SLAPD_RLOOKUP=no],[SLAPD_RLOOKUP=yes],yes)dnl
69 dnl SLAPD Backend options
70 CF_ARG_OPTION(ldbm,[ --enable-ldbm enable ldbm backend (yes)],[
71 SLAPD_LDBM=no],[SLAPD_LDBM=yes],yes)dnl
72 CF_ARG_OPTION(passwd,[ --enable-passwd enable passwd backend (yes)],[
73 SLAPD_PASSWD=no],[SLAPD_PASSWD=yes],yes)dnl
74 CF_ARG_OPTION(shell,[ --enable-shell enable shell backend (yes)],[
75 SLAPD_SHELL=no],[SLAPD_SHELL=yes],yes)dnl
77 AC_ARG_WITH(ndbm,[ --with-ndbm use NDB for LDBM backend (any)],[
78 opt_ndbm=yes],[opt_ndbm=no])
79 AC_ARG_WITH(gdbm,[ --with-gdbm use GDBM for LDBM backend (any)],[
80 opt_gdbm=yes],[opt_gdbm=no])
81 AC_ARG_WITH(dbhash,[ --with-dbhash use Berkeley DB Hash for LDBM backend (any)],[
82 opt_dbhash=yes],[opt_dbhash=no])
83 AC_ARG_WITH(dbbtree,[ --with-dbbtree use Berkeley DB Btrees for LDBM backend (any)],[
84 opt_dbbtree=yes],[opt_dbbtree=no])
85 AC_ARG_WITH(db2,[ --with-db2 use Berkeley DB2 API (any)],[
86 opt_db2=yes],[opt_db2=no])
89 CF_ARG_OPTION(slurpd,[ --enable-slurpd enable building slurpd (yes)],[
90 BUILD_SLURPD=no],[BUILD_SLURPD=yes],yes)dnl
94 AC_MSG_CHECKING(LDBM preferences)
97 if test "$opt_ndbm" = yes ; then
100 if test "$opt_gdbm" = yes ; then
103 if test "$opt_dbhash" = yes ; then
106 if test "$opt_dbbtree" = yes ; then
109 AC_MSG_RESULT($ldbm_prefer)
111 if test "$BUILD_SLAPD" != "yes" ; then
119 dnl general LDAP arguments
123 if test "$LDAP_DEBUG" = "yes" ; then
124 LDAP_DEFS="$LDAP_DEFS -DLDAP_DEBUG"
126 if test "$LDAP_REFERRALS" = "yes" ; then
127 AC_DEFINE(LDAP_REFERRALS,1)
128 LDAP_DEFS="$LDAP_DEFS -DLDAP_REFERRALS"
130 if test "$LDAP_CACHE" = "no" ; then
131 AC_DEFINE(LDAP_NOCACHE,1)
132 LDAP_DEFS="$LDAP_DEFS -DNO_CACHE"
134 if test "$LDAP_CLDAP" = "yes" ; then
135 AC_DEFINE(LDAP_CONNECTIONLESS,1)
136 LDAP_DEFS="$LDAP_DEFS -DCLDAP"
140 if test "$opt_thread" = "no" ; then
141 LTHREAD_DEFS="-DNO_THREADS"
144 LTHREAD_DEFS="-DNO_THREADS"
153 if test "$SLAPD_PHONETIC" = "yes" ; then
154 AC_DEFINE(SLAPD_PHONETIC,1)
155 SLAPD_DEFS="$SLAPD_DEFS -DSOUNDEX"
158 if test "$SLAPD_LDBM" = "yes" ; then
159 dnl AC_DEFINE(SLAPD_LDBM,1)
160 SLAPD_DEFS="$SLAPD_DEFS -DLDAP_LDBM"
162 if test "$SLAPD_PASSWD" = "yes" ; then
163 dnl AC_DEFINE(SLAPD_PASSWD,1)
164 SLAPD_DEFS="$SLAPD_DEFS -DLDAP_PASSWD"
166 if test "$SLAPD_SHELL" = "yes" ; then
167 dnl AC_DEFINE(SLAPD_SHELL,1)
168 SLAPD_DEFS="$SLAPD_DEFS -DLDAP_SHELL"
176 dnl Checks for programs.
178 AC_PROG_GCC_TRADITIONAL
185 AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail,
186 $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc)
187 AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi,
189 AC_PATH_PROG(FINGER, finger, /usr/ucb/finger,
196 if test "$SLAPD_LDBM" = "yes" ; then
197 if test $ldbm_prefer = any -o $ldbm_prefer = dbbtree \
198 -o $ldbm_prefer = dbhash ; then
199 AC_CHECK_FUNC(dbopen,[
200 ldbm_use=$ldbm_prefer
202 AC_CHECK_LIB(db,dbopen,[
203 ldbm_use=$ldbm_prefer
209 if test $ldbm_prefer = found ; then
210 if test $ldbm_use = dbhash ; then
211 dnl AC_DEFINE(LDBM_USE_DBHASH,1)
212 LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_DBHASH"
214 dnl AC_DEFINE(LDBM_USE_DBBTREE,1)
215 LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_DBBTREE"
220 if test $ldbm_prefer = any -o $ldbm_prefer = gdbm ; then
221 AC_CHECK_LIB(gdbm, gdbm_open,[
222 ldbm_use=$ldbm_prefer
225 dnl AC_DEFINE(LDBM_USE_GDBM,1)
226 LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_GDBM"
229 if test $ldbm_prefer = any -o $ldbm_prefer = ndbm ; then
230 AC_CHECK_LIB(dbm,dbm_open,[
234 dnl AC_DEFINE(LDBM_USE_NDBM,1)
235 LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_NDBM"
239 if test $ldbm_prefer != found ; then
240 AC_MSG_ERROR(could not find suitable db for $ldbm_prefer backend)
243 if test $ldbm_use = ndbm ; then
244 AC_MSG_WARN(LDBM using NDBM, functionality will be limited)
248 # ud needs termcap (should insert check here)
249 LIBTERMCAP="-ltermcap"
252 # FreeBSD (and others) have crypt(3) in -lcrypt
254 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT), [
255 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"
256 AC_DEFINE(HAVE_CRYPT)])
260 dnl Checks for header files.
278 dnl Checks for typedefs, structures, and compiler characteristics.
293 dnl Checks for library functions.
316 AC_REPLACE_FUNCS(strdup)
318 # Check Configuration
321 AC_SUBST(BUILD_LDAPD)
323 AC_SUBST(BUILD_SLAPD)
325 AC_SUBST(SLAPD_PASSWD)
326 AC_SUBST(SLAPD_SHELL)
328 AC_SUBST(BUILD_SLURPD)
336 AC_SUBST(SLURPD_DEFS)
337 AC_SUBST(SLURPD_LIBS)
340 AC_SUBST(LTHREAD_DEFS)
341 AC_SUBST(LTHREAD_LIBS)
344 dnl contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
345 dnl contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
346 dnl contrib/whois++/Makefile:build/top.mk:contrib/whois++/Makefile.in:build/rules.mk \
347 dnl [date > stamp-h])
350 Makefile:build/top.mk:Makefile.in:build/dir.mk \
351 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
352 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
353 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
354 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
355 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
356 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
357 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
358 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
359 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
360 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
361 include/Makefile:build/top.mk:include/Makefile.in \
362 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk \
363 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \
364 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \
365 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \
366 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \
367 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \
368 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
369 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
370 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
371 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
372 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
373 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
374 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
375 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
376 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
377 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
378 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
379 tests/Makefile:build/top.mk:tests/Makefile.in \