]> git.sur5r.net Git - openldap/blob - configure.in
Update contrib software.
[openldap] / configure.in
1 dnl Copyright 1998 The OpenLDAP Foundation.  All Rights Reserved.
2 dnl 
3 dnl Redistribution and use in source and binary forms are permitted only
4 dnl as authorized by the OpenLDAP Public License.  A copy of this
5 dnl license is available at http://www.OpenLDAP.org/license.html or
6 dnl in file LICENSE in the top-level directory of the distribution.
7 dnl ----
8
9 dnl Configure.in for OpenLDAP
10 AC_INIT(include/ldap.h)dnl
11 AC_CONFIG_AUX_DIR(build)dnl
12 AM_INIT_AUTOMAKE(OpenLDAP,[1.1-alpha3], [no ac_define])dnl
13
14 dnl Do not use AutoConf 2.12; it produces a configuration script
15 dnl that causes an "internal 2K buffer" error on HPUX when run
16 dnl with /bin/sh.  Autoconf 2.10 seems to be okay.
17 AC_PREREQ(2.10)dnl Required Autoconf version
18
19 AC_CONFIG_AUX_DIR(build)
20 AC_CONFIG_HEADER(include/portable.h)dnl
21
22 dnl
23 dnl Start Args
24 AC_MSG_CHECKING(configure arguments)
25 AC_PREFIX_DEFAULT(/usr/local)
26
27 top_builddir=`pwd`
28 AC_SUBST(top_builddir)dnl
29
30 OL_ARG_ENABLE(debug,[  --enable-debug   enable debugging], yes)dnl
31 dnl OL_ARG_ENABLE(syslog,[  --enable-syslog     enable syslog support], auto)dnl
32 OL_ARG_ENABLE(proctitle,[  --enable-proctitle   enable proctitle support], yes)dnl
33 OL_ARG_ENABLE(libui,[  --enable-libui   enable library user interface], yes)dnl
34 OL_ARG_ENABLE(cache,[  --enable-cache   enable caching], yes)dnl
35 OL_ARG_ENABLE(dns,[  --enable-dns               enable dns support], no)dnl
36 OL_ARG_ENABLE(referrals,[  --enable-referrals   enable referrals], yes)dnl
37 OL_ARG_ENABLE(cldap,[  --enable-cldap   enable connectionless ldap], no)dnl
38 OL_ARG_ENABLE(x_compile,[  --enable-x-compile   enable cross compiling],
39         no, [yes no])dnl
40
41 dnl General "with" options
42 OL_ARG_WITH(kerberos,[  --with-kerberos use Kerberos],
43         auto, [auto k5 k4 afs yes no])
44 OL_ARG_WITH(threads,[  --with-threads   use threads],
45         auto, [auto posix mach lwp yes no manual] )
46 OL_ARG_WITH(yielding_select,[  --with-yielding-select   with implicitly yielding select],
47         auto, [auto yes no manual] )
48
49 dnl Server options
50
51 dnl LDAPD OPTIONS
52 AC_ARG_WITH(xxldapdoptions,[LDAPD Options:])
53 OL_ARG_ENABLE(ldapd,[  --enable-ldapd   enable building ldapd], no)dnl
54
55 dnl SLAPD OPTIONS
56 AC_ARG_WITH(xxslapdoptions,[SLAPD Options:])
57 OL_ARG_ENABLE(slapd,[  --enable-slapd   enable building slapd], yes)dnl
58 OL_ARG_ENABLE(aclgroups,[    --enable-aclgroups enable ACL group support], auto)dnl
59 OL_ARG_ENABLE(crypt,[    --enable-crypt enable crypt(3) passwords], auto)dnl
60 OL_ARG_ENABLE(md5,[    --enable-md5     enable MD5 passwords], auto)dnl
61 OL_ARG_ENABLE(sha1,[    --enable-sha1   enable SHA1 passwords], auto)dnl
62 OL_ARG_ENABLE(wrappers,[    --enable-wrappers   enable tcp wrapper support], no)dnl
63 OL_ARG_ENABLE(phonetic,[    --enable-phonetic   enable phonetic/soundex], no)dnl
64 OL_ARG_ENABLE(rlookups,[    --enable-rlookups   enable reverse lookups], auto)dnl
65
66 dnl SLAPD Backend options
67 OL_ARG_ENABLE(ldbm,[    --enable-ldbm   enable ldbm backend], yes)dnl
68 OL_ARG_WITH(ldbm_api,[      --with-ldbm-api     use LDBM API], auto,
69         [auto db2 db gdbm ndbm manual])
70 OL_ARG_WITH(ldbm_type,[      --with-ldbm-type   use LDBM type], auto,
71         [auto btree hash])
72
73 OL_ARG_ENABLE(passwd,[    --enable-passwd       enable passwd backend], no)dnl
74 OL_ARG_ENABLE(shell,[    --enable-shell enable shell backend], no)dnl
75
76 dnl SLURPD OPTIONS
77 AC_ARG_WITH(xxslurpdoptions,[SLURPD Options:])
78 OL_ARG_ENABLE(slurpd,[  --enable-slurpd enable building slurpd], auto)dnl
79
80 AC_ARG_WITH(xxliboptions,[Library Generation & Linking Options])
81 AM_ENABLE_STATIC
82 dnl AM_DISABLE_SHARED
83 AM_ENABLE_SHARED
84
85 dnl General "enable" options
86 # validate options
87 if test $ol_enable_referrals = no ; then
88         if test $ol_enable_dns = yes ; then
89                 AC_MSG_WARN([dns disabled, ignoring --enable-dns argument])
90         fi
91         ol_enable_dns=no
92 fi
93
94 if test $ol_enable_slapd = no ; then
95         dnl SLAPD was specificallly disabled
96         if test $ol_enable_ldbm = yes ; then
97                 AC_MSG_WARN([slapd disabled, ignoring --enable_ldbm argument])
98         fi
99         if test $ol_enable_passwd = yes ; then
100                 AC_MSG_WARN([slapd disabled, ignoring --enable_passwd argument])
101         fi
102         if test $ol_enable_shell = yes ; then
103                 AC_MSG_WARN([slapd disabled, ignoring --enable_shell argument])
104         fi
105         if test $ol_enable_aclgroups = yes ; then
106                 AC_MSG_WARN([slapd disabled, ignoring --enable_aclgroups argument])
107         fi
108         if test $ol_enable_crypt = yes ; then
109                 AC_MSG_WARN([slapd disabled, ignoring --enable_crypt argument])
110         fi
111         if test $ol_enable_md5 = yes ; then
112                 AC_MSG_WARN([slapd disabled, ignoring --enable_md5 argument])
113         fi
114         if test $ol_enable_sha1 = yes ; then
115                 AC_MSG_WARN([slapd disabled, ignoring --enable_sha1 argument])
116         fi
117         if test $ol_enable_wrappers = yes ; then
118                 AC_MSG_WARN([slapd disabled, ignoring --enable_wrappers argument])
119         fi
120         if test $ol_enable_phonetic = yes ; then
121                 AC_MSG_WARN([slapd disabled, ignoring --enable_phonetic argument])
122         fi
123         if test $ol_enable_rlookups = yes ; then
124                 AC_MSG_WARN([slapd disabled, ignoring --enable_rlookups argument])
125         fi
126         if test $ol_with_ldbm_api != auto ; then
127                 AC_MSG_WARN([slapd disabled, ignoring --with_ldbm_api argument])
128         fi
129         if test $ol_with_ldbm_type != auto ; then
130                 AC_MSG_WARN([slapd disabled, ignoring --with_ldbm_type argument])
131         fi
132         if test $ol_enable_slurpd = yes ; then
133                 AC_MSG_ERROR([slurpd requires slapd])
134         fi
135
136         # force settings to no
137         ol_enable_ldbm=no
138         ol_enable_shell=no
139         ol_enable_passwd=no
140         ol_enable_aclgroups=no
141         ol_enable_crypt=no
142         ol_enable_md5=no
143         ol_enable_sha1=no
144         ol_enable_wrappers=no
145         ol_enable_phonetic=no
146         ol_enable_rlookups=no
147         ol_with_ldbm_api=no
148         ol_with_ldbm_type=no
149         ol_enable_slurpd=no
150
151 elif test $ol_enable_ldbm = no ; then
152         dnl SLAPD without LDBM
153
154         if test $ol_with_ldbm_api != auto ; then
155                 AC_MSG_WARN([LDBM disabled, ignoring --with_ldbm_api argument])
156         fi
157
158         if test $ol_with_ldbm_type != auto ; then
159                 AC_MSG_WARN([LDBM disabled, ignoring --with_ldbm_type argument])
160         fi
161
162         if test $ol_enable_passwd = no -a $ol_enable_shell = no ; then
163                 AC_MSG_ERROR([slapd requires a backend])
164         fi
165
166         ol_with_ldbm_api=no
167         ol_with_ldbm_type=no
168
169 else
170         dnl SLAPD with LDBM
171
172         if test $ol_with_ldbm_api = gdbm -a \
173                 $ol_with_ldbm_type = btree ; then
174                 AC_MSG_ERROR([GDBM only supports LDBM type hash])
175         fi
176         if test $ol_with_ldbm_api = ndbm -a \
177                 $ol_with_ldbm_type = btree ; then
178                 AC_MSG_ERROR([NDBM only supports LDBM type hash])
179         fi
180 fi
181
182 if test $ol_enable_slurpd = yes ; then
183         dnl SLURPD was specifically enabled
184         if test $ol_with_threads = no ; then
185                 AC_MSG_ERROR([slurpd requires threads])
186         fi
187 fi
188
189 AC_MSG_RESULT(done)
190
191 AC_CANONICAL_HOST
192
193 ## Initialize vars
194 LDAP_LIBS=
195 LDBM_LIBS=
196 LTHREAD_LIBS=
197 LUTIL_LIBS=
198
199 LDAPD_LIBS=
200 SLAPD_LIBS=
201 SLURPD_LIBS=
202
203 BUILD_LDAPD=no
204 BUILD_SLAPD=no
205 BUILD_SLURPD=no
206
207 BUILD_LDBM=no
208 BUILD_PASSWD=no
209 BUILD_SHELL=no
210 BUILD_THREAD=no
211
212 KRB_LIBS=
213 TERMCAP_LIBS=
214
215 dnl ----------------------------------------------------------------
216 dnl Checks for programs
217
218 AC_PROG_INSTALL
219 AM_PROG_LIBTOOL
220 dnl AC_PROG_MAKE_SET
221
222 AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail,
223         $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc)
224 AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi, $PATH:/usr/ucb)
225 AC_PATH_PROG(FINGER, finger, /usr/ucb/finger, $PATH:/usr/ucb)
226
227 dnl Checks the compiler and UNIX Variants
228
229 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
230         AC_MSG_WARN([cross compiling....  some functionality will be removed.])
231
232 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
233         AC_MSG_WARN([programs compiled here do run here...])
234         AC_MSG_ERROR([  if not cross compiling, use --disable-x-compile.])
235
236 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
237         AC_MSG_WARN([programs compiled here do not run here...])
238         AC_MSG_ERROR([  if cross compiling,  add --enable-x-compile.])
239 fi
240
241 AC_PROG_CPP
242
243 AC_AIX
244 AC_ISC_POSIX
245 AC_MINIX
246
247 dnl OpenLDAP requires STDC features
248 AM_PROG_CC_STDC
249 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
250         AC_MSG_ERROR([OpenLDAP requires compiler to support STDC prototypes.])
251 fi
252
253 dnl AM_C_PROTOTYPES
254
255 dnl Checks for libraries
256
257 dnl Find socket()
258 dnl Likely combinations:
259 dnl             -lsocket [ -lnsl_s | -lnsl ]
260 dnl             -linet
261
262 AC_CHECK_FUNC(socket, [have_socket=yes], [      
263 dnl
264 dnl hopefully we won't include too many libraries
265 dnl
266         AC_CHECK_LIB(socket, main)
267         AC_CHECK_LIB(net, main)
268         AC_CHECK_LIB(nsl_s, main)
269         AC_CHECK_LIB(nsl, main)
270         AC_CHECK_LIB(inet, socket)
271         AC_CHECK_LIB(gen, main)
272 ])
273
274 dnl Check for resolv
275 AC_CHECK_LIB(resolv, res_search)
276
277 dnl HP-UX requires -lV3
278 AC_CHECK_LIB(V3, sigset)
279
280 # ISODE tests
281 ol_link_isode=no
282 if test $ol_enable_ldapd != no ; then
283         dnl look for ISODE libraries
284         AC_CHECK_LIB(xtpp, main, [
285                 ol_link_isode=yes
286                 AC_DEFINE(HAVE_XTPP,1)
287                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
288                 ],:,[-lxtdsap -lxtisode -losi])
289         AC_CHECK_LIB(dsap, main, [
290                 ol_link_isode=yes
291                 AC_DEFINE(HAVE_DSAP,1)
292                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
293                 ],:,[-lisode])
294         AC_CHECK_LIB(isode, main, [
295                 ol_link_isode=yes
296                 AC_DEFINE(HAVE_ISODE,1)
297                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
298                 ],:)
299 fi
300
301 if test $ol_link_isode != no; then
302         AC_CHECK_LIB(pp, main, [
303                 AC_DEFINE(HAVE_PP,1)
304                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
305                 ],:)
306
307         AC_PATH_PROG(PEPSY, pepsy)
308 fi
309
310 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
311         AC_CHECK_HEADERS(kerberosIV/krb.h kerberosIV/des.h)
312
313         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
314                 AC_CHECK_LIB(krb4, main, [have_k5=yes], [have_k5=no],
315                         [-lkrb5 -ldes425])
316
317                 if test $have_k5 = yes ; then
318                         ol_with_kerberos=found
319                         ol_link_kerberos=yes
320
321                         AC_DEFINE(HAVE_KERBEROS)
322
323                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
324                 fi
325         fi
326 fi
327 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
328         AC_CHECK_HEADERS(krb.h des.h)
329
330         if test $ac_cv_header_krb_h = yes ; then
331                 AC_CHECK_LIB(krb, main, [have_k4=yes], [have_k4=no], [-ldes])
332
333                 if test $have_k4 = yes ; then
334                         ol_with_kerberos=found
335                         ol_link_kerberos=yes
336
337                         AC_DEFINE(HAVE_KERBEROS)
338
339                         KRB_LIBS="-lkrb -ldes"
340                 fi
341         fi
342 fi
343
344 ol_link_threads=no
345 if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
346         AC_CHECK_HEADERS(pthread.h sched.h)
347
348         if test $ac_cv_header_pthread_h = yes ; then
349                 OL_POSIX_THREAD_VERSION
350
351                 if test $ol_cv_pthread_version = final ; then
352                         AC_DEFINE(HAVE_PTHREADS_FINAL)
353                 elif test $ol_cv_pthread_version = draft4 ; then
354                         AC_DEFINE(HAVE_PTHREADS_D4)
355                 else
356                         AC_MSG_ERROR([unknown pthread version])
357                 fi
358
359                 # consider threads found
360                 ol_with_threads=found
361
362                 OL_LINUX_THREADS
363
364                 if test $ol_cv_linux_threads = yes ; then
365                         AC_DEFINE(HAVE_LINUX_THREADS,1)
366                 fi
367
368                 dnl Now the hard part, how to link
369
370                 dnl Check for pthread support in current $LIBS
371                 AC_CHECK_FUNC(pthread_create,[ol_link_threads=yes])
372
373                 if test $ol_link_threads = no ; then
374                         dnl try -pthread
375                         AC_CACHE_CHECK([for pthread_create with -pthread],
376                                 [ol_cv_pthread_flag], [
377                                 dnl save the flags
378                                 save_LIBS="$LIBS"
379                                 LIBS="-pthread $LIBS"
380                                 AC_TRY_LINK([char pthread();],[
381                                         pthread_create();
382                                         ], ol_cv_pthread_flag=yes, ol_cv_pthread_flag=no)
383                                 dnl restore the LIBS
384                                 LIBS="$save_LIBS"
385                         ])
386
387                         if test $ol_cv_pthread_flag = yes ; then
388                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
389                                 ol_link_threads=posix
390                         fi
391                 fi
392
393                 if test $ol_link_threads = no ; then
394                         dnl try -thread
395                         AC_CACHE_CHECK([for pthread_create with -thread],
396                                 [ol_cv_thread_flag], [
397                                 dnl save the flags
398                                 save_LIBS="$LIBS"
399                                 LIBS="-thread $LIBS"
400                                 AC_TRY_LINK([char pthread();],[
401                                         pthread_create();
402                                         ], ol_cv_thread_flag=yes, ol_cv_thread_flag=no)
403                                 dnl restore the LIBS
404                                 LIBS="$save_LIBS"
405                         ])
406
407                         if test $ol_cv_thread_flag = yes ; then
408                                 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
409                                 ol_link_threads=posix
410                         fi
411                 fi
412
413                 if test $ol_link_threads = no ; then
414                         dnl try DEC Threads -lpthread -lexc
415                         save_LIBS="$LIBS"
416                         AC_CHECK_LIB(pthread, pthread_join, [
417                                 ol_link_threads=posix
418                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
419                                 if test $ol_with_yielding_select = auto ; then
420                                         ol_with_yielding_select=yes
421                                 fi
422                                 ],,[-lexc])
423                         LIBS="$save_LIBS"
424                 fi
425
426                 if test $ol_link_threads = no ; then
427                         dnl try DEC Threads -lpthreads -lmach -lexc -lc_r
428                         save_LIBS="$LIBS"
429                         AC_CHECK_LIB(pthreads, pthread_join, [
430                                 ol_link_threads=posix
431                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
432                                 if test $ol_with_yielding_select = auto ; then
433                                         ol_with_yielding_select=yes
434                                 fi
435                                 ],,[-lmach -lexc -lc_r])
436                         LIBS="$save_LIBS"
437                 fi
438
439                 if test $ol_link_threads = no ; then
440                         dnl try -lpthread
441                         save_LIBS="$LIBS"
442                         AC_CHECK_LIB(pthread, pthread_create, [
443                                 ol_link_threads=posix
444                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"])
445                         LIBS="$save_LIBS"
446                 fi
447
448                 if test $ol_link_threads = no ; then
449                         dnl try -lc_r
450                         save_LIBS="$LIBS"
451                         AC_CHECK_LIB(c_r, pthread_create, [
452                                 ol_link_threads=posix
453                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"])
454                         LIBS="$save_LIBS"
455                 fi
456
457                 if test $ol_link_threads != no ; then
458                         AC_DEFINE(HAVE_PTHREADS)
459
460                         dnl save flags
461                         save_CPPFLAGS="$CPPFLAGS"
462                         save_LIBS="$LIBS"
463                         LIBS="$LTHREAD_LIBS $LIBS"
464
465                         dnl All POSIX Thread (final) implementations should have
466                         dnl sched_yield instead of pthread yield.
467                         dnl check for both
468                         AC_CHECK_FUNCS(sched_yield pthread_yield)
469
470                         if test $ac_cv_func_sched_yield = no -a \
471                                 $ac_cv_func_pthread_yield = no ; then
472                                 dnl Digital UNIX has sched_yield() in -lrt
473                                 AC_CHECK_LIB(rt, sched_yield,
474                                         [LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
475                                         AC_DEFINE(HAVE_SCHED_YIELD,1)
476                                         ac_cv_func_sched_yield=yes],
477                                         [ac_cv_func_sched_yield=no])
478                         fi
479                         if test $ac_cv_func_sched_yield = no -a \
480                                 $ac_cv_func_pthread_yield = no ; then
481                                 dnl Solaris has sched_yield() in -lposix4
482                                 AC_CHECK_LIB(posix4, sched_yield,
483                                         [LTHREAD_LIBS="$LTHREAD_LIBS -lposix4"
484                                         AC_DEFINE(HAVE_SCHED_YIELD,1)
485                                         ac_cv_func_sched_yield=yes],
486                                         [ac_cv_func_sched_yield=no])
487                         fi
488                         if test $ac_cv_func_sched_yield = no -a \
489                                 $ac_cv_func_pthread_yield = no ; then
490                                 AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
491                                 AC_MSG_ERROR([POSIX Threads are not usable])
492                         fi
493
494                         dnl Check functions for compatibility
495                         AC_CHECK_FUNCS(pthread_kill)
496                         AC_CHECK_FUNCS( \
497                                 pthread_attr_create pthread_attr_init \
498                                 pthread_attr_destroy pthread_attr_delete \
499                                 pthread_attr_setdetachstate pthread_attr_setdetach_np \
500                         )
501
502                         dnl Check for setconcurreny functions
503                         AC_CHECK_FUNCS( \
504                                 pthread_setconcurrency \
505                                 thr_setconcurrency \
506                         )
507
508                         dnl Check if select causes an yield
509                         if test $ol_with_yielding_select = auto ; then
510                                 AC_MSG_CHECKING([if select yields])
511                                 AC_TRY_RUN([
512 #include <sys/types.h>
513 #include <sys/time.h>
514 #include <unistd.h>
515 #include <pthread.h>
516 #ifndef NULL
517 #define NULL 0
518 #endif
519
520 int fildes[2];
521
522 int task(arg)
523         int *arg;
524 {
525         int i;
526         struct timeval tv;
527
528         fd_set rfds;
529
530         tv.tv_sec=10;
531         tv.tv_usec=0;
532
533         FD_ZERO(&rfds);
534         FD_SET(fildes[0], &rfds);
535
536         /* we're not interested in any fds */
537         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
538
539         if(i < 0) {
540                 perror("select");
541                 exit(0);
542         }
543
544         exit(1); /* if we exit here, the select blocked the whole process */
545 }
546
547 int main(argc, argv)
548         int argc;
549         char **argv;
550 {
551         pthread_t t;
552
553         /* create a pipe to select */
554         if(pipe(&fildes[0])) {
555                 perror("select");
556                 exit(0);
557         }
558
559 #ifdef HAVE_PTHREAD_SETCONCURRENCY
560         (void) pthread_setconcurrency(2);
561 #else
562 #ifdef HAVE_THR_SETCONCURRENCY
563         /* Set Solaris LWP concurrency to 2 */
564         thr_setconcurrency(2);
565 #endif
566 #endif
567
568         pthread_create(&t, NULL, (void *) task, NULL);
569
570 #if HAVE_SCHED_YIELD
571         sched_yield();  /* make sure task runs first */
572 #else
573 #ifdef HAVE_PTHREAD_YIELD
574         pthread_yield();        /* make sure task runs first */
575 #endif
576 #endif
577         exit(0);
578 }
579                                 ], [ol_pthread_select_yields=yes], [ol_pthread_select_yields=no], [
580                                 AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual])])
581                                 AC_MSG_RESULT($ol_pthread_select_yields)
582
583                                 if test $ol_pthread_select_yields = yes ; then
584                                         ol_with_yielding_select=yes
585                                 fi
586                         fi
587
588 dnl                     dnl check for reentrant/threadsafe functions
589 dnl                     AC_CHECK_FUNCS( \
590 dnl                             feof_unlocked \
591 dnl                             unlocked_feof \
592 dnl                             ftrylockfile \
593 dnl                             flockfile \
594 dnl                             putc_unlocked \
595 dnl                             gmtime_r \
596 dnl                             strtok_r \
597 dnl                     )
598
599                         dnl restore flags
600                         CPPFLAGS="$save_CPPFLAGS"
601                         LIBS="$save_LIBS"
602                 else
603                         AC_MSG_ERROR([could not link with POSIX Threads])
604                 fi
605         fi
606
607         if test $ol_with_threads = posix ; then
608                 AC_MSG_ERROR([could not locate POSIX Threads])
609         fi
610 fi
611
612 if test $ol_with_threads = auto -o $ol_with_threads = mach ; then
613         dnl check for Mach CThreads
614         AC_CHECK_HEADERS(mach/cthreads.h)
615         if test $ac_cv_header_mach_cthreads_h = yes ; then
616                 ol_with_threads=found
617
618                 dnl check for cthread support in current $LIBS
619                 AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
620
621                 if test $ol_link_threads = no ; then
622                         dnl try -all_load
623                         dnl this test needs work
624                         AC_CACHE_CHECK([for cthread_fork with -all_load],
625                                 [ol_cv_cthread_all_load], [
626                                 dnl save the flags
627                                 save_LIBS="$LIBS"
628                                 LIBS="-all_load $LIBS"
629                                 AC_TRY_LINK([#include <mach/cthreads.h>],[
630                                         cthread_fork((void *)0, (void *)0);
631                                         ], ol_cv_cthread_all_load=yes, ol_cv_cthread_all_load=no)
632                                 dnl restore the LIBS
633                                 LIBS="$save_LIBS"
634                         ])
635
636                         if test $ol_cv_cthread_all_load = yes ; then
637                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
638                                 ol_link_threads=mach
639                         fi
640                 fi
641
642                 if test $ol_link_threads != no ; then
643                         : check for cthread specific functionality here
644                         AC_DEFINE(HAVE_MACH_CTHREADS,1)
645                 else
646                         AC_MSG_ERROR([could not link with Mach CThreads])
647                 fi
648         fi
649
650         if test $ol_with_threads = mach ; then
651                 AC_MSG_ERROR([could not locate Mach CThreads])
652         fi
653 fi
654
655 if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
656         dnl check for SunOS5 LWP
657         AC_CHECK_HEADERS(thread.h synch.h)
658         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
659                 AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
660
661                 if test $have_thr = yes ; then
662                         AC_DEFINE(HAVE_THR)
663                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
664                         ol_link_threads=thr
665
666                         if test $ol_with_yielding_select = auto ; then
667                                 ol_with_yielding_select=yes
668                         fi
669                 fi
670         fi
671
672         dnl check for SunOS4 LWP
673         AC_CHECK_HEADERS(lwp/lwp.h)
674         if test $ac_cv_header_lwp_lwp_h = yes ; then
675                 AC_CHECK_LIB(lwp, lwp_create, [have_lwp=yes], [have_lwp=no])
676
677                 if test $have_lwp = yes ; then
678                         AC_DEFINE(HAVE_LWP)
679                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
680                         ol_link_threads=lwp
681
682                         if test $ol_with_yielding_select = auto ; then
683                                 ol_with_yielding_select=no
684                         fi
685                 fi
686         fi
687 fi
688
689 if test $ol_with_yielding_select = yes ; then
690         AC_DEFINE(HAVE_YIELDING_SELECT,1)
691 fi
692
693 if test $ol_with_threads = manual ; then
694         dnl User thinks he can manually configure threads.
695         ol_link_threads=yes
696
697         AC_MSG_WARN([thread defines and link options must be set manually])
698
699         AC_CHECK_HEADERS(pthread.h sched.h)
700         AC_CHECK_FUNCS(sched_yield pthread_yield)
701         OL_LINUX_THREADS
702
703         AC_CHECK_HEADERS(mach/cthreads.h)
704         AC_CHECK_HEADERS(lwp/lwp.h)
705         AC_CHECK_HEADERS(thread.h synch.h)
706 fi
707
708 if test $ol_with_threads != no ; then  
709         dnl needed to get reentrant/threadsafe versions
710         dnl
711         AC_DEFINE(_REENTRANT,1)
712         AC_DEFINE(_THREAD_SAFE,1)
713         AC_DEFINE(_THREADSAFE,1)
714
715         dnl this might cause the errno symbol to be
716         dnl replaced with a function to get a thread specific errno.
717         dnl check to see if everything needs to be compiled
718         dnl with the thread libraries
719         AC_CACHE_CHECK([for thread specific errno],
720                 [ol_cv_errno_thread_specific], [
721                 AC_TRY_LINK([
722 #include <errno.h>
723                         ], [
724 int x = errno;
725                         ],
726                         [ol_cv_errno_thread_specific=yes],
727                         [ol_cv_errno_thread_specific=no])
728         ])
729
730         if test $ol_cv_errno_thread_specific != yes ; then
731                 LIBS="$LTHREAD_LIBS $LIBS"
732                 LTHREAD_LIBS=""
733         fi
734 fi  
735
736 dnl ----------------------------------------------------------------
737
738 if test $ol_link_threads = no ; then
739         if test $ol_with_threads = yes ; then
740                 AC_MSG_ERROR([no suitable thread support])
741         fi
742
743         if test $ol_with_threads = auto ; then
744                 AC_MSG_WARN([no suitable thread support, disabling threads])
745                 ol_with_threads=no
746         fi
747
748         AC_DEFINE(NO_THREADS,1)
749         LTHREAD_LIBS=""
750 fi
751
752 ol_link_ldbm=no 
753 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
754         OL_BERKELEY_DB2
755
756         if test $ol_cv_berkeley_db2 = yes ; then
757                 ol_link_ldbm=db2
758                 ol_with_ldbm_api=db2
759
760                 if test $ol_with_ldbm_type = hash ; then
761                         AC_DEFINE(LDBM_USE_DBHASH,1)
762                 else
763                         AC_DEFINE(LDBM_USE_DBBTREE,1)
764                 fi
765
766                 dnl $ol_cv_lib_db2 should be yes or -ldb
767                 dnl (it could be no, but that would be an error
768                 if test $ol_cv_lib_db2 != yes ; then
769                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
770                 fi
771         fi
772 fi
773
774 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
775         OL_BERKELEY_DB
776
777         if test $ol_cv_berkeley_db = yes ; then
778                 ol_link_ldbm=db
779                 ol_with_ldbm_api=db
780
781                 if test $ol_with_ldbm_type = hash ; then
782                         AC_DEFINE(LDBM_USE_DBHASH,1)
783                 else
784                         AC_DEFINE(LDBM_USE_DBBTREE,1)
785                 fi
786
787                 dnl $ol_cv_lib_db should be yes or -ldb
788                 dnl (it could be no, but that would be an error
789                 if test $ol_cv_lib_db != yes ; then
790                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
791                 fi
792         fi
793 fi
794
795 if test $ol_with_ldbm_api = manual ; then
796         dnl User thinks he can manually configure LDBM api.
797         ol_link_ldbm=yes
798
799         AC_MSG_WARN([LDBM defines and link options must be set manually])
800
801         AC_CHECK_HEADERS(db.h db_185.h gdbm.h ndbm.h)
802 fi
803
804 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
805         AC_MSG_WARN(Could not find LDBM with BTREE support)
806         ol_with_ldbm_api=none
807 fi
808
809 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
810         OL_GDBM
811
812         if test $ol_cv_gdbm = yes ; then
813                 ol_link_ldbm=gdbm
814                 ol_with_ldbm_api=gdbm
815
816                 if test $ol_cv_lib_gdbm != yes ; then
817                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
818                 fi
819         fi
820 fi
821
822 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then
823         OL_NDBM
824
825         if test $ol_cv_ndbm = yes ; then
826                 if test $ol_with_ldbm_api = auto ; then
827                         AC_MSG_WARN([Attempting to use NDBM.  Functionality will be limited.])
828                 fi
829
830                 ol_link_ldbm=ndbm
831                 ol_with_ldbm_api=ndbm
832
833                 if test $ol_cv_lib_ndbm != yes ; then
834                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
835                 fi
836         fi
837 fi
838
839 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
840         AC_MSG_WARN(could not find suitable LDBM backend)
841         if test $ol_enable_ldbm = yes ; then
842                 AC_MSG_ERROR(select appropriate LDBM options or disable)
843         fi
844
845         AC_MSG_WARN(disabling LDBM)
846         ol_enable_ldbm=no
847 fi
848
849 if test $ol_enable_wrappers = yes ; then
850         AC_CHECK_LIB(wrap, hosts_access,
851                 [have_wrappers=yes], [have_wrappers=no])
852
853         if test $have_wrappers = yes ; then
854                 AC_DEFINE(HAVE_TCPD)
855                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
856         else
857                 AC_MSG_WARN(could not find -lwrap)
858                 if test $ol_enable_wrappers = yes ; then
859                         AC_MSG_ERROR(could not find wrappers, select appropriate options or disable)
860                 fi
861
862                 AC_MSG_WARN(disabling wrappers support)
863                 ol_enable_wrappers=no
864         fi
865
866 fi
867
868 # ud needs termcap (should insert check here)
869 ol_link_termcap=no
870 AC_CHECK_HEADERS(termcap.h ncurses.h)
871
872 if test $ol_link_termcap = no ; then
873         AC_CHECK_LIB(termcap, tputs, [have_termcap=yes], [have_termcap=no])
874         if test $have_termcap = yes ; then
875                 AC_DEFINE(HAVE_TERMCAP)
876                 ol_link_termcap=yes
877                 TERMCAP_LIBS=-ltermcap
878         fi
879 fi
880
881 if test $ol_link_termcap = no ; then
882         AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
883         if test $have_ncurses = yes ; then
884                 AC_DEFINE(HAVE_NCURSES)
885                 ol_link_termcap=yes
886                 TERMCAP_LIBS=-lncurses
887         fi
888 fi
889
890 if test $ol_link_termcap = no ; then
891         AC_DEFINE(NO_TERMCAP,1)
892         TERMCAP_LIBS=
893 fi
894
895 # FreeBSD (and others) have crypt(3) in -lcrypt
896 if test $ol_enable_crypt != no ; then
897         AC_CHECK_FUNC(crypt, [have_crypt=yes], [
898                 AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
899                         have_crypt=yes], [have_crypt=no])])
900
901         if test $have_crypt = yes ; then
902                 AC_DEFINE(HAVE_CRYPT,1)
903         else
904                 AC_MSG_WARN(could not find crypt)
905                 if test $ol_enable_crypt = yes ; then
906                         AC_MSG_ERROR(could not find crypt, select appropriate options or disable)
907                 fi
908
909                 AC_MSG_WARN(disabling crypt support)
910                 ol_enable_crypt=no
911         fi
912 fi
913
914 # FreeBSD (and others) have setproctitle(3) in -lutil
915 if test $ol_enable_proctitle != no ; then
916         AC_CHECK_FUNC(setproctitle,     [have_setproctitle=yes], [
917                 AC_CHECK_LIB(util, setproctitle,
918                         [have_setproctitle=yes
919                         LUTIL_LIBS="$LUTIL_LIBS -lutil"],
920                         [have_setproctitle=no
921                         LIBOBJS="$LIBOBJS setproctitle.o"])])
922
923         if test $have_setproctitle = yes ; then
924                 AC_DEFINE(HAVE_SETPROCTITLE,1)
925         fi
926 fi
927
928 dnl ----------------------------------------------------------------
929 dnl Checks for header files.
930 AC_HEADER_STDC
931
932 if test $ac_cv_header_stdc != yes; then
933         AC_MSG_WARN([could not Standard C compliant headers])
934 fi
935
936 AC_HEADER_DIRENT
937 AC_HEADER_SYS_WAIT
938 AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
939 if test $am_cv_sys_posix_termios = yes ; then
940         AC_DEFINE(HAVE_POSIX_TERMIOS,1)
941 fi
942
943 AC_CHECK_HEADERS(       \
944         crypt.h                 \
945         errno.h                 \
946         fcntl.h                 \
947         filio.h                 \
948         getopt.h                \
949         libutil.h               \
950         limits.h                \
951         malloc.h                \
952         memory.h                \
953         regex.h                 \
954         psap.h                  \
955         pwd.h                   \
956         sgtty.h                 \
957         stdarg.h                \
958         stddef.h                \
959         string.h                \
960         strings.h               \
961         sys/file.h              \
962         sys/filio.h             \
963         sys/errno.h             \
964         sys/ioctl.h             \
965         sys/param.h             \
966         sys/resource.h  \
967         sys/socket.h    \
968         sys/syslog.h    \
969         sys/time.h              \
970         sys/types.h             \
971         syslog.h                \
972         termios.h               \
973         unistd.h                \
974 )
975
976 dnl ----------------------------------------------------------------
977 dnl Checks for typedefs, structures, and compiler characteristics.
978 AC_TYPE_GETGROUPS dnl requires AC_TYPE_UID_T
979 AC_TYPE_MODE_T
980 AC_TYPE_OFF_T
981 AC_TYPE_PID_T
982 AM_TYPE_PTRDIFF_T
983 AC_TYPE_SIGNAL
984 AC_TYPE_SIZE_T
985 AC_STRUCT_ST_BLKSIZE
986 AC_HEADER_TIME
987 AC_STRUCT_TM
988
989 OL_C_UPPER_LOWER
990 AC_C_CONST
991
992 if test $cross_compiling = yes ; then
993         AC_DEFINE(CROSS_COMPILING, 1)
994 else
995         AC_C_BIGENDIAN
996         AC_CHECK_SIZEOF(short) 
997         AC_CHECK_SIZEOF(int) 
998         AC_CHECK_SIZEOF(long)
999 fi
1000
1001 dnl ----------------------------------------------------------------
1002 dnl Checks for library functions.
1003 AC_FUNC_MEMCMP
1004 dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
1005 AC_FUNC_STRFTIME
1006 dnl AM_FUNC_STRTOD
1007 AC_FUNC_VPRINTF
1008
1009 if test $ac_cv_func_vprintf = yes ; then
1010         dnl check for vsnprintf
1011         AC_CHECK_FUNCS(vsnprintf)
1012 fi
1013
1014 AC_FUNC_WAIT3
1015
1016 AC_CHECK_FUNCS(         \
1017         bcopy                   \
1018         flock                   \
1019         getdtablesize   \
1020         gethostname             \
1021         getpwuid                \
1022         gettimeofday    \
1023         lockf                   \
1024         memcpy                  \
1025         memmove                 \
1026         mkstemp                 \
1027         res_search              \
1028         select                  \
1029         setpwfile               \
1030         setsid                  \
1031         signal                  \
1032         sigset                  \
1033         snprintf                \
1034         socket                  \
1035         strerror                \
1036         strpbrk                 \
1037         strrchr                 \
1038         strsep                  \
1039         strstr                  \
1040         strtok                  \
1041         strtol                  \
1042         strtoul                 \
1043         sysconf                 \
1044         waitpid                 \
1045 )
1046
1047 dnl We actually may need to replace more than this.
1048 AC_REPLACE_FUNCS(getopt strdup tempnam)
1049
1050 dnl ----------------------------------------------------------------
1051 # Check Configuration
1052 OL_SYS_ERRLIST
1053
1054 dnl ----------------------------------------------------------------
1055 dnl Sort out defines
1056
1057 if test $ol_enable_debug != no ; then
1058         AC_DEFINE(LDAP_DEBUG,1)
1059 fi
1060 dnl     if test $ol_enable_syslog != no ; then
1061 dnl             AC_DEFINE(LDAP_SYSLOG,1)
1062 dnl     fi
1063 if test $ol_enable_libui = yes ; then
1064         AC_DEFINE(LDAP_LIBUI,1)
1065 fi
1066 if test $ol_enable_cache = no ; then
1067         AC_DEFINE(LDAP_NOCACHE,1)
1068 fi
1069 if test $ol_enable_dns != no ; then
1070         AC_DEFINE(LDAP_DNS,1)
1071 fi
1072 if test $ol_enable_proctitle != no ; then
1073         AC_DEFINE(LDAP_PROCTITLE,1)
1074 fi
1075 if test $ol_enable_referrals != no ; then
1076         AC_DEFINE(LDAP_REFERRALS,1)
1077 fi
1078 if test $ol_enable_cldap != no ; then
1079         AC_DEFINE(LDAP_CONNECTIONLESS,1)
1080 fi
1081
1082 if test $ol_enable_aclgroups != no ; then
1083         AC_DEFINE(SLAPD_ACLGROUPS,1)
1084 fi
1085 if test $ol_enable_crypt != no ; then
1086         AC_DEFINE(SLAPD_CRYPT,1)
1087 fi
1088 if test $ol_enable_md5 != no ; then
1089         AC_DEFINE(SLAPD_MD5,1)
1090 fi
1091 if test $ol_enable_sha1 != no ; then
1092         AC_DEFINE(SLAPD_SHA1,1)
1093 fi
1094 if test $ol_enable_phonetic != no ; then
1095         AC_DEFINE(SLAPD_PHONETIC,1)
1096 fi
1097 if test $ol_enable_rlookups != no ; then
1098         AC_DEFINE(SLAPD_RLOOKUPS,1)
1099 fi
1100
1101 if test $ol_link_ldbm != no ; then
1102         AC_DEFINE(SLAPD_LDBM,1)
1103         BUILD_SLAPD=yes
1104         BUILD_LDBM=yes
1105 fi
1106
1107 if test $ol_enable_passwd != no ; then
1108         AC_DEFINE(SLAPD_PASSWD,1)
1109         BUILD_SLAPD=yes
1110         BUILD_PASSWD=yes
1111 fi
1112
1113 if test $ol_enable_shell != no ; then
1114         AC_DEFINE(SLAPD_SHELL,1)
1115         BUILD_SLAPD=yes
1116         BUILD_SHELL=yes
1117 fi
1118
1119 if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
1120         $BUILD_SLAPD = yes ; then
1121         BUILD_SLURPD=yes
1122 fi
1123
1124 if test $ol_link_isode != no ; then
1125         BUILD_LDAPD=yes
1126 fi
1127
1128 dnl ----------------------------------------------------------------
1129
1130 AC_SUBST(BUILD_LDAPD)
1131 AC_SUBST(BUILD_SLAPD)
1132   AC_SUBST(BUILD_LDBM)
1133   AC_SUBST(BUILD_PASSWD)
1134   AC_SUBST(BUILD_SHELL)
1135 AC_SUBST(BUILD_SLURPD)
1136
1137
1138 AC_SUBST(LDAP_LIBS)
1139 AC_SUBST(LDAPD_LIBS)
1140 AC_SUBST(SLAPD_LIBS)
1141 AC_SUBST(SLURPD_LIBS)
1142 AC_SUBST(LDBM_LIBS)
1143 AC_SUBST(LTHREAD_LIBS)
1144 AC_SUBST(LUTIL_LIBS)
1145
1146 AC_SUBST(KRB_LIBS)
1147 AC_SUBST(TERMCAP_LIBS)
1148
1149 dnl ----------------------------------------------------------------
1150 dnl final output
1151 dnl
1152
1153 AC_OUTPUT( \
1154 Makefile:build/top.mk:Makefile.in:build/dir.mk \
1155 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
1156 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
1157 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
1158 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
1159 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
1160 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
1161 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
1162 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
1163 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
1164 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
1165 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
1166 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
1167 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
1168 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
1169 include/Makefile:build/top.mk:include/Makefile.in \
1170 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
1171 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
1172 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
1173 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
1174 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
1175 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
1176 libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk:build/lib-static.mk    \
1177 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
1178 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
1179 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
1180 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
1181 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
1182 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
1183 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
1184 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
1185 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
1186 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
1187 tests/Makefile:build/top.mk:tests/Makefile.in \
1188 ,[
1189 date > stamp-h
1190 echo Please \"make depend\" to build dependencies
1191 ])