]> code.citadel.org Git - citadel.git/blob - citadel/configure.in
* snprintf.c, snprintf.h: new files
[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 AC_CHECK_LIB(crypt, crypt)
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
73 if test "$ac_cv_func_snprintf" = no; then
74         SNPRINTF=snprintf.o
75 fi
76
77 AC_SUBST(CURSES)
78 AC_SUBST(TARGETS)
79 AC_SUBST(SERVER_LDFLAGS)
80 AC_SUBST(SNPRINTF)
81 AC_CONFIG_HEADER(sysdep.h)
82 AC_OUTPUT(Makefile)