* Makefile.in, configure.in: add, like, some *more* code for FreeBSD
[citadel.git] / webcit / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl $Id$
3 AC_INIT(webserver.c)
4
5 AC_CANONICAL_HOST
6
7 dnl Set some system-specific variables which are OK to set before compiler
8 dnl checks:
9 PTHREAD_DEFS=-D_REENTRANT
10 case "$host" in
11         dnl Tru64 Unix requires we use -pthread instead of linking the threads
12         dnl libraries directly, and we can't build threaded programs with gcc
13         dnl due to header file problems.
14         alpha*-dec-osf*)
15                 test -z "$CC" && CC=cc
16                 LIBS=-pthread
17         ;;
18         dnl FreeBSD is similar:
19         *-*-freebsd*)
20                 LIBS=-pthread
21                 PTHREAD_DEFS=-D_THREAD_SAFE
22         ;;
23 esac
24 AC_SUBST(PTHREAD_DEFS)
25
26 dnl Checks for programs.
27 AC_PROG_CC
28 test "$GCC" = yes && CFLAGS="$CFLAGS -Wall"
29 missing_dir=`cd $ac_aux_dir && pwd`
30 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
31
32 dnl Checks for libraries.
33 if test "$LIBS" != -pthread; then
34         AC_CHECK_LIB(pthread, pthread_create)
35         AC_CHECK_LIB(pthreads, pthread_create)
36 fi
37
38 dnl Checks for header files.
39 AC_HEADER_STDC
40 dnl AC_HEADER_SYS_WAIT
41 AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h)
42
43 dnl Checks for typedefs, structures, and compiler characteristics.
44 AC_C_CONST
45 AC_TYPE_OFF_T
46 AC_TYPE_SIZE_T
47 dnl AC_HEADER_TIME
48
49 dnl Checks for library functions.
50 AC_TYPE_SIGNAL
51 dnl AC_FUNC_VPRINTF
52 dnl AC_CHECK_FUNCS(strerror)
53 AC_REPLACE_FUNCS(snprintf)
54
55 AC_OUTPUT(Makefile)