]> code.citadel.org Git - citadel.git/blob - citadel/configure.in
* configure.in: autologin defaults to enabled if crypt() is available
[citadel.git] / citadel / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.12)
3 AC_INIT(citserver.c)
4 AC_PREFIX_DEFAULT(/usr/local/citadel)
5 if test "$prefix" = NONE; then
6         AC_DEFINE_UNQUOTED(BBSDIR, "$ac_default_prefix")
7 else
8         AC_DEFINE_UNQUOTED(BBSDIR, "$prefix")
9 fi
10
11 AC_ARG_ENABLE(autologin, [  --disable-autologin     disable autologin (default is enabled if possible)])
12
13 AC_ARG_ENABLE(ansi-color, [  --enable-ansi-color     enable ANSI color (default is disabled)],[if test "$enableval" = yes; then
14         AC_DEFINE(ANSI_COLOR)
15 fi])
16
17 TARGETS=client
18
19 AC_CANONICAL_HOST
20 case "$host" in
21         alpha*-dec-osf*)
22                 dnl We can't use gcc on Digital UNIX due to header file probs
23                 if test -z "$CC"; then
24                         CC=cc
25                 fi
26                 SERVER_LDFLAGS=-pthread
27                 TARGETS="client server utils serv_modules"
28         ;;
29 esac
30
31 dnl Checks for programs.
32 AC_PROG_CC
33 if test "$GCC" = yes; then
34         CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
35         SERVER_LDFLAGS=-rdynamic
36 fi
37 AC_PROG_RANLIB
38
39 dnl Checks for libraries.
40 if test "$enable_autologin" != no; then
41         AC_CHECK_LIB(crypt, crypt)
42 fi
43 AC_CHECK_LIB(dl, dlopen)
44 AC_CHECK_LIB(gdbm, gdbm_open)
45 AC_CHECK_LIB(curses, initscr, CURSES=-lcurses)
46 if test "$SERVER_LDFLAGS" != -pthread; then
47         AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"
48                 TARGETS="client server utils serv_modules"])
49         AC_CHECK_LIB(pthreads, pthread_create, [LIBS="$LIBS -lpthreads"
50                 TARGETS="client server utils serv_modules"])
51 fi
52
53 dnl Checks for header files.
54 AC_HEADER_DIRENT
55 AC_HEADER_STDC
56 AC_HEADER_SYS_WAIT
57 AC_CHECK_HEADERS(curses.h fcntl.h limits.h termios.h strings.h sys/ioctl.h sys/select.h sys/time.h syslog.h unistd.h)
58
59 dnl Checks for typedefs, structures, and compiler characteristics.
60 AC_C_CONST
61 AC_TYPE_PID_T
62 AC_TYPE_SIZE_T
63 AC_HEADER_TIME
64 AC_STRUCT_TM
65
66 dnl Checks for library functions.
67 AC_FUNC_GETPGRP
68 AC_PROG_GCC_TRADITIONAL
69 AC_TYPE_SIGNAL
70 AC_FUNC_VPRINTF
71 AC_CHECK_FUNCS(snprintf mkdir mktime rmdir select socket strerror)
72 if test "$enable_autologin" != no; then
73         AC_CHECK_FUNC(crypt, AC_DEFINE(ENABLE_AUTOLOGIN))
74 fi
75
76 if test "$ac_cv_func_snprintf" = no; then
77         SNPRINTF=snprintf.o
78 fi
79
80 AC_SUBST(CURSES)
81 AC_SUBST(TARGETS)
82 AC_SUBST(SERVER_LDFLAGS)
83 AC_SUBST(SNPRINTF)
84 AC_CONFIG_HEADER(sysdep.h)
85 AC_OUTPUT(Makefile)