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