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