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