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