* configure.ac: detect /usr/local/BerkeleyDB.4.3
[citadel.git] / citadel / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 dnl $Id$
3 AC_PREREQ(2.52)
4 AC_INIT([Citadel], [6.15], [http://uncensored.citadel.org/])
5 AC_REVISION([$Revision$])
6 AC_CONFIG_SRCDIR([citserver.c])
7 AC_PREFIX_DEFAULT(/usr/local/citadel)
8 if test "$prefix" = NONE; then
9         AC_DEFINE_UNQUOTED(BBSDIR, "$ac_default_prefix")
10 else
11         AC_DEFINE_UNQUOTED(BBSDIR, "$prefix")
12 fi
13
14 AC_ARG_ENABLE(autologin, [  --disable-autologin     disable autologin (default is enabled if possible)])
15 AC_ARG_ENABLE(chkpwd, [  --disable-chkpwd        don't build 'chkpwd'])
16
17 AC_ARG_ENABLE(threaded-client, [  --disable-threaded-client
18                           disable multithreaded client])
19
20 AC_ARG_ENABLE(pie, [  --enable-pie            build position-independent executables])
21
22 AC_ARG_WITH(pam, [  --with-pam              use PAM if present (see PAM.txt before you try this)])
23 AC_ARG_WITH(kthread, [  --with-kthread          use kernel threads (on FreeBSD) (not recommended yet)])
24 AC_ARG_WITH(db, [  --with-db@<:@=DIR@:>@         use Sleepycat DB 3.x @<:@DIR=/usr/local/BerkeleyDB.3.@<:@123@:>@@:>@])
25 AC_ARG_WITH(ssl,
26         [  --with-ssl=PATH     Specify path to OpenSSL installation ],
27         [
28                 if test "x$withval" != "xno" ; then
29                         tryssldir=$withval
30                 fi
31         ]
32 )
33 AC_ARG_WITH(ncurses, [  --without-ncurses       don't use ncurses])
34
35 AC_ARG_WITH(with_zlib, [  --with-zlib             use zlib compression if present])
36 AC_ARG_WITH(with_ldap, [  --with-ldap             use OpenLDAP client library])
37 AC_ARG_WITH(with_libical, [  --with-libical          use libical calendaring library])
38 AC_ARG_WITH(with_newt, [  --with-newt          use newt window library])
39
40 if test "x$with_db" != xno -a "x$with_db" != xyes -a "$with_db"; then
41         db_dir="$with_db"
42         with_db=yes
43 else
44         test -f /usr/local/lib/libdb.a -o -f /usr/local/lib/libdb.so \
45           -o -f /usr/local/lib/libdb4.a -o -f /usr/local/lib/libdb4.so \
46           && db_dir=/usr/local
47
48         test -d /usr/local/BerkeleyDB.4.1 && db_dir=/usr/local/BerkeleyDB.4.1
49         test -d /usr/local/BerkeleyDB.4.2 && db_dir=/usr/local/BerkeleyDB.4.2
50         test -d /usr/local/BerkeleyDB.4.3 && db_dir=/usr/local/BerkeleyDB.4.3
51 fi
52
53 dnl By default, we only build the client (citadel and whobbs) unless we can
54 dnl figure out how to build with POSIX threads.
55 TARGETS=client
56
57 AC_CANONICAL_HOST
58 PTHREAD_DEFS=-D_REENTRANT
59 AC_MSG_CHECKING([how to compile with POSIX threads])
60 case "$host" in
61         dnl BSDI 3.0 wants relocatable object modules instead of shared libs
62         dnl for dlopen(), and has a wrapper script to link with shared libs.
63         dnl Also has stupid non-reentrant gethostbyaddr() and friends.
64         *-*-bsdi[123]*)
65                 test -z "$CC" -a -x /usr/bin/shlicc2 && CC=shlicc2
66                 AC_DEFINE(HAVE_NONREENTRANT_NETDB)
67                 AC_MSG_RESULT([Old BSDI])
68         ;;
69         *-*-bsdi*)
70                 AC_DEFINE(HAVE_NONREENTRANT_NETDB)
71                 AC_MSG_RESULT([BSD/OS])
72         ;;
73         dnl Curses support on Mac OS X is kind of screwed at the moment.
74         *-*-darwin*)
75                 AC_DEFINE(DISABLE_CURSES)
76                 AC_MSG_RESULT([Mac OS X])
77         ;;
78         dnl Digital Unix has an odd way to build for pthreads, and we can't
79         dnl build pthreads programs with gcc due to header problems.
80         alpha*-dec-osf*)
81                 test -z "$CC" && CC=cc
82                 LIBS="-lpthread -lexc $LIBS"
83                 check_pthread=no
84                 AC_MSG_RESULT([Tru64 or Digital UNIX])
85         ;;
86         dnl FreeBSD is similar to Digital UNIX with DEC C, which has a -pthread flag:
87         *-*-freebsd*)
88                 if test "$with_kthread" = yes; then
89                         LIBS="-kthread $LIBS"
90                 else
91                         LIBS="-pthread $LIBS"
92                 fi
93                 check_pthread=no
94                 PTHREAD_DEFS=-D_THREAD_SAFE
95                 AC_MSG_RESULT([FreeBSD])
96         ;;
97         *-*-openbsd*)
98                 LIBS="-pthread $LIBS"
99                 check_pthread=no
100                 PTHREAD_DEFS=-pthread
101                 AC_MSG_RESULT([OpenBSD])
102         ;;
103         *-*-linux*)
104                 PTHREAD_DEFS="-D_REENTRANT -pthread"
105                 AC_MSG_RESULT([Linux])
106         ;;
107         *-*-solaris*)
108                 PTHREAD_DEFS="-D_REENTRANT -D_PTHREADS"
109                 AC_MSG_RESULT([Solaris])
110         ;;
111         *-*-cygwin*)
112                 SERVER_LDFLAGS="-Wl,-subsystem,windows"
113                 AC_MSG_RESULT([Cygwin])
114         ;;
115         *)
116                 AC_MSG_RESULT([default])
117         ;;
118 esac
119 dnl DEFS="$DEFS $PTHREAD_DEFS"
120
121 dnl Checks for programs.
122 AC_PROG_CC
123
124 dnl Set up system-dependent compiler flags.
125 if test "$GCC" = yes; then
126         if test "$CC" = icc; then
127                 CFLAGS="$CFLAGS -w1"
128         else
129                 case "$host" in
130                         *-*-solaris*|alpha*-dec-osf*)
131                                 CFLAGS="$CFLAGS -Wall -Wcast-qual -Wcast-align -Wno-char-subscripts $PTHREAD_DEFS"
132                         ;;
133                         *)
134                         CFLAGS="$CFLAGS -Wall -Wcast-qual -Wcast-align -Wstrict-prototypes $PTHREAD_DEFS"
135                         ;;
136                 esac
137         fi
138 fi
139
140 if test "x$enable_pie" = xyes; then
141         save_CFLAGS="$CFLAGS"
142         save_LDFLAGS="$LDFLAGS"
143         CFLAGS="$CFLAGS -fpie"
144         LDFLAGS="$LDFLAGS -pie -fpie"
145         AC_CACHE_CHECK([whether compiler accepts -pie -fpie], ac_cv_pie_fpie,
146         [AC_TRY_LINK([], [],
147         ac_cv_pie_fpie=yes, ac_cv_pie_fpie=no)])
148         if test $ac_cv_pie_fpie = no; then
149                 CFLAGS="$save_CFLAGS"
150                 LDFLAGS="$save_LDFLAGS"
151         fi
152 fi
153
154 AC_PROG_INSTALL
155 AC_PROG_YACC
156 missing_dir=`cd $ac_aux_dir && pwd`
157 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
158 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
159
160 dnl Checks for system services.
161
162 dnl Check the size of various builtin types; see typesize.h (error)
163 AC_CHECK_SIZEOF(char, 0)
164 AC_CHECK_SIZEOF(short, 0)
165 AC_CHECK_SIZEOF(int, 0)
166 AC_CHECK_SIZEOF(long, 0)
167 dnl AC_CHECK_SIZEOF(long long, 0)
168
169 dnl Checks for libraries.
170
171 dnl We want to test for the following in libc before checking for their
172 dnl respective libraries, because some systems (like Irix) have both, and the
173 dnl non-libc versions may be broken.
174 AC_CHECK_FUNCS(crypt gethostbyname connect)
175
176 if test "$ac_cv_func_gethostbyname" = no; then
177         AC_CHECK_LIB(nsl, gethostbyname)
178 fi
179
180 if test "$ac_cv_func_connect" = no; then
181         AC_CHECK_LIB(socket, connect)
182 fi
183
184 dnl Check for Solaris realtime support
185 AC_CHECK_LIB(rt, sched_yield)
186
187 dnl Determine the system's authentication capabilities, if autologin is
188 dnl requested. We currently support PAM, standard getpwnam(), and getspnam()
189 dnl (Linux shadow passwords)
190 if test "$enable_autologin" != no; then
191         if test "$with_pam" = yes; then
192                 save_LIBS=$LIBS
193                 AC_CHECK_LIB(pam, pam_start, [chkpwd_LIBS="-lpam $chkpwd_LIBS"
194                         LIBS="-lpam $LIBS"])
195                 AC_CHECK_FUNCS(pam_start)
196                 test "$enable_chkpwd" != no && LIBS=$save_LIBS
197         fi
198         if test "$ac_cv_func_pam_start" = no -o "$with_pam" != yes; then
199                 save_LIBS=$LIBS
200                 AC_SEARCH_LIBS(getspnam, shadow, [
201                         if test "$ac_cv_search_getspnam" = -lshadow; then
202                                 chkpwd_LIBS="-lshadow $chkpwd_LIBS"
203                         fi])
204                 test "$enable_chkpwd" != no && LIBS=$save_LIBS
205                 if test "$ac_cv_func_crypt" = no; then
206                         AC_CHECK_LIB(crypt, crypt, [
207                                 chkpwd_LIBS="-lcrypt $chkpwd_LIBS"
208                                 test "$enable_chkpwd" = no && \
209                                         LIBS="-lcrypt $LIBS"])
210                 fi
211         fi
212         if test "$ac_cv_func_crypt" = yes -o "$ac_cv_lib_crypt_crypt" = yes -o "$ac_cv_func_pam_start" = yes; then
213                 AC_DEFINE(ENABLE_AUTOLOGIN)
214                 if test "$enable_chkpwd" != no; then
215                         AC_DEFINE(ENABLE_CHKPWD)
216                         CHKPWD=chkpwd
217                 else
218                         AUTH=auth.lo
219                 fi
220         fi
221 fi
222
223 test -f /usr/local/lib/libresolv.a && LDFLAGS="$LDFLAGS -L/usr/local/lib"
224 AC_CHECK_LIB(resolv, res_query, RESOLV="$RESOLV -lresolv")
225
226 if test "x$with_ncurses" != "xno"; then
227         AC_SEARCH_LIBS(tgetent, [ncurses curses termcap])
228         AC_SEARCH_LIBS(scrollok, [ncurses curses])
229         AC_SEARCH_LIBS(initscr, [ncurses curses])
230 else
231         AC_SEARCH_LIBS(tgetent, [curses termcap])
232         AC_SEARCH_LIBS(initscr, [curses])
233 fi
234 AC_CHECK_FUNCS(vw_printw wcolor_set resizeterm wresize)
235
236 dnl Check for libpthread(s) if we're not using Digital UNIX or FreeBSD. (On
237 dnl which the -pthread flag takes care of this.)
238 if test "$check_pthread" != no; then
239         AC_CHECK_LIB(pthread, pthread_create)
240         AC_CHECK_LIB(pthreads, pthread_create)
241 fi
242
243 test -d /usr/kerberos/include && CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
244
245 # The big search for OpenSSL
246 if test "$with_ssl" != "no"; then
247         saved_LIBS="$LIBS"
248         saved_LDFLAGS="$LDFLAGS"
249         saved_CFLAGS="$CFLAGS"
250         if test "x$prefix" != "xNONE"; then
251                 tryssldir="$tryssldir $prefix"
252         fi
253         AC_CACHE_CHECK([for OpenSSL], ac_cv_openssldir, [
254                 for ssldir in $tryssldir "" /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
255                         CFLAGS="$saved_CFLAGS"
256                         LDFLAGS="$saved_LDFLAGS"
257                         LIBS="$saved_LIBS -lssl -lcrypto"
258         
259                         # Skip directories if they don't exist
260                         if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
261                                 continue;
262                         fi
263                         if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
264                                 # Try to use $ssldir/lib if it exists, otherwise
265                                 # $ssldir
266                                 if test -d "$ssldir/lib" ; then
267                                         LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
268                                         if test ! -z "$need_dash_r" ; then
269                                                 LDFLAGS="-R$ssldir/lib $LDFLAGS"
270                                         fi
271                                 else
272                                         LDFLAGS="-L$ssldir $saved_LDFLAGS"
273                                         if test ! -z "$need_dash_r" ; then
274                                                 LDFLAGS="-R$ssldir $LDFLAGS"
275                                         fi
276                                 fi
277                                 # Try to use $ssldir/include if it exists, otherwise
278                                 # $ssldir
279                                 if test -d "$ssldir/include" ; then
280                                         CFLAGS="-I$ssldir/include $saved_CFLAGS"
281                                 else
282                                         CFLAGS="-I$ssldir $saved_CFLAGS"
283                                 fi
284                         fi
285         
286                         # Basic test to check for compatible version and correct linking
287                         # *does not* test for RSA - that comes later.
288                         AC_TRY_RUN(
289                                 [
290         #include <string.h>
291         #include <openssl/rand.h>
292         int main(void)
293         {
294                 char a[2048];
295                 memset(a, 0, sizeof(a));
296                 RAND_add(a, sizeof(a), sizeof(a));
297                 return(RAND_status() <= 0);
298         }
299                                 ],
300                                 [
301                                         found_crypto=1
302                                         break;
303                                 ], []
304                         )
305         
306                         if test ! -z "$found_crypto" ; then
307                                 break;
308                         fi
309                 done
310         
311                 if test -z "$ssldir" ; then
312                         ssldir="(system)"
313                 fi
314         
315                 if test ! -z "$found_crypto" ; then
316                         ac_cv_openssldir=$ssldir
317                 else
318                         ac_cv_openssldir="no"
319                 fi
320         ])
321         LIBS="$saved_LIBS"
322         LDFLAGS="$saved_LDFLAGS"
323         CFLAGS="$saved_CFLAGS"
324         
325         if test "x$ac_cv_openssldir" != "xno" ; then
326                 AC_DEFINE(HAVE_OPENSSL)
327                 LIBS="-lssl -lcrypto $LIBS"
328                 dnl Need to recover ssldir - test above runs in subshell
329                 ssldir=$ac_cv_openssldir
330                 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr" -a "x$ssldir" != "x(system)"; then
331                         # Try to use $ssldir/lib if it exists, otherwise
332                         # $ssldir
333                         if test -d "$ssldir/lib" ; then
334                                 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
335                                 if test ! -z "$need_dash_r" ; then
336                                         LDFLAGS="-R$ssldir/lib $LDFLAGS"
337                                 fi
338                         else
339                                 LDFLAGS="-L$ssldir $saved_LDFLAGS"
340                                 if test ! -z "$need_dash_r" ; then
341                                         LDFLAGS="-R$ssldir $LDFLAGS"
342                                 fi
343                         fi
344                         # Try to use $ssldir/include if it exists, otherwise
345                         # $ssldir
346                         if test -d "$ssldir/include" ; then
347                                 CFLAGS="-I$ssldir/include $saved_CFLAGS"
348                         else
349                                 CFLAGS="-I$ssldir $saved_CFLAGS"
350                         fi
351                 fi
352         fi
353 fi
354
355 if test "x$with_db" != xno; then
356         test "$db_dir" && LDFLAGS="$LDFLAGS -L$db_dir/lib"
357
358         dblib=""
359
360         if test -d "$db_dir/include/db4"; then
361                 CPPFLAGS="$CPPFLAGS -I$db_dir/include/db4"
362                 dblib="db4"
363         elif test "$db_dir"; then
364                 CPPFLAGS="$CPPFLAGS -I$db_dir/include"
365         elif test -d /usr/include/db4; then
366                 CPPFLAGS="$CPPFLAGS -I/usr/include/db4"
367                 dblib="db4"
368         fi
369
370
371         AC_CHECK_DB([db db-4.1 db-4 db4],
372                     [
373                      DATABASE=database_sleepycat.c
374                     ],
375                     AC_MSG_ERROR([[Can not locate a suitable Berkeley DB
376                                   library.  Use --with-db=PATH to specify
377                                   the path]]))
378
379 fi
380
381
382 dnl Checks for the zlib compression library.
383 if test "x$with_zlib" != xno ; then
384         AC_CHECK_HEADERS(zlib.h,
385                 [AC_CHECK_LIB(z, zlibVersion,
386                         [ok_zlib=yes],,
387         )])
388 fi
389
390 if test "x$ok_zlib" = xyes ; then
391         SERVER_LIBS="-lz $SERVER_LIBS"
392         AC_DEFINE(HAVE_ZLIB)
393 fi
394
395
396
397
398 dnl Checks for the OpenLDAP client library.
399 if test "x$with_ldap" != xno ; then
400         AC_CHECK_HEADERS(ldap.h,
401                 [AC_CHECK_LIB(ldap, ldap_init,
402                         [ok_ldap=yes],,
403         )])
404 fi
405
406 if test "x$ok_ldap" = xyes ; then
407         SERVER_LIBS="-lldap $SERVER_LIBS"
408         AC_DEFINE(HAVE_LDAP)
409 fi
410
411
412
413
414 dnl Checks for the newt window library.
415 if test "x$with_newt" != xno ; then
416         AC_CHECK_HEADERS(newt.h,
417                 [AC_CHECK_LIB(newt, newtInit,
418                         [ok_newt=yes],,
419         )])
420 fi
421
422 if test "x$ok_newt" = xyes ; then
423         SETUP_LIBS="-lnewt $SETUP_LIBS"
424         AC_DEFINE(HAVE_NEWT)
425 fi
426
427
428
429
430
431
432 dnl Checks for the libical calendaring library.
433 if test "x$with_libical" != xno ; then
434         AC_CHECK_HEADERS(ical.h,
435                 [AC_CHECK_LIB(ical, icalcomponent_new,
436                         [ok_libical=yes],,
437         )])
438 fi
439
440 if test "x$ok_libical" = xyes ; then
441
442         AC_TRY_RUN(
443                 [
444 #include <ical.h>
445 main() {
446         float v;
447         int i;
448         sscanf(ICAL_VERSION, "%f", &v);
449         printf("libical version: %0.2f\n", v);
450         v = v * 100.0;
451         i = (int) v;
452         if (i >= 24) {
453                 printf("This version is ok.\n");
454                 return(0);
455         }
456         printf("libical 0.24 or newer required.\n");
457         printf("Citadel will be built without calendar support.\n");
458         return(1);
459 }
460                 ], 
461                 [
462                         SERVER_LIBS="-lical $SERVER_LIBS"
463                         AC_DEFINE(HAVE_LIBICAL)
464                 ]
465         )
466 fi
467
468
469
470
471 dnl Checks for header files.
472 AC_HEADER_DIRENT
473 AC_HEADER_STDC
474 AC_HEADER_SYS_WAIT
475
476 dnl
477 dnl TODO: for the DB header checks, we should check whether the headers
478 dnl define db_env_create, somehow
479 dnl
480 AC_CHECK_HEADERS(curses.h dl.h fcntl.h limits.h malloc.h termios.h sys/ioctl.h sys/select.h sys/time.h sys/prctl.h syslog.h unistd.h utmp.h utmpx.h paths.h db.h db4/db.h pthread.h netinet/in.h arpa/nameser.h arpa/nameser_compat.h)
481
482 dnl
483 dnl need to check if this is actually compilable, sometimes there are
484 dnl conflicts with the system's headers (eg solaris xpg4 style headers)
485 dnl
486 if test "x$with_ncurses" != xno; then
487         AC_CHECK_HEADERS(ncurses.h,,,[ ])
488 fi
489
490 AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H),,
491 [#ifdef HAVE_SYS_TYPES_H
492 #include <sys/types.h>
493 #endif
494 #ifdef HAVE_NETINET_IN_H
495 #include <netinet/in.h>
496 #endif
497 #ifdef HAVE_ARPA_NAMESER_H
498 #include <arpa/nameser.h>
499 #endif])
500
501
502 dnl Checks for typedefs, structures, and compiler characteristics.
503 AC_C_CONST
504 AC_TYPE_PID_T
505 AC_TYPE_SIZE_T
506 AC_HEADER_TIME
507
508 dnl defined in acinclude.m4:
509 CIT_STRUCT_TM
510
511 AC_CACHE_CHECK([for ut_type in struct utmp], ac_cv_struct_ut_type,
512 [AC_TRY_COMPILE([#include <sys/types.h>
513 #include <utmp.h>], [struct utmp ut; ut.ut_type;],
514 ac_cv_struct_ut_type=yes, ac_cv_struct_ut_type=no)])
515 if test $ac_cv_struct_ut_type = yes; then
516         AC_DEFINE(HAVE_UT_TYPE)
517 fi
518
519 AC_CACHE_CHECK([for ut_host in struct utmp], ac_cv_struct_ut_host,
520 [AC_TRY_COMPILE([#include <sys/types.h>
521 #include <utmp.h>], [struct utmp ut; ut.ut_host;],
522 ac_cv_struct_ut_host=yes, ac_cv_struct_ut_host=no)])
523 if test $ac_cv_struct_ut_host = yes; then
524         AC_DEFINE(HAVE_UT_HOST)
525 fi
526
527 dnl Checks for library functions.
528 AC_FUNC_GETPGRP
529 AC_PROG_GCC_TRADITIONAL
530 AC_TYPE_SIGNAL
531 AC_FUNC_VPRINTF
532 AC_CHECK_FUNCS(getspnam getutxline mkdir mkfifo mktime rmdir select socket strerror strcasecmp strncasecmp)
533
534 dnl Now check for pthreads
535
536 dnl On some platforms, AC_CHECK_FUNC[S] doesn't work for pthreads programs;
537 dnl we need to include pthread.h
538
539 AC_CACHE_CHECK([for pthread_cancel], ac_cv_func_pthread_cancel,
540 [AC_TRY_LINK([#include <pthread.h>],
541 [       pthread_t thread;
542
543         /* The GNU C library defines this for functions which it implements
544            to always fail with ENOSYS.  Some functions are actually named
545            something starting with __ and the normal name is an alias.  */
546 #if defined (__stub_pthread_cancel) || defined (__stub___pthread_cancel)
547         choke me
548 #else
549         pthread_cancel(thread);
550 #endif],
551 ac_cv_func_pthread_cancel=yes, ac_cv_func_pthread_cancel=no)])
552 if test "$ac_cv_func_pthread_cancel" = yes; then
553         AC_DEFINE(HAVE_PTHREAD_CANCEL)
554 fi
555
556 AC_CACHE_CHECK([for pthread_create], ac_cv_func_pthread_create,
557 [AC_TRY_LINK([#include <pthread.h>],
558 [       /* The GNU C library defines this for functions which it implements
559            to always fail with ENOSYS.  Some functions are actually named
560            something starting with __ and the normal name is an alias.  */
561 #if defined (__stub_pthread_cancel) || defined (__stub___pthread_cancel)
562         choke me
563 #else
564         pthread_create(NULL, NULL, NULL, NULL);
565 #endif],
566 ac_cv_func_pthread_create=yes, ac_cv_func_pthread_create=no)])
567 if test "$ac_cv_func_pthread_create" = yes; then
568         test "$DATABASE" && TARGETS="client server utils"
569         if test "x$enable_threaded_client" != xno; then
570                 AC_DEFINE(THREADED_CLIENT)
571         fi
572 fi
573
574 AC_REPLACE_FUNCS(snprintf getutline)
575
576 # AC_CACHE_CHECK([the weather], ac_cv_weather, [
577 #       sleep 1
578 #       echo $ECHO_N "opening your window... $ECHO_C" >&6
579 #       sleep 2
580 #       month=`date | cut -f 2 -d ' '`
581 #       case $month in
582 #       Dec | Jan | Feb)
583 #               ac_cv_weather="it's cold!"
584 #               ;;
585 #       Mar | Apr)
586 #               ac_cv_weather="it's wet!"
587 #               ;;
588 #       Jul | Aug)
589 #               ac_cv_weather="it's hot!"
590 #               ;;
591 #       Oct | Nov)
592 #               ac_cv_weather="it's cool"
593 #               ;;
594 #       May | Jun | Sep | *)
595 #               ac_cv_weather="it's fine"
596 #               ;;
597 #       esac
598 #       ])
599
600 AC_CACHE_CHECK([under the bed], ac_cv_under_the_bed, [
601         number=`date | cut -c 19`
602         case $number in
603         7)
604                 ac_cv_under_the_bed="lunatics and monsters found"
605                 ;;
606         *)
607                 ac_cv_under_the_bed="dust bunnies found"
608                 ;;
609         esac
610         ])
611
612 dnl Done! Now write the Makefile and sysdep.h
613 AC_SUBST(AUTH)
614 AC_SUBST(CHKPWD)
615 AC_SUBST(RESOLV)
616 AC_SUBST(chkpwd_LIBS)
617 AC_SUBST(TARGETS)
618 AC_SUBST(DATABASE)
619 AC_SUBST(SERVER_LDFLAGS)
620 AC_SUBST(SERVER_LIBS)
621 AC_SUBST(SETUP_LIBS)
622 AC_CONFIG_HEADER(sysdep.h)
623 AC_CONFIG_FILES([Makefile])
624 AC_OUTPUT
625
626 if test -z "$DATABASE"; then
627         AC_MSG_WARN([No database driver was found. Please install Berkeley DB.])
628 fi
629
630 echo ...
631 echo ...
632 echo "... On many operating systems, you must use GNU make (gmake) to compile"
633 echo ... Citadel.
634 echo ...
635 echo ...