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 AC_SUBST(BUILD_LDAPD)
121 AC_SUBST(BUILD_SLAPD)
123 AC_SUBST(SLAPD_PASSWD)
124 AC_SUBST(SLAPD_SHELL)
126 AC_SUBST(BUILD_SLURPD)
129 dnl general LDAP arguments
133 if test "$LDAP_DEBUG" = "yes" ; then
134 LDAP_DEFS="$LDAP_DEFS -DLDAP_DEBUG"
136 if test "$LDAP_REFERRALS" = "yes" ; then
137 AC_DEFINE(LDAP_REFERRALS,1)
138 LDAP_DEFS="$LDAP_DEFS -DLDAP_REFERRALS"
140 if test "$LDAP_CACHE" = "no" ; then
141 AC_DEFINE(LDAP_NOCACHE,1)
142 LDAP_DEFS="$LDAP_DEFS -DNO_CACHE"
144 if test "$LDAP_CLDAP" = "yes" ; then
145 AC_DEFINE(LDAP_CONNECTIONLESS,1)
146 LDAP_DEFS="$LDAP_DEFS -DCLDAP"
150 if test "$opt_thread" = "no" ; then
151 LTHREAD_DEFS="-DNO_THREADS"
153 LTHREAD_DEFS="-DNO_THREADS"
162 if test "$SLAPD_PHONETIC" = "yes" ; then
163 AC_DEFINE(SLAPD_PHONETIC,1)
164 SLAPD_DEFS="$SLAPD_DEFS -DSOUNDEX"
167 if test "$SLAPD_LDBM" = "yes" ; then
168 AC_DEFINE(SLAPD_LDBM,1)
169 dnl SLAPD_DEFS="$SLAPD_DEFS -DSLAPD_LDBM"
171 if test "$SLAPD_PASSWD" = "yes" ; then
172 AC_DEFINE(SLAPD_PASSWD,1)
173 dnl SLAPD_DEFS="$SLAPD_DEFS -DSLAPD_PASSWD"
175 if test "$SLAPD_SHELL" = "yes" ; then
176 AC_DEFINE(SLAPD_SHELL,1)
177 dnl SLAPD_DEFS="$SLAPD_DEFS -DSLAPD_SHELL"
185 dnl Checks for programs.
187 AC_PROG_GCC_TRADITIONAL
194 AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail,
195 $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc)
196 AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi,
198 AC_PATH_PROG(FINGER, finger, /usr/ucb/finger,
205 if test "$SLAPD_LDBM" = "yes" ; then
206 if test $ldbm_prefer = any -o $ldbm_prefer = dbbtree \
207 -o $ldbm_prefer = dbhash ; then
208 AC_CHECK_FUNC(dbopen,[
209 ldbm_use=$ldbm_prefer
211 AC_CHECK_LIB(db,dbopen,[
212 ldbm_use=$ldbm_prefer
218 if test $ldbm_prefer = found ; then
219 if test $ldbm_use = dbhash ; then
220 dnl AC_DEFINE(LDBM_USE_DBHASH,1)
221 LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_DBHASH"
223 dnl AC_DEFINE(LDBM_USE_DBBTREE,1)
224 LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_DBBTREE"
229 if test $ldbm_prefer = any -o $ldbm_prefer = gdbm ; then
230 AC_CHECK_LIB(gdbm, gdbm_open,[
231 ldbm_use=$ldbm_prefer
234 dnl AC_DEFINE(LDBM_USE_GDBM,1)
235 LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_GDBM"
238 if test $ldbm_prefer = any -o $ldbm_prefer = ndbm ; then
239 AC_CHECK_LIB(dbm,dbm_open,[
243 dnl AC_DEFINE(LDBM_USE_NDBM,1)
244 LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_NDBM"
248 if test $ldbm_prefer != found ; then
249 AC_MSG_ERROR(could not find suitable db for $ldbm_prefer backend)
252 if test $ldbm_use = ndbm ; then
253 AC_MSG_WARN(LDBM using NDBM, functionality will be limited)
257 # ud needs termcap (should insert check here)
258 LIBTERMCAP="-ltermcap"
261 # FreeBSD has obsoleted re_comp(3) from -lc, needs -lcompat
262 AC_CHECK_LIB(compat, re_comp)
264 # FreeBSD (and others) have crypt(3) in -lcrypt
266 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT), [
267 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"
268 AC_DEFINE(HAVE_CRYPT)])
272 dnl Checks for header files.
290 dnl Checks for typedefs, structures, and compiler characteristics.
305 dnl Checks for library functions.
328 AC_REPLACE_FUNCS(strdup)
330 # Check Configuration
339 AC_SUBST(SLURPD_DEFS)
340 AC_SUBST(SLURPD_LIBS)
343 AC_SUBST(LTHREAD_DEFS)
344 AC_SUBST(LTHREAD_LIBS)
347 dnl contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
348 dnl contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
349 dnl contrib/whois++/Makefile:build/top.mk:contrib/whois++/Makefile.in:build/rules.mk \
350 dnl servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
351 dnl servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
352 dnl servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
353 dnl servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
354 dnl servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
355 dnl servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
356 dnl servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
357 dnl Makefile:build/top.mk:Makefile.in:build/dir.mk, \
358 dnl [date > stamp-h])
361 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
362 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
363 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
364 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
365 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
366 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
367 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
368 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
369 include/Makefile:build/top.mk:include/Makefile.in \
370 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk \
371 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \
372 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \
373 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \
374 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \
375 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \
376 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
377 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
378 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
379 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
380 tests/Makefile:build/top.mk:tests/Makefile.in \
381 Makefile:build/top.mk:Makefile.in:build/dir.mk \