]> git.sur5r.net Git - openldap/blob - configure.in
Should not have freed ber_buf when freeing temp copy
[openldap] / configure.in
1 dnl
2 dnl Copyright 1998,1999 The OpenLDAP Foundation.  All Rights Reserved.
3 dnl 
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.
8 dnl
9
10 dnl Disable config.cache!
11 define([AC_CACHE_LOAD], )dnl
12 define([AC_CACHE_SAVE], )dnl
13
14 dnl Configure.in for OpenLDAP
15 AC_INIT(include/ldap.h)dnl
16 AC_CONFIG_AUX_DIR(build)dnl
17 AM_INIT_AUTOMAKE(OpenLDAP,[2.0-devel])dnl
18 AC_SUBST(PACKAGE)
19 AC_SUBST(VERSION)
20
21 dnl We use autoconf features new to 2.13.
22 dnl     aclocal.m4 should be built using aclocal from automake 1.4
23 AC_PREREQ(2.13)dnl Required Autoconf version
24
25 AC_CONFIG_HEADER(include/portable.h include/ldap_features.h)dnl
26
27 dnl
28 dnl Start Args
29 AC_MSG_CHECKING(configure arguments)
30 AC_PREFIX_DEFAULT(/usr/local)
31
32 top_builddir=`pwd`
33 AC_SUBST(top_builddir)dnl
34
35 AC_DEFINE(HAVE_MKVERSION, 1, [define this if you have mkversion])
36
37 ldap_subdir="openldap"
38
39 AC_ARG_WITH(subdir, [  --with-subdir=DIR change default subdirectory used for installs], [
40         if test "$withval" = "no"; then
41                 ldap_subdir=""
42         elif test "$withval" != "yes"; then
43                 ldap_subdir="$withval"
44         fi
45 ])dnl
46
47 AC_SUBST(ldap_subdir)dnl
48
49 OL_ARG_ENABLE(debug,[  --enable-debug   enable debugging], yes)dnl
50 dnl ol_enable_syslog=no
51 OL_ARG_ENABLE(syslog,[  --enable-syslog enable syslog support], auto)dnl
52 OL_ARG_ENABLE(proctitle,[  --enable-proctitle   enable proctitle support], yes)dnl
53 OL_ARG_ENABLE(cache,[  --enable-cache   enable caching], yes)dnl
54 OL_ARG_ENABLE(dns,[  --enable-dns               enable V2 DNS  extension], no)dnl
55 OL_ARG_ENABLE(referrals,[  --enable-referrals   enable V2 Referrals extension], yes)dnl
56 OL_ARG_ENABLE(cldap,[  --enable-cldap   enable connectionless ldap], no)dnl
57 OL_ARG_ENABLE(x_compile,[  --enable-x-compile   enable cross compiling],
58         no, [yes no])dnl
59
60 dnl General "with" options
61 OL_ARG_ENABLE(dmalloc,[  --enable-dmalloc       enable debug malloc support], no)dnl
62
63 OL_ARG_WITH(kerberos,[  --with-kerberos with Kerberos support],
64         auto, [auto k5 k4 afs yes no])
65 OL_ARG_WITH(readline,[  --with-readline  with readline support],
66         auto, [auto yes no] )
67 OL_ARG_WITH(threads,[  --with-threads   use threads],
68         auto, [auto posix mach lwp yes no manual] )
69 OL_ARG_WITH(tls,[  --with-tls  with TLS/SSL support],
70         auto, [auto ssleay openssl yes no] )
71 OL_ARG_WITH(yielding_select,[  --with-yielding-select   with implicitly yielding select],
72         auto, [auto yes no manual] )
73
74 dnl Server options
75
76 dnl LDAPD OPTIONS
77 AC_ARG_WITH(xxldapdoptions,[LDAPD Options:])
78 OL_ARG_ENABLE(ldapd,[  --enable-ldapd   enable building ldapd], no)dnl
79
80 dnl SLAPD OPTIONS
81 AC_ARG_WITH(xxslapdoptions,[SLAPD Options:])
82 OL_ARG_ENABLE(slapd,[  --enable-slapd   enable building slapd], yes)dnl
83 OL_ARG_ENABLE(aclgroups,[    --enable-aclgroups enable ACL group support], auto)dnl
84 OL_ARG_ENABLE(cleartext,[    --enable-cleartext enable cleartext passwords], yes)dnl
85 OL_ARG_ENABLE(crypt,[    --enable-crypt enable crypt(3) passwords], auto)dnl
86 OL_ARG_ENABLE(modules,[    --enable-modules     enable dynamic module support], no)dnl
87 OL_ARG_ENABLE(phonetic,[    --enable-phonetic   enable phonetic/soundex], no)dnl
88 OL_ARG_ENABLE(rlookups,[    --enable-rlookups   enable reverse lookups], auto)dnl
89 OL_ARG_ENABLE(wrappers,[    --enable-wrappers   enable tcp wrapper support], no)dnl
90
91 dnl SLAPD Backend options
92 OL_ARG_ENABLE(bdb2,[    --enable-bdb2   enable bdb2 backend], no)dnl
93 OL_ARG_ENABLE(ldbm,[    --enable-ldbm   enable ldbm backend], yes)dnl
94 OL_ARG_WITH(ldbm_api,[      --with-ldbm-api     use LDBM API], auto,
95         [auto db2 db mdbm gdbm ndbm manual])
96 OL_ARG_WITH(ldbm_type,[      --with-ldbm-type   use LDBM type], auto,
97         [auto btree hash])
98
99 OL_ARG_ENABLE(passwd,[    --enable-passwd       enable passwd backend], no)dnl
100 OL_ARG_ENABLE(perl,[    --enable-perl   enable perl backend], no)dnl
101 OL_ARG_ENABLE(shell,[    --enable-shell enable shell backend], no)dnl
102 OL_ARG_ENABLE(tcl,[    --enable-tcl     enable tcl backend], no)dnl
103
104 dnl SLURPD OPTIONS
105 AC_ARG_WITH(xxslurpdoptions,[SLURPD Options:])
106 OL_ARG_ENABLE(slurpd,[  --enable-slurpd enable building slurpd], auto)dnl
107
108 AC_ARG_WITH(xxliboptions,[Library Generation & Linking Options])
109 AM_ENABLE_STATIC
110 dnl AM_DISABLE_SHARED
111 AM_ENABLE_SHARED
112
113 dnl General "enable" options
114 # validate options
115 if test $ol_enable_dns = yes ; then
116         if test $ol_enable_referrals = no ; then
117                 AC_MSG_ERROR([DNS requires --enable-referrals])
118         fi
119         if test $ol_enable_referrals = auto ; then
120                 AC_MSG_WARN([DNS requires referrals, adding --enable-referrals])
121                 ol_enable_referrals=yes
122         fi
123 fi
124
125 if test $ol_enable_slapd = no ; then
126         dnl SLAPD was specificallly disabled
127         if test $ol_enable_bdb2 = yes ; then
128                 AC_MSG_WARN([slapd disabled, ignoring --enable_bdb2 argument])
129         fi
130         if test $ol_enable_ldbm = yes ; then
131                 AC_MSG_WARN([slapd disabled, ignoring --enable_ldbm argument])
132         fi
133         if test $ol_enable_passwd = yes ; then
134                 AC_MSG_WARN([slapd disabled, ignoring --enable_passwd argument])
135         fi
136         if test $ol_enable_perl = yes ; then
137                 AC_MSG_WARN([slapd disabled, ignoring --enable_perl argument])
138         fi
139         if test $ol_enable_shell = yes ; then
140                 AC_MSG_WARN([slapd disabled, ignoring --enable_shell argument])
141         fi
142         if test $ol_enable_tcl = yes ; then
143                 AC_MSG_WARN([slapd disabled, ignoring --enable_tcl argument])
144         fi
145         if test $ol_enable_aclgroups = yes ; then
146                 AC_MSG_WARN([slapd disabled, ignoring --enable_aclgroups argument])
147         fi
148         if test $ol_enable_modules = yes ; then
149                 AC_MSG_WARN([slapd disabled, ignoring --enable_modules argument])
150         fi
151         if test $ol_enable_wrappers = yes ; then
152                 AC_MSG_WARN([slapd disabled, ignoring --enable_wrappers argument])
153         fi
154         if test $ol_enable_phonetic = yes ; then
155                 AC_MSG_WARN([slapd disabled, ignoring --enable_phonetic argument])
156         fi
157         if test $ol_enable_rlookups = yes ; then
158                 AC_MSG_WARN([slapd disabled, ignoring --enable_rlookups argument])
159         fi
160         if test $ol_with_ldbm_api != auto ; then
161                 AC_MSG_WARN([slapd disabled, ignoring --with_ldbm_api argument])
162         fi
163         if test $ol_with_ldbm_type != auto ; then
164                 AC_MSG_WARN([slapd disabled, ignoring --with_ldbm_type argument])
165         fi
166         if test $ol_enable_slurpd = yes ; then
167                 AC_MSG_ERROR([slurpd requires slapd])
168         fi
169
170         # force settings to no
171         ol_enable_bdb2=no
172         ol_enable_ldbm=no
173         ol_enable_passwd=no
174         ol_enable_perl=no
175         ol_enable_shell=no
176         ol_enable_tcl=no
177
178         ol_enable_aclgroups=no
179         ol_enable_modules=no
180         ol_enable_phonetic=no
181         ol_enable_rlookups=no
182         ol_enable_wrappers=no
183
184         ol_with_ldbm_api=no
185         ol_with_ldbm_type=no
186
187         ol_enable_slurpd=no
188
189 elif test $ol_enable_ldbm = no ; then
190         dnl SLAPD without LDBM
191
192         if test $ol_with_ldbm_api != auto ; then
193                 AC_MSG_WARN([LDBM disabled, ignoring --with_ldbm_api argument])
194         fi
195
196         if test $ol_with_ldbm_type != auto ; then
197                 AC_MSG_WARN([LDBM disabled, ignoring --with_ldbm_type argument])
198         fi
199
200         if test $ol_enable_bdb2 = yes ; then
201                 AC_MSG_ERROR([BDB2 requires --enable-ldbm])
202         fi
203
204         if test $ol_enable_modules != yes -a \
205                 $ol_enable_passwd = no -a \
206                 $ol_enable_perl = no -a \
207                 $ol_enable_shell = no -a \
208                 $ol_enable_tcl = no ; then
209                 AC_MSG_ERROR([slapd requires a backend])
210         fi
211
212         ol_with_ldbm_api=no
213         ol_with_ldbm_type=no
214
215 elif test $ol_enable_bdb2 = yes ; then
216         dnl SLAPD with BDB2
217
218         if test $ol_with_ldbm_api != auto -a \
219                 $ol_with_ldbm_api != db2 ; then
220                 AC_MSG_ERROR([BDB2 requires LDBM API DB2])
221         fi
222
223         ol_with_ldbm_api=db2
224
225 else
226         dnl SLAPD with LDBM
227
228         if test $ol_enable_bdb2 != no ; then
229                 if test $ol_with_ldbm_api != auto -a \
230                         $ol_with_ldbm_api != db2 ; then
231                         AC_MSG_WARN([BDB2 requires LDBM api db2 or auto])
232                         ol_enable_bdb2=no
233                 fi
234         fi
235
236         if test $ol_with_ldbm_api = gdbm -a \
237                 $ol_with_ldbm_type = btree ; then
238                 AC_MSG_ERROR([GDBM only supports LDBM type hash])
239         fi
240         if test $ol_with_ldbm_api = mdbm -a \
241                 $ol_with_ldbm_type = btree ; then
242                 AC_MSG_ERROR([MDBM only supports LDBM type hash])
243         fi
244         if test $ol_with_ldbm_api = ndbm -a \
245                 $ol_with_ldbm_type = btree ; then
246                 AC_MSG_ERROR([NDBM only supports LDBM type hash])
247         fi
248 fi
249
250 if test $ol_enable_slurpd = yes ; then
251         dnl SLURPD was specifically enabled
252         if test $ol_with_threads = no ; then
253                 AC_MSG_ERROR([slurpd requires threads])
254         fi
255 fi
256
257 AC_MSG_RESULT(done)
258
259 ## Initialize vars
260 LDAP_LIBS=
261 LDBM_LIBS=
262 LTHREAD_LIBS=
263 LUTIL_LIBS=
264
265 LDAPD_LIBS=
266 SLAPD_LIBS=
267 SLURPD_LIBS=
268
269 BUILD_LDAPD=no
270 BUILD_SLAPD=no
271 BUILD_SLURPD=no
272
273 BUILD_BDB2=no
274 BUILD_LDBM=no
275 BUILD_PASSWD=no
276 BUILD_PERL=no
277 BUILD_SHELL=no
278 BUILD_TCL=no
279 BUILD_THREAD=no
280
281 SLAPD_MODULES_LDFLAGS=
282 SLAPD_MODULES_CPPFLAGS=
283
284 SLAPD_PERL_LDFLAGS=
285 SLAPD_PERL_CPPFLAGS=
286
287 KRB_LIBS=
288 READLINE_LIBS=
289 TERMCAP_LIBS=
290 TLS_LIBS=
291
292 dnl ----------------------------------------------------------------
293 dnl Checks for programs
294
295 AC_PROG_INSTALL
296
297 dnl The default compiler is cc (NOT gcc)
298 CC=${CC-"cc"}
299 dnl The default CFLAGS is empty NOT whatever AC_PROG_CC sets.
300 dnl CFLAGS=${CFLAGS-""}
301
302 AM_PROG_LIBTOOL
303 dnl AC_PROG_MAKE_SET
304
305 AC_PROG_AWK
306 OL_PROG_LN_H
307 AC_PROG_LN_S
308
309 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
310         LN_S="$LN_H"
311 fi
312
313 AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail,
314         $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc)
315 AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi, $PATH:/usr/ucb)
316 AC_PATH_PROG(FINGER, finger, /usr/ucb/finger, $PATH:/usr/ucb)
317
318 ol_link_modules=no
319 if test $ol_enable_modules != no ; then
320         AC_PATH_PROG(GLIBCONFIG, glib-config)
321
322         if test "no$GLIBCONFIG" = "no" ; then
323                 if test $ol_enable_modules = yes ; then
324                         AC_MSG_ERROR([could not locate glib-config])
325                 fi
326
327         else
328                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
329                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
330                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
331
332                 dnl should check glib version
333                 ol_link_modules=yes
334         fi
335 fi
336
337 ol_link_perl=no
338 if test $ol_enable_perl != no ; then
339         AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl)
340
341         if test "no$PERLBIN" = "no" ; then
342                 if test $ol_enable_perl = yes ; then
343                         AC_MSG_ERROR([could not locate perl])
344                 fi
345
346         else
347                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
348                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
349
350                 dnl should check perl version
351                 ol_link_perl=yes
352         fi
353 fi
354
355 AC_PROG_CPP
356
357 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
358         AC_MSG_WARN([cross compiling....  some functionality will be removed.])
359
360 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
361         AC_MSG_WARN([programs compiled here do run here...])
362         AC_MSG_ERROR([  if not cross compiling, use --disable-x-compile.])
363
364 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
365         AC_MSG_WARN([programs compiled here do not run here...])
366         AC_MSG_ERROR([  if cross compiling,  add --enable-x-compile.])
367 fi
368
369 dnl Checks for UNIX Variants
370 AC_AIX
371 AC_ISC_POSIX
372 AC_MINIX
373
374 dnl BeOS requires -lbe -lroot -lnet
375 AC_CHECK_LIB(be, be_app, [LIBS="$LIBS -lbe -lroot"], :, [-lroot])
376
377 dnl Checks for system services
378 AC_CYGWIN
379 AC_MINGW32
380 AC_EXEEXT
381 AC_OBJEXT
382
383 AC_DEFINE_UNQUOTED( EXEEXT, "${EXEEXT}", [defined to be the EXE extension])
384
385 dnl OpenLDAP requires STDC features
386 AM_PROG_CC_STDC
387 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
388         AC_MSG_ERROR([OpenLDAP requires compiler to support STDC prototypes.])
389 fi
390
391 dnl AM_C_PROTOTYPES
392
393 dnl Checks for libraries
394
395 dnl Find socket()
396 dnl Likely combinations:
397 dnl             -lsocket [ -lnsl_s | -lnsl ]
398 dnl             -linet
399
400 AC_CHECK_FUNC(socket, :, [      
401 dnl
402 dnl hopefully we won't include too many libraries
403 dnl
404         AC_CHECK_LIB(socket, main)
405         AC_CHECK_LIB(net, main)
406         AC_CHECK_LIB(net, socket)
407         AC_CHECK_LIB(nsl_s, main)
408         AC_CHECK_LIB(nsl, main)
409         AC_CHECK_LIB(inet, socket)
410         AC_CHECK_LIB(gen, main)
411 ])
412
413 dnl Check for resolver routines
414 AC_CHECK_FUNCS(res_search)
415 if test $ac_cv_func_res_search = "no" ; then 
416         AC_CHECK_LIB(bind, res_search)
417         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
418                 AC_DEFINE(HAVE_RES_SEARCH,1)
419         else
420                 AC_CHECK_LIB(resolv, res_search)
421                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
422                         AC_DEFINE(HAVE_RES_SEARCH,1)
423                 fi
424         fi
425 fi
426
427 dnl HP-UX requires -lV3
428 AC_CHECK_LIB(V3, sigset)
429
430 AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
431
432 dnl Select arg types
433 dnl (if this detection becomes permenent, it and the select() detection
434 dnl should be done before the yielding select test) 
435 AC_FUNC_SELECT_ARGTYPES
436
437 # ISODE tests
438 ol_link_isode=no
439 if test $ol_enable_ldapd != no ; then
440         dnl look for ISODE libraries
441         AC_CHECK_LIB(xtpp, main, [
442                 ol_link_isode=yes
443                 AC_DEFINE(HAVE_XTPP,1, [define if you have -lxttp])
444                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
445                 ],:,[-lxtdsap -lxtisode -losi])
446         AC_CHECK_LIB(dsap, main, [
447                 ol_link_isode=yes
448                 AC_DEFINE(HAVE_DSAP,1, [define if you have -ldsap])
449                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
450                 ],:,[-lisode])
451         AC_CHECK_LIB(isode, main, [
452                 ol_link_isode=yes
453                 AC_DEFINE(HAVE_ISODE,1, [define if you have -lisode])
454                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
455                 ],:)
456 fi
457
458 if test $ol_link_isode != no; then
459         AC_CHECK_LIB(pp, main, [
460                 AC_DEFINE(HAVE_PP,1, [define if you have -lpp])
461                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
462                 ],:)
463
464         AC_PATH_PROG(PEPSY, pepsy)
465 fi
466
467 dnl
468 dnl check for kerberos
469 dnl
470 ol_link_kerberos=no
471
472 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
473         AC_CHECK_HEADERS(kerberosIV/krb.h kerberosIV/des.h)
474
475         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
476                 AC_CHECK_LIB(krb4, main, [have_k5=yes], [have_k5=no],
477                         [-lkrb5 -ldes425])
478
479                 if test $have_k5 = yes ; then
480                         ol_with_kerberos=found
481                         ol_link_kerberos=yes
482
483                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
484
485                         LIBS="$KRB_LIBS $LIBS"
486
487                         AC_CACHE_CHECK([for des_debug in Kerberos libraries],
488                                 [ol_cv_var_des_debug], [
489                                 dnl save the flags
490                                 save_LIBS="$LIBS"
491                                 LIBS="$KRB_LIBS $LIBS"
492                                 AC_TRY_LINK([
493 #include <kerberosIV/krb.h>
494 #include <kerberosIV/des.h>
495 extern int des_debug;
496 ],[
497 des_debug = 1;
498 ],                              ol_cv_var_des_debug=yes, ol_cv_var_des_debug=no)
499                                 dnl restore the LIBS
500                                 LIBS="$save_LIBS"
501                         ])
502
503                         if test $ol_cv_var_des_debug = yes ; then
504                                 AC_DEFINE(HAVE_DES_DEBUG,1,
505                                         [define if you have Kerberos des_debug])
506                         fi
507
508                         LIBS="$save_LIBS"
509                 fi
510         fi
511 fi
512
513 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
514         AC_CHECK_HEADERS(krb.h des.h)
515
516         if test $ac_cv_header_krb_h = yes ; then
517                 AC_CHECK_LIB(krb, main, [have_k4=yes], [have_k4=no], [-ldes])
518
519                 if test $have_k4 = yes ; then
520                         ol_with_kerberos=found
521                         ol_link_kerberos=yes
522
523                         KRB_LIBS="-lkrb -ldes"
524                 fi
525         fi
526 fi
527
528 if test $ol_link_kerberos = yes ; then
529         AC_DEFINE(HAVE_KERBEROS, 1, [define if you have Kerberos])
530 fi
531
532 dnl
533 dnl Check for SSL/TLS
534 dnl
535 ol_link_tls=no
536 if test $ol_with_tls != no ; then
537         
538         AC_CHECK_HEADERS(ssl.h)
539         
540         if test $ac_cv_header_ssl_h = yes ; then
541                 AC_CHECK_LIB(ssl, SSLeay_add_ssl_algorithms, 
542                         [have_ssleay=yes
543                         need_rsaref=no],
544                         [have_ssleay=no],
545                         [-lcrypto])
546                         
547                 if test $have_ssleay = no ; then
548                         AC_CHECK_LIB(ssl, ssl3_accept, 
549                                 [have_ssleay=yes
550                                 need_rsaref=yes], [have_ssleay=no],
551                                 [-lcrypto -lRSAglue -lrsaref])
552                 fi
553
554                 if test $have_ssleay = yes ; then
555                         ol_with_tls=found
556                         ol_link_tls=yes
557
558                         AC_DEFINE(HAVE_SSLEAY, 1, 
559                                 [define if you have SSLeay or OpenSSL])
560
561                         if test $need_rsaref = yes; then
562                                 AC_DEFINE(HAVE_RSAREF, 1, 
563                                         [define if you have RSAref])
564
565                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
566                         else
567                                 TLS_LIBS="-lssl -lcrypto"
568                         fi
569                 fi
570         fi
571 fi
572
573 if test $ol_link_tls = yes ; then
574         AC_DEFINE(HAVE_TLS, 1, [define if you have TLS])
575 fi      
576
577 dnl Tests for reentrant functions necessary to build a
578 dnl thread_safe -lldap.
579 AC_CHECK_FUNCS(         \
580         ctime_r                 \
581         gethostbyname_r gethostbyaddr_r \
582 )
583
584 if test "$ac_cv_func_ctime_r" = no ; then
585         ol_cv_func_ctime_r_nargs=0
586 else
587         OL_FUNC_CTIME_R_NARGS
588 dnl     OL_FUNC_CTIME_R_TYPE
589 fi
590
591 if test "$ac_cv_func_gethostbyname_r" = yes ; then
592         OL_FUNC_GETHOSTBYNAME_R_NARGS
593 else
594         ol_cv_func_gethostbyname_r_nargs=0
595 fi
596  
597 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
598         OL_FUNC_GETHOSTBYADDR_R_NARGS
599 else
600         ol_cv_func_gethostbyaddr_r_nargs=0
601 fi
602
603 if test "$ac_cv_func_ctime_r" = yes \
604         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
605         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
606         -a "$ac_cv_func_gethostbyname_r" = yes \
607         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
608         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
609         -a "$ac_cv_func_gethostbyaddr_r" = yes \
610         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
611         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
612         ; then
613  
614         AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_REENTRANT,1)
615 fi
616
617 ol_link_threads=no
618 if test $ol_with_threads = auto -o $ol_with_threads = yes \
619         -o $ol_with_threads = posix ; then
620
621         AC_CHECK_HEADERS(pthread.h sched.h)
622
623         if test $ac_cv_header_pthread_h = yes ; then
624                 OL_POSIX_THREAD_VERSION
625
626                 if test $ol_cv_pthread_version = final ; then
627                         AC_DEFINE(HAVE_PTHREADS_FINAL,1,
628                                 [define if pthreads API compatible with final spec])
629                 elif test $ol_cv_pthread_version = draft4 ; then
630                         AC_DEFINE(HAVE_PTHREADS_D4,1,
631                                 [define if pthreads API compatible with draft4 spec])
632                 else
633                         AC_MSG_ERROR([unknown pthread version])
634                 fi
635
636                 # consider threads found
637                 ol_with_threads=found
638
639                 OL_HEADER_LINUX_THREADS
640
641                 dnl Now the hard part, how to link?
642                 dnl
643                 dnl currently supported checks:
644                 dnl
645                 dnl Check for no flags 
646                 dnl     pthread_create() in $LIBS
647                 dnl
648                 dnl Check special pthread (final) flags
649                 dnl     pthread_create() with -mt (Solaris)
650                 dnl     pthread_create() with -kthread (FreeBSD)
651                 dnl     pthread_create() with -pthread (FreeBSD/Digital Unix)
652                 dnl     pthread_create() with -pthreads (?)
653                 dnl     pthread_create() with -thread (?)
654                 dnl
655                 dnl Check pthread (final) libraries
656                 dnl     pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1)
657                 dnl     pthread_mutex_lock() in -lpthread -lmach -lexc (OSF/1)
658                 dnl     (skipped) pthread_mutex_trylock() in -lpthread -lexc (OSF/1)
659                 dnl     pthread_join() -Wl,-woff,85 -lpthread (IRIX)
660                 dnl     pthread_create() in -lpthread (many)
661                 dnl     pthread_create() in -lc_r (FreeBSD)
662                 dnl
663                 dnl Check pthread (draft4) flags (depreciated)
664                 dnl     pthread_create() with -threads (OSF/1)
665                 dnl
666                 dnl Check pthread (draft4) libraries (depreciated)
667                 dnl     pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
668                 dnl     pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
669                 dnl     pthread_mutex_trylock() in -lpthreads -lexc (OSF/1)
670                 dnl     pthread_create() in -lpthreads (many)
671                 dnl
672
673                 dnl pthread_create in $LIBS
674                 AC_MSG_CHECKING([for pthread_create in default libraries])
675                 AC_CACHE_VAL(ol_cv_pthread_create,[
676                 AC_TRY_RUN([
677 #include <pthread.h>
678 #ifndef NULL
679 #define NULL (void*)0
680 #endif
681
682 static void *task(p)
683         void *p;
684 {
685         return (void *) (p == NULL);
686 }
687
688 int main(argc, argv)
689         int argc;
690         char **argv;
691 {
692         pthread_t t;
693         int status;
694
695         /* make sure pthread_create() isn't just a stub */
696 #if HAVE_PTHREADS_D4
697         status = pthread_create(&t, pthread_attr_default, task, NULL);
698 #else
699         status = pthread_create(&t, NULL, task, NULL);
700 #endif
701
702         if( status ) return status;
703
704         /* make sure pthread_detach() isn't just a stub */
705 #if HAVE_PTHREADS_D4
706         status = pthread_detach( &t );
707 #else
708         status = pthread_detach( t );
709 #endif
710
711         if( status ) return status;
712
713         return status;
714 }
715 ],
716                         [ol_cv_pthread_create=yes],
717                         [ol_cv_pthread_create=no],
718                         [dnl assume yes
719                         ol_cv_pthread_create=yes])])
720                 AC_MSG_RESULT($ol_cv_pthread_create)
721
722                 if test $ol_cv_pthread_create != no ; then
723                         ol_link_threads=posix
724                         ol_link_pthreads=""
725                 fi
726                 
727                 OL_PTHREAD_TRY_LINK([-mt],              [ol_cv_pthread_mt])
728                 OL_PTHREAD_TRY_LINK([-kthread], [ol_cv_pthread_kthread])
729                 OL_PTHREAD_TRY_LINK([-pthread], [ol_cv_pthread_pthread])
730                 OL_PTHREAD_TRY_LINK([-pthreads],[ol_cv_pthread_pthreads])
731                 OL_PTHREAD_TRY_LINK([-thread],  [ol_cv_pthread_thread])
732
733                 OL_PTHREAD_TRY_LINK([-lpthread -lmach -lexc -lc_r],
734                         [ol_cv_pthread_lpthread_lmach_lexc_lc_r])
735                 OL_PTHREAD_TRY_LINK([-lpthread -lmach -lexc],
736                         [ol_cv_pthread_lpthread_lmach_lexc])
737 dnl             OL_PTHREAD_TRY_LINK([-lpthread -lexc],
738 dnl                     [ol_cv_pthread_lpthread_lexc])
739
740                 OL_PTHREAD_TRY_LINK([-lpthread -Wl,-woff,85],
741                         [ol_cv_pthread_lib_lpthread_woff])
742
743                 OL_PTHREAD_TRY_LINK([-lpthread],[ol_cv_pthread_lpthread])
744                 OL_PTHREAD_TRY_LINK([-lc_r],    [ol_cv_pthread_lc_r])
745
746                 OL_PTHREAD_TRY_LINK([-threads], [ol_cv_pthread_threads])
747
748                 OL_PTHREAD_TRY_LINK([-lpthreads -lmach -lexc -lc_r],
749                         [ol_cv_pthread_lpthreads_lmach_lexc_lc_r])
750                 OL_PTHREAD_TRY_LINK([-lpthreads -lmach -lexc],
751                         [ol_cv_pthread_lpthreads_lmach_lexc])
752                 OL_PTHREAD_TRY_LINK([-lpthreads -lexc],
753                         [ol_cv_pthread_lpthreads_lexc])
754
755                 OL_PTHREAD_TRY_LINK([-lpthreads],       [ol_cv_pthread_lib_lpthreads])
756
757                 if test $ol_link_threads != no ; then
758                         AC_DEFINE(HAVE_PTHREADS,1,
759                                 [define if you have POSIX Threads])
760
761                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
762
763                         dnl save flags
764                         save_CPPFLAGS="$CPPFLAGS"
765                         save_LIBS="$LIBS"
766                         LIBS="$LTHREAD_LIBS $LIBS"
767
768                         dnl All POSIX Thread (final) implementations should have
769                         dnl sched_yield instead of pthread yield.
770                         dnl check for both
771                         AC_CHECK_FUNCS(sched_yield pthread_yield)
772
773                         if test $ac_cv_func_sched_yield = no -a \
774                                 $ac_cv_func_pthread_yield = no ; then
775                                 dnl Digital UNIX has sched_yield() in -lrt
776                                 AC_CHECK_LIB(rt, sched_yield,
777                                         [LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
778                                         AC_DEFINE(HAVE_SCHED_YIELD,1)
779                                         ac_cv_func_sched_yield=yes],
780                                         [ac_cv_func_sched_yield=no])
781                         fi
782                         if test $ac_cv_func_sched_yield = no -a \
783                                 $ac_cv_func_pthread_yield = no ; then
784                                 dnl Solaris has sched_yield() stub in -lposix4
785                                 dnl but we'll use thr_yield instead.
786                                 AC_CHECK_FUNCS(thr_yield)
787                         fi
788                         if test $ac_cv_func_sched_yield = no -a \
789                                 $ac_cv_func_pthread_yield = no -a \
790                                 "$ac_cv_func_thr_yield" = no ; then
791                                 AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
792                         fi
793
794                         dnl Check functions for compatibility
795                         AC_CHECK_FUNCS(pthread_kill)
796
797                         dnl Check for pthread_detach with <pthread.h> inclusion
798                         dnl as it's symbol may have been mangled.
799                         AC_CACHE_CHECK([for pthread_detach with <pthread.h>],
800                                 [ol_cv_func_pthread_detach], [
801                                 dnl save the flags
802                                 AC_TRY_LINK([
803 #include <pthread.h>
804 #ifndef NULL
805 #define NULL (void*)0
806 #endif
807 ],
808                                         [pthread_detach(NULL);],
809                                         [ol_cv_func_pthread_detach=yes],
810                                         [ol_cv_func_pthread_detach=no])
811                         ])
812
813                         if test $ol_cv_func_pthread_detach = no ; then
814                                 AC_MSG_ERROR([could not locate pthread_detach()])
815                         fi
816
817                         AC_DEFINE(HAVE_PTHREAD_DETACH,1,
818                                 [define if you have pthread_detach function])
819
820                         dnl Check for setconcurreny functions
821                         AC_CHECK_FUNCS( \
822                                 pthread_setconcurrency \
823                                 pthread_getconcurrency \
824                                 thr_setconcurrency \
825                                 thr_getconcurrency \
826                         )
827
828                         OL_SYS_LINUX_THREADS
829                         OL_LINUX_THREADS
830
831                         if test $ol_cv_linux_threads = error; then
832                                 AC_MSG_ERROR([LinuxThreads header/library mismatch]);
833                         fi
834
835                         AC_MSG_CHECKING([if pthread_create() works])
836                         AC_CACHE_VAL(ol_cv_pthread_create_works,[
837                         AC_TRY_RUN([
838 #include <pthread.h>
839 #ifndef NULL
840 #define NULL (void*)0
841 #endif
842
843 static void *task(p)
844         void *p;
845 {
846         return (void *) (p == NULL);
847 }
848
849 int main(argc, argv)
850         int argc;
851         char **argv;
852 {
853         pthread_t t;
854 #if HAVE_PTHREADS_D4
855         exit(pthread_create(&t, pthread_attr_default, task, NULL));
856 #else
857         exit(pthread_create(&t, NULL, task, NULL));
858 #endif
859 }
860 ],
861                                 [ol_cv_pthread_create_works=yes],
862                                 [ol_cv_pthread_create_works=no],
863                                 [dnl assume yes
864                                 ol_cv_pthread_create_works=yes])])
865                         AC_MSG_RESULT($ol_cv_pthread_create_works)
866
867                         if test $ol_cv_pthread_create_works = no ; then
868                                 AC_MSG_ERROR([pthread_create is not usable, check environment settings])
869                         fi
870
871                         dnl Check if select causes an yield
872                         if test $ol_with_yielding_select = auto ; then
873                                 AC_MSG_CHECKING([if select yields when using pthreads])
874                                 AC_CACHE_VAL(ol_cv_pthread_select_yields,[
875                                 AC_TRY_RUN([
876 #include <sys/types.h>
877 #include <sys/time.h>
878 #include <unistd.h>
879 #include <pthread.h>
880 #ifndef NULL
881 #define NULL (void*) 0
882 #endif
883
884 static int fildes[2];
885
886 static void *task(p)
887         void *p;
888 {
889         int i;
890         struct timeval tv;
891
892         fd_set rfds;
893
894         tv.tv_sec=10;
895         tv.tv_usec=0;
896
897         FD_ZERO(&rfds);
898         FD_SET(fildes[0], &rfds);
899
900         /* we're not interested in any fds */
901         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
902
903         if(i < 0) {
904                 perror("select");
905                 exit(10);
906         }
907
908         exit(0); /* if we exit here, the select blocked the whole process */
909 }
910
911 int main(argc, argv)
912         int argc;
913         char **argv;
914 {
915         pthread_t t;
916
917         /* create a pipe to select */
918         if(pipe(&fildes[0])) {
919                 perror("select");
920                 exit(1);
921         }
922
923 #ifdef HAVE_PTHREAD_SETCONCURRENCY
924         (void) pthread_setconcurrency(2);
925 #else
926 #ifdef HAVE_THR_SETCONCURRENCY
927         /* Set Solaris LWP concurrency to 2 */
928         thr_setconcurrency(2);
929 #endif
930 #endif
931
932 #if HAVE_PTHREADS_D4
933         pthread_create(&t, pthread_attr_default, task, NULL);
934 #else
935         pthread_create(&t, NULL, task, NULL);
936 #endif
937
938 #if HAVE_SCHED_YIELD
939         sched_yield();  /* make sure task runs first */
940 #else
941 #ifdef HAVE_PTHREAD_YIELD
942         pthread_yield();        /* make sure task runs first */
943 #endif
944 #endif
945
946         exit(2);
947 }],
948                                 [ol_cv_pthread_select_yields=no],
949                                 [ol_cv_pthread_select_yields=yes], [
950                                 AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual])])])
951                                 AC_MSG_RESULT($ol_cv_pthread_select_yields)
952
953                                 if test $ol_cv_pthread_select_yields = yes ; then
954                                         ol_with_yielding_select=yes
955                                 fi
956                         fi
957
958                         dnl restore flags
959                         CPPFLAGS="$save_CPPFLAGS"
960                         LIBS="$save_LIBS"
961                 else
962                         AC_MSG_ERROR([could not link with POSIX Threads])
963                 fi
964         fi
965
966         if test $ol_with_threads = posix ; then
967                 AC_MSG_ERROR([could not locate POSIX Threads])
968         fi
969 fi
970
971 if test $ol_with_threads = auto -o $ol_with_threads = yes \
972         -o $ol_with_threads = mach ; then
973
974         dnl check for Mach CThreads
975         AC_CHECK_HEADERS(mach/cthreads.h)
976         if test $ac_cv_header_mach_cthreads_h = yes ; then
977                 ol_with_threads=found
978
979                 dnl check for cthread support in current $LIBS
980                 AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
981
982                 if test $ol_link_threads = no ; then
983                         dnl try -all_load
984                         dnl this test needs work
985                         AC_CACHE_CHECK([for cthread_fork with -all_load],
986                                 [ol_cv_cthread_all_load], [
987                                 dnl save the flags
988                                 save_LIBS="$LIBS"
989                                 LIBS="-all_load $LIBS"
990                                 AC_TRY_LINK([#include <mach/cthreads.h>],[
991                                         cthread_fork((void *)0, (void *)0);
992                                         ], ol_cv_cthread_all_load=yes, ol_cv_cthread_all_load=no)
993                                 dnl restore the LIBS
994                                 LIBS="$save_LIBS"
995                         ])
996
997                         if test $ol_cv_cthread_all_load = yes ; then
998                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
999                                 ol_link_threads=mach
1000                         fi
1001                 fi
1002
1003                 if test $ol_link_threads != no ; then
1004                         : check for cthread specific functionality here
1005                         AC_DEFINE(HAVE_MACH_CTHREADS,1,
1006                                 [define if you have Mach Cthreads])
1007                 else
1008                         AC_MSG_ERROR([could not link with Mach CThreads])
1009                 fi
1010         fi
1011
1012         if test $ol_with_threads = mach ; then
1013                 AC_MSG_ERROR([could not locate Mach CThreads])
1014         fi
1015 fi
1016
1017 if test $ol_with_threads = auto -o $ol_with_threads = yes \
1018         -o $ol_with_threads = lwp ; then
1019
1020         dnl check for SunOS5 LWP
1021         AC_CHECK_HEADERS(thread.h synch.h)
1022         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
1023                 AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
1024
1025                 if test $have_thr = yes ; then
1026                         AC_DEFINE(HAVE_THR,1,
1027                                 [if you have Solaris LWP (thr) package])
1028                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
1029                         ol_link_threads=thr
1030
1031                         if test $ol_with_yielding_select = auto ; then
1032                                 ol_with_yielding_select=yes
1033                         fi
1034
1035                         dnl Check for setconcurreny functions
1036                         AC_CHECK_FUNCS( \
1037                                 thr_setconcurrency \
1038                                 thr_getconcurrency \
1039                         )
1040                 fi
1041         fi
1042
1043         dnl check for SunOS4 LWP
1044         AC_CHECK_HEADERS(lwp/lwp.h)
1045         if test $ac_cv_header_lwp_lwp_h = yes ; then
1046                 AC_CHECK_LIB(lwp, lwp_create, [have_lwp=yes], [have_lwp=no])
1047
1048                 if test $have_lwp = yes ; then
1049                         AC_DEFINE(HAVE_LWP,1,
1050                                 [if you have SunOS LWP package])
1051                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
1052                         ol_link_threads=lwp
1053
1054                         if test $ol_with_yielding_select = auto ; then
1055                                 ol_with_yielding_select=no
1056                         fi
1057                 fi
1058         fi
1059 fi
1060
1061 if test $ol_with_yielding_select = yes ; then
1062         AC_DEFINE(HAVE_YIELDING_SELECT,1,
1063                 [define if select implicitly yields])
1064 fi
1065
1066 if test $ol_with_threads = manual ; then
1067         dnl User thinks he can manually configure threads.
1068         ol_link_threads=yes
1069
1070         AC_MSG_WARN([thread defines and link options must be set manually])
1071
1072         AC_CHECK_HEADERS(pthread.h sched.h)
1073         AC_CHECK_FUNCS(sched_yield pthread_yield)
1074         OL_HEADER_LINUX_THREADS
1075
1076         AC_CHECK_HEADERS(mach/cthreads.h)
1077         AC_CHECK_HEADERS(lwp/lwp.h)
1078         AC_CHECK_HEADERS(thread.h synch.h)
1079 fi
1080
1081 if test $ol_link_threads != no ; then  
1082         dnl needed to get reentrant/threadsafe versions
1083         dnl
1084         AC_DEFINE(REENTRANT,1)
1085         AC_DEFINE(_REENTRANT,1)
1086         AC_DEFINE(THREAD_SAFE,1)
1087         AC_DEFINE(_THREAD_SAFE,1)
1088         AC_DEFINE(THREADSAFE,1)
1089         AC_DEFINE(_THREADSAFE,1)
1090
1091         dnl The errno declaration may dependent upon _REENTRANT.
1092         dnl If it does, we must link with thread support.
1093         AC_CACHE_CHECK([for thread specific errno],
1094                 [ol_cv_errno_thread_specific], [
1095                 AC_TRY_LINK([#include <errno.h>], [errno = 0;],
1096                         [ol_cv_errno_thread_specific=yes],
1097                         [ol_cv_errno_thread_specific=no])
1098         ])
1099
1100         if test $ol_cv_errno_thread_specific != yes ; then
1101                 LIBS="$LTHREAD_LIBS $LIBS"
1102                 LTHREAD_LIBS=""
1103         fi
1104
1105 dnl When in thread environment, use 
1106 dnl             #if defined( HAVE_REENTRANT_FUNCTIONS ) \ 
1107 dnl                     || defined( HAVE_FUNC_R )
1108 dnl                     func_r(...);
1109 dnl             #else
1110 dnl             #       if defined( HAVE_THREADS ) 
1111 dnl                             /* lock */
1112 dnl             #       endif
1113 dnl                             func(...);
1114 dnl             #       if defined( HAVE_THREADS ) 
1115 dnl                             /* unlock */
1116 dnl             #       endif
1117 dnl             #endif
1118 dnl
1119 dnl HAVE_REENTRANT_FUNCTIONS is derived from:
1120 dnl             _POSIX_REENTRANT_FUNCTIONS
1121 dnl             _POSIX_THREAD_SAFE_FUNCTIONS
1122 dnl             _POSIX_THREADSAFE_FUNCTIONS
1123 dnl
1124 dnl             and is currently defined in lthread.h
1125 dnl
1126 dnl HAVE_THREADS is defined by lthread.h iff -UNO_THREADS
1127 dnl 
1128 dnl libldap/*.c should only include <lthread.h> iff
1129 dnl LDAP_R_COMPILE is defined.  ie:
1130 dnl             #ifdef LDAP_R_COMPILE
1131 dnl             #       include LDAP_R_COMPILE
1132 dnl             #endif
1133 dnl
1134 dnl LDAP_R_COMPILE is defined by libldap_r/Makefile.in
1135 dnl specifically for compiling the threadsafe version of
1136 dnl     the ldap library (-lldap_r).
1137 dnl             
1138 dnl     dnl check for reentrant/threadsafe functions
1139 dnl     dnl
1140 dnl     dnl note: these should only be used when linking
1141 dnl     dnl       with $LTHREAD_LIBS
1142 dnl     dnl
1143 dnl     save_CPPFLAGS="$CPPFLAGS"
1144 dnl     save_LIBS="$LIBS"
1145 dnl     LIBS="$LTHREAD_LIBS $LIBS"
1146 dnl     AC_CHECK_FUNCS( \
1147 dnl             gmtime_r \
1148 dnl             gethostbyaddr_r gethostbyname_r \
1149 dnl             feof_unlocked unlocked_feof \
1150 dnl             putc_unlocked unlocked_putc \
1151 dnl             flockfile ftrylockfile \
1152 dnl     )
1153 dnl     CPPFLAGS="$save_CPPFLAGS"
1154 dnl     LIBS="$save_LIBS"
1155 fi  
1156
1157 if test $ol_link_threads = no ; then
1158         if test $ol_with_threads = yes ; then
1159                 AC_MSG_ERROR([no suitable thread support])
1160         fi
1161
1162         if test $ol_with_threads = auto ; then
1163                 AC_MSG_WARN([no suitable thread support, disabling threads])
1164                 ol_with_threads=no
1165         fi
1166
1167         AC_DEFINE(NO_THREADS,1,
1168                 [define if you have (or want) no threads])
1169         LTHREAD_LIBS=""
1170 fi
1171
1172 if test $ol_link_threads != no ; then
1173         AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE,1)
1174 fi
1175
1176 dnl ----------------------------------------------------------------
1177
1178 ol_link_ldbm=no 
1179 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
1180         OL_BERKELEY_DB2
1181
1182         if test $ol_cv_berkeley_db2 = yes ; then
1183                 ol_link_ldbm=db2
1184                 ol_with_ldbm_api=db2
1185
1186                 if test $ol_with_ldbm_type = hash ; then
1187                         AC_DEFINE(LDBM_USE_DBHASH,1)
1188                 else
1189                         AC_DEFINE(LDBM_USE_DBBTREE,1)
1190                 fi
1191
1192                 dnl $ol_cv_lib_db2 should be yes or -ldb
1193                 dnl (it could be no, but that would be an error
1194                 if test $ol_cv_lib_db2 != yes ; then
1195                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
1196                 fi
1197         fi
1198 fi
1199
1200 ol_link_bdb2=no
1201 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
1202         ol_link_bdb2=yes
1203 fi
1204
1205 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
1206         OL_BERKELEY_DB
1207
1208         if test $ol_cv_berkeley_db = yes ; then
1209                 ol_link_ldbm=db
1210                 ol_with_ldbm_api=db
1211
1212                 if test $ol_with_ldbm_type = hash ; then
1213                         AC_DEFINE(LDBM_USE_DBHASH,1)
1214                 else
1215                         AC_DEFINE(LDBM_USE_DBBTREE,1)
1216                 fi
1217
1218                 dnl $ol_cv_lib_db should be yes or -ldb
1219                 dnl (it could be no, but that would be an error
1220                 if test $ol_cv_lib_db != yes ; then
1221                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
1222                 fi
1223         fi
1224 fi
1225
1226 if test $ol_with_ldbm_api = manual ; then
1227         dnl User thinks he can manually configure LDBM api.
1228         ol_link_ldbm=yes
1229
1230         AC_MSG_WARN([LDBM defines and link options must be set manually])
1231
1232         AC_CHECK_HEADERS(db.h db_185.h gdbm.h ndbm.h)
1233 fi
1234
1235 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
1236         AC_MSG_WARN(Could not find LDBM with BTREE support)
1237         ol_with_ldbm_api=none
1238 fi
1239
1240 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
1241         OL_MDBM
1242
1243         if test $ol_cv_mdbm = yes ; then
1244                 ol_link_ldbm=mdbm
1245                 ol_with_ldbm_api=mdbm
1246                 if test $ol_cv_lib_mdbm != yes ; then
1247                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
1248                 fi
1249         fi
1250 fi
1251
1252 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
1253         OL_GDBM
1254
1255         if test $ol_cv_gdbm = yes ; then
1256                 ol_link_ldbm=gdbm
1257                 ol_with_ldbm_api=gdbm
1258
1259                 if test $ol_cv_lib_gdbm != yes ; then
1260                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
1261                 fi
1262         fi
1263 fi
1264
1265 if test $ol_with_ldbm_api = auto ; then
1266         AC_MSG_WARN([skipping automatic checking for NDBM, must be manually enabled.])
1267 elif test $ol_with_ldbm_api = ndbm ; then
1268         OL_NDBM
1269
1270         if test $ol_cv_ndbm = yes ; then
1271                 ol_link_ldbm=ndbm
1272                 ol_with_ldbm_api=ndbm
1273
1274                 if test $ol_cv_lib_ndbm != yes ; then
1275                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
1276                 fi
1277         fi
1278 fi
1279
1280 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
1281         AC_MSG_WARN(could not find suitable LDBM backend)
1282         if test $ol_enable_ldbm = yes ; then
1283                 AC_MSG_ERROR(select appropriate LDBM options or disable)
1284         fi
1285
1286         AC_MSG_WARN(disabling LDBM)
1287         ol_enable_ldbm=no
1288 fi
1289
1290 if test $ol_enable_wrappers != no ; then
1291         AC_CHECK_HEADERS(tcpd.h)
1292
1293         if test $ac_cv_header_tcpd_h != yes ; then
1294                 have_wrappers=no
1295         else
1296                 AC_CHECK_LIB(wrap, main,
1297                         [have_wrappers=yes], [have_wrappers=no])
1298         fi
1299
1300         if test $have_wrappers = yes ; then
1301                 AC_DEFINE(HAVE_TCPD,1, [define if you have -lwrap])
1302                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
1303
1304                 dnl We add another check for -lnsl since some libwrap's
1305                 dnl need it, but it isn't always included from above
1306                 AC_CHECK_LIB(nsl, main)
1307         else
1308                 AC_MSG_WARN(could not find -lwrap)
1309                 if test $ol_enable_wrappers = yes ; then
1310                         AC_MSG_ERROR(could not find wrappers, select appropriate options or disable)
1311                 fi
1312
1313                 AC_MSG_WARN(disabling wrappers support)
1314                 ol_enable_wrappers=no
1315         fi
1316 fi
1317
1318 if test $ol_enable_syslog != no ; then
1319         AC_CHECK_FUNC(openlog)
1320         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
1321                 AC_MSG_ERROR(could not find syslog, select appropriate options or disable)
1322         fi
1323         ol_enable_syslog=$ac_cv_func_openlog
1324 fi
1325
1326 if test $ol_enable_dmalloc != no ; then
1327         AC_CHECK_HEADERS(dmalloc.h)
1328         AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
1329 fi
1330
1331 if test $ol_enable_tcl != no ; then
1332         AC_CHECK_HEADERS(tcl.h)
1333
1334         if test $ac_cv_header_tcl_h != yes ; then
1335                 have_tcl=no
1336         else
1337                 AC_CHECK_LIB(tcl,main,
1338                         [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"],
1339                         [have_tcl=no])
1340
1341                 if test $have_tcl != yes; then
1342                         AC_CHECK_LIB(tcl7.6,main,
1343                                 [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"],
1344                                 [have_tcl=no])
1345                 fi
1346
1347                 if test $have_tcl != yes; then
1348                         AC_CHECK_LIB(tcl8.0,main,
1349                                 [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"],
1350                                 [have_tcl=no])
1351                 fi
1352         fi
1353
1354         if test $have_tcl != yes ; then
1355                 AC_MSG_WARN([could not find -ltcl])
1356                 if test $ol_enable_tcl = yes ; then
1357                         AC_MSG_ERROR([could not find tcl, select appropriate options or disable])
1358                 fi
1359
1360                 ol_enable_tcl=no
1361         fi
1362 fi
1363
1364 # ud needs termcap (should insert check here)
1365 ol_link_termcap=no
1366 AC_CHECK_HEADERS(termcap.h ncurses.h)
1367
1368 if test $ol_link_termcap = no ; then
1369         AC_CHECK_LIB(termcap, tputs, [have_termcap=yes], [have_termcap=no])
1370         if test $have_termcap = yes ; then
1371                 AC_DEFINE(HAVE_TERMCAP, 1, [define if you have -ltermcap])
1372                 ol_link_termcap=yes
1373                 TERMCAP_LIBS=-ltermcap
1374         fi
1375 fi
1376
1377 if test $ol_link_termcap = no ; then
1378         AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
1379         if test $have_ncurses = yes ; then
1380                 AC_DEFINE(HAVE_NCURSES, 1, [define if you have -lncurses])
1381                 ol_link_termcap=yes
1382                 TERMCAP_LIBS=-lncurses
1383         fi
1384 fi
1385
1386 if test $ol_link_termcap = no ; then
1387         AC_DEFINE(NO_TERMCAP,1, [define if you have no termcap support])
1388         TERMCAP_LIBS=
1389 fi
1390
1391 dnl
1392 dnl Check for GNU readline
1393 dnl
1394 ol_link_readline=no
1395 if test $ol_with_readline != no ; then
1396         AC_CHECK_HEADERS(readline/readline.h readline/history.h)
1397
1398         if test $ac_cv_header_readline_readline_h = yes ; then
1399                 save_LIBS="$LIBS"
1400                 LIBS="$TERMCAP_LIBS $LIBS"
1401                 AC_CHECK_LIB(readline, readline, 
1402                         [have_readline=yes], [have_readline=no])
1403                 LIBS="$save_LIBS"
1404                         
1405                 if test $have_readline = yes ; then
1406                         ol_with_readline=found
1407                         ol_link_readline=yes
1408
1409                         READLINE_LIBS="-lreadline"
1410                 fi
1411         fi
1412 fi
1413
1414 if test $ol_link_readline = yes ; then
1415         AC_DEFINE(HAVE_READLINE, 1, [define if you have -lreadline])
1416 fi
1417
1418
1419 # FreeBSD (and others) have crypt(3) in -lcrypt
1420 if test $ol_enable_crypt != no ; then
1421         AC_CHECK_FUNC(crypt, [have_crypt=yes], [
1422                 AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
1423                         have_crypt=yes], [have_crypt=no])])
1424
1425         if test $have_crypt = yes ; then
1426                 AC_DEFINE(HAVE_CRYPT,1)
1427         else
1428                 AC_MSG_WARN(could not find crypt)
1429                 if test $ol_enable_crypt = yes ; then
1430                         AC_MSG_ERROR(could not find crypt, select appropriate options or disable)
1431                 fi
1432
1433                 AC_MSG_WARN(disabling crypt support)
1434                 ol_enable_crypt=no
1435         fi
1436 fi
1437
1438 # FreeBSD (and others) have setproctitle(3) in -lutil
1439 if test $ol_enable_proctitle != no ; then
1440         AC_CHECK_FUNC(setproctitle,     [have_setproctitle=yes], [
1441                 AC_CHECK_LIB(util, setproctitle,
1442                         [have_setproctitle=yes
1443                         LUTIL_LIBS="$LUTIL_LIBS -lutil"],
1444                         [have_setproctitle=no
1445                         LIBOBJS="$LIBOBJS setproctitle.o"])])
1446
1447         if test $have_setproctitle = yes ; then
1448                 AC_DEFINE(HAVE_SETPROCTITLE,1)
1449         fi
1450 fi
1451
1452 dnl ----------------------------------------------------------------
1453 dnl Checks for header files.
1454 OL_HEADER_STDC
1455
1456 if test $ol_cv_header_stdc != yes; then
1457         AC_MSG_WARN([could not locate Standard C compliant headers])
1458 fi
1459
1460 AC_HEADER_DIRENT
1461 AC_HEADER_SYS_WAIT
1462 AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
1463 if test $am_cv_sys_posix_termios = yes ; then
1464         AC_DEFINE(HAVE_POSIX_TERMIOS,1,
1465                 [define if you have POSIX termios])
1466 fi
1467
1468 AC_CHECK_HEADERS(       \
1469         arpa/inet.h             \
1470         arpa/nameser.h  \
1471         assert.h                \
1472         crypt.h                 \
1473         errno.h                 \
1474         fcntl.h                 \
1475         filio.h                 \
1476         getopt.h                \
1477         grp.h                   \
1478         libutil.h               \
1479         limits.h                \
1480         locale.h                \
1481         malloc.h                \
1482         memory.h                \
1483         regex.h                 \
1484         psap.h                  \
1485         pwd.h                   \
1486         resolv.h                \
1487         sgtty.h                 \
1488         stdarg.h                \
1489         stddef.h                \
1490         string.h                \
1491         strings.h               \
1492         sysexits.h              \
1493         sys/file.h              \
1494         sys/filio.h             \
1495         sys/errno.h             \
1496         sys/ioctl.h             \
1497         sys/param.h             \
1498         sys/resource.h  \
1499         sys/select.h    \
1500         sys/socket.h    \
1501         sys/syslog.h    \
1502         sys/time.h              \
1503         sys/types.h             \
1504         syslog.h                \
1505         termios.h               \
1506         unistd.h                \
1507 )
1508
1509 dnl ----------------------------------------------------------------
1510 dnl Checks for typedefs, structures, and compiler characteristics.
1511 AC_TYPE_GETGROUPS dnl requires AC_TYPE_UID_T
1512 AC_TYPE_MODE_T
1513 AC_TYPE_OFF_T
1514 AC_TYPE_PID_T
1515 AM_TYPE_PTRDIFF_T
1516 AC_TYPE_SIGNAL
1517 OL_TYPE_SIG_ATOMIC_T
1518 AC_TYPE_SIZE_T
1519 AC_STRUCT_ST_BLKSIZE
1520 AC_HEADER_TIME
1521 AC_STRUCT_TM
1522 OL_STRUCT_PASSWD_PW_GECOS
1523
1524 OL_C_UPPER_LOWER
1525 AC_C_CONST
1526 OL_C_VOLATILE
1527
1528 if test $cross_compiling = yes ; then
1529         AC_DEFINE(CROSS_COMPILING, 1, [define if cross compiling])
1530 else
1531         AC_C_BIGENDIAN
1532         AC_CHECK_SIZEOF(short) 
1533         AC_CHECK_SIZEOF(int) 
1534         AC_CHECK_SIZEOF(long)
1535 fi
1536
1537 dnl ----------------------------------------------------------------
1538 dnl Checks for library functions.
1539 AC_FUNC_MEMCMP
1540 dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
1541 AC_FUNC_STRFTIME
1542 dnl AM_FUNC_STRTOD
1543
1544 dnl we should use vfork instead of fork in a number of places...
1545 dnl AC_FUNC_VFORK
1546 AC_FUNC_VPRINTF
1547
1548 if test $ac_cv_func_vprintf = yes ; then
1549         dnl check for vsnprintf
1550         AC_CHECK_FUNCS(vsnprintf vsprintf)
1551 fi
1552
1553 AC_CHECK_FUNCS(         \
1554         bcopy                   \
1555         endgrent                \
1556         endpwent                \
1557         flock                   \
1558         getdtablesize   \
1559         getgrgid                \
1560         gethostname             \
1561         getpass                 \
1562         getpwuid                \
1563         gettimeofday    \
1564         initgroups              \
1565         lockf                   \
1566         memcpy                  \
1567         memmove                 \
1568         mkstemp                 \
1569         recv                    \
1570         recvfrom                \
1571         setpwfile               \
1572         setgid                  \
1573         setegid                 \
1574         setsid                  \
1575         setuid                  \
1576         seteuid                 \
1577         signal                  \
1578         sigset                  \
1579         snprintf                \
1580         strdup                  \
1581         strerror                \
1582         strpbrk                 \
1583         strrchr                 \
1584         strsep                  \
1585         strstr                  \
1586         strtol                  \
1587         strtoul                 \
1588         strspn                  \
1589         sysconf                 \
1590         waitpid                 \
1591         wait4                   \
1592 )
1593
1594 dnl We actually may need to replace more than this.
1595 AC_REPLACE_FUNCS(getopt tempnam)
1596
1597 dnl ----------------------------------------------------------------
1598 # Check Configuration
1599 OL_SYS_ERRLIST
1600
1601 dnl ----------------------------------------------------------------
1602 dnl Check our declaration of strdup()
1603 OL_DECL_STRDUP
1604
1605 dnl ----------------------------------------------------------------
1606 dnl Sort out defines
1607
1608 if test "$ol_enable_debug" != no ; then
1609         AC_DEFINE(LDAP_DEBUG,1)
1610 fi
1611 if test "$ol_enable_syslog" = yes ; then
1612         AC_DEFINE(LDAP_SYSLOG,1)
1613 fi
1614 if test "$ol_enable_libui" = yes ; then
1615         AC_DEFINE(LDAP_LIBUI,1)
1616 fi
1617 if test "$ol_enable_cache" = no ; then
1618         AC_DEFINE(LDAP_NOCACHE,1)
1619 fi
1620 if test "$ol_enable_dns" != no ; then
1621         AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_DNS,LDAP_VENDOR_VERSION)
1622 fi
1623 if test "$ol_enable_proctitle" != no ; then
1624         AC_DEFINE(LDAP_PROCTITLE,1)
1625 fi
1626 if test "$ol_enable_referrals" != no ; then
1627         AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS,LDAP_VENDOR_VERSION)
1628 fi
1629 if test "$ol_enable_cldap" != no ; then
1630         AC_DEFINE(LDAP_CONNECTIONLESS,1)
1631 fi
1632
1633 if test "$ol_enable_aclgroups" != no ; then
1634         AC_DEFINE(SLAPD_ACLGROUPS,1)
1635 fi
1636 if test "$ol_enable_crypt" != no ; then
1637         AC_DEFINE(SLAPD_CRYPT,1)
1638 fi
1639 if test "$ol_enable_cleartext" != no ; then
1640         AC_DEFINE(SLAPD_CLEARTEXT,1)
1641 fi
1642 if test "$ol_enable_phonetic" != no ; then
1643         AC_DEFINE(SLAPD_PHONETIC,1)
1644 fi
1645 if test "$ol_enable_rlookups" != no ; then
1646         AC_DEFINE(SLAPD_RLOOKUPS,1)
1647 fi
1648
1649 if test "$ol_link_modules" != no ; then
1650         AC_DEFINE(SLAPD_MODULES,1)
1651         BUILD_SLAPD=yes
1652 fi
1653
1654 if test "$ol_link_bdb2" != no ; then
1655         AC_DEFINE(SLAPD_BDB2,1)
1656         BUILD_SLAPD=yes
1657         BUILD_BDB2=yes
1658 fi
1659
1660 if test "$ol_link_ldbm" != no ; then
1661         AC_DEFINE(SLAPD_LDBM,1)
1662         BUILD_SLAPD=yes
1663         BUILD_LDBM=yes
1664 fi
1665
1666 if test "$ol_enable_passwd" != no ; then
1667         AC_DEFINE(SLAPD_PASSWD,1)
1668         BUILD_SLAPD=yes
1669         BUILD_PASSWD=yes
1670 fi
1671
1672 if test "$ol_link_perl" != no ; then
1673         AC_DEFINE(SLAPD_PERL,1)
1674         BUILD_SLAPD=yes
1675         BUILD_PERL=yes
1676 fi
1677
1678 if test "$ol_enable_shell" != no ; then
1679         AC_DEFINE(SLAPD_SHELL,1)
1680         BUILD_SLAPD=yes
1681         BUILD_SHELL=yes
1682 fi
1683
1684 if test "$ol_enable_tcl" != no ; then
1685         AC_DEFINE(SLAPD_TCL,1)
1686         BUILD_SLAPD=yes
1687         BUILD_TCL=yes
1688 fi
1689
1690 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
1691         $BUILD_SLAPD = yes ; then
1692         BUILD_SLURPD=yes
1693 fi
1694
1695 if test "$ol_link_isode" != no ; then
1696         BUILD_LDAPD=yes
1697 fi
1698
1699 dnl ----------------------------------------------------------------
1700
1701 AC_SUBST(BUILD_LDAPD)
1702 AC_SUBST(BUILD_SLAPD)
1703   AC_SUBST(BUILD_BDB2)
1704   AC_SUBST(BUILD_LDBM)
1705   AC_SUBST(BUILD_PASSWD)
1706   AC_SUBST(BUILD_PERL)
1707   AC_SUBST(BUILD_SHELL)
1708   AC_SUBST(BUILD_TCL)
1709 AC_SUBST(BUILD_SLURPD)
1710
1711 AC_SUBST(LDAP_LIBS)
1712 AC_SUBST(LDAPD_LIBS)
1713 AC_SUBST(SLAPD_LIBS)
1714 AC_SUBST(SLURPD_LIBS)
1715 AC_SUBST(LDBM_LIBS)
1716 AC_SUBST(LTHREAD_LIBS)
1717 AC_SUBST(LUTIL_LIBS)
1718
1719 AC_SUBST(SLAPD_MODULES_CPPFLAGS)
1720 AC_SUBST(SLAPD_MODULES_LDFLAGS)
1721
1722 AC_SUBST(SLAPD_PERL_CPPFLAGS)
1723 AC_SUBST(SLAPD_PERL_LDFLAGS)
1724
1725 AC_SUBST(KRB_LIBS)
1726 AC_SUBST(READLINE_LIBS)
1727 AC_SUBST(TERMCAP_LIBS)
1728 AC_SUBST(TLS_LIBS)
1729
1730 dnl ----------------------------------------------------------------
1731 dnl final output
1732 dnl
1733
1734 AC_OUTPUT( \
1735 Makefile:build/top.mk:Makefile.in:build/dir.mk \
1736 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
1737 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
1738 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
1739 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
1740 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
1741 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
1742 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
1743 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
1744 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
1745 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
1746 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
1747 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
1748 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
1749 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
1750 include/Makefile:build/top.mk:include/Makefile.in \
1751 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
1752 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
1753 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
1754 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
1755 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
1756 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
1757 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
1758 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
1759 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
1760 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
1761 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
1762 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
1763 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
1764 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
1765 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
1766 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
1767 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
1768 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
1769 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
1770 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
1771 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
1772 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
1773 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
1774 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
1775 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
1776 ,[
1777 date > stamp-h
1778 echo Please \"make depend\" to build dependencies
1779 ])