]> code.citadel.org Git - citadel.git/blob - citadel/configure.in
* configure.in: don't check for -lcrypt unless autologin is enabled
[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, [  --enable-autologin      enable autologin (default is disabled)],[if test "$enableval" = yes; then
12         AC_DEFINE(ENABLE_AUTOLOGIN)
13 fi])
14
15 AC_ARG_ENABLE(ansi-color, [  --enable-ansi-color     enable ANSI color (default is disabled)],[if test "$enableval" = yes; then
16         AC_DEFINE(ANSI_COLOR)
17 fi])
18
19 TARGETS=client
20
21 AC_CANONICAL_HOST
22 case "$host" in
23         alpha*-dec-osf*)
24                 dnl We can't use gcc on Digital UNIX due to header file probs
25                 if test -z "$CC"; then
26                         CC=cc
27                 fi
28                 SERVER_LDFLAGS=-pthread
29                 TARGETS="client server utils serv_modules"
30         ;;
31 esac
32
33 dnl Checks for programs.
34 AC_PROG_CC
35 if test "$GCC" = yes; then
36         CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
37         SERVER_LDFLAGS=-rdynamic
38 fi
39 AC_PROG_RANLIB
40
41 dnl Checks for libraries.
42 if test "$enable_autologin" = yes; then
43         AC_CHECK_LIB(crypt, crypt)
44 fi
45 AC_CHECK_LIB(dl, dlopen)
46 AC_CHECK_LIB(gdbm, gdbm_open)
47 AC_CHECK_LIB(curses, initscr, CURSES=-lcurses)
48 if test "$SERVER_LDFLAGS" != -pthread; then
49         AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"
50                 TARGETS="client server utils serv_modules"])
51         AC_CHECK_LIB(pthreads, pthread_create, [LIBS="$LIBS -lpthreads"
52                 TARGETS="client server utils serv_modules"])
53 fi
54
55 dnl Checks for header files.
56 AC_HEADER_DIRENT
57 AC_HEADER_STDC
58 AC_HEADER_SYS_WAIT
59 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)
60
61 dnl Checks for typedefs, structures, and compiler characteristics.
62 AC_C_CONST
63 AC_TYPE_PID_T
64 AC_TYPE_SIZE_T
65 AC_HEADER_TIME
66 AC_STRUCT_TM
67
68 dnl Checks for library functions.
69 AC_FUNC_GETPGRP
70 AC_PROG_GCC_TRADITIONAL
71 AC_TYPE_SIGNAL
72 AC_FUNC_VPRINTF
73 AC_CHECK_FUNCS(snprintf mkdir mktime rmdir select socket strerror)
74
75 if test "$ac_cv_func_snprintf" = no; then
76         SNPRINTF=snprintf.o
77 fi
78
79 AC_SUBST(CURSES)
80 AC_SUBST(TARGETS)
81 AC_SUBST(SERVER_LDFLAGS)
82 AC_SUBST(SNPRINTF)
83 AC_CONFIG_HEADER(sysdep.h)
84 AC_OUTPUT(Makefile)