]> code.citadel.org Git - citadel.git/blob - webcit/configure.in
* Detect when the client browser is capable of gzip encoding
[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 AC_ARG_WITH(with_zlib, [  --with-zlib        use zlib compression if present])
8
9 dnl Set some system-specific variables which are OK to set before compiler
10 dnl checks:
11 PTHREAD_DEFS=-D_REENTRANT
12 case "$host" in
13         dnl Tru64 Unix requires we use -pthread instead of linking the threads
14         dnl libraries directly, and we can't build threaded programs with gcc
15         dnl due to header file problems.
16         alpha*-dec-osf*)
17                 test -z "$CC" && CC=cc
18                 LIBS=-pthread
19         ;;
20         dnl FreeBSD is similar:
21         *-*-freebsd*)
22                 LIBS=-pthread
23                 PTHREAD_DEFS=-D_THREAD_SAFE
24         ;;
25         *-*-solaris*)
26                 PTHREAD_DEFS='-D_REENTRANT -D_PTHREADS'
27         ;;
28 esac
29 AC_SUBST(PTHREAD_DEFS)
30
31 dnl Checks for programs.
32 AC_PROG_CC
33
34 dnl Configure compiler flags for GCC
35 if test "$GCC" = yes; then
36         case "$host" in
37                 *-*-solaris*)
38                         CFLAGS="$CFLAGS -Wall -Wno-char-subscripts"
39                 ;;
40                 *)
41                         CFLAGS="$CFLAGS -Wall"
42                 ;;
43         esac
44 fi
45
46 missing_dir=`cd $ac_aux_dir && pwd`
47 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
48
49 dnl Checks for libraries.
50 if test "$LIBS" != -pthread; then
51         AC_CHECK_LIB(pthread, pthread_create)
52         AC_CHECK_LIB(pthreads, pthread_create)
53 fi
54 AC_SEARCH_LIBS(gethostbyname, nsl)
55 AC_SEARCH_LIBS(connect, socket)
56
57 dnl Checks for header files.
58 AC_HEADER_STDC
59 dnl AC_HEADER_SYS_WAIT
60 AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h)
61
62 dnl Checks for typedefs, structures, and compiler characteristics.
63 AC_C_CONST
64 AC_TYPE_OFF_T
65 AC_TYPE_SIZE_T
66 dnl AC_HEADER_TIME
67
68 dnl Checks for library functions.
69 AC_TYPE_SIGNAL
70 dnl AC_FUNC_VPRINTF
71 dnl AC_CHECK_FUNCS(strerror)
72 AC_REPLACE_FUNCS(snprintf)
73
74 dnl Checks for the zlib compression library.
75 if test "x$with_zlib" != xno ; then
76         AC_CHECK_HEADERS(zlib.h,
77                 [AC_CHECK_LIB(z, zlibVersion,
78                         [ok_zlib=yes],,
79         )])
80 fi
81
82 if test "x$ok_zlib" != xno ; then
83         LIBS="-lz $LIBS"
84         CFLAGS="-DWITH_ZLIB $CFLAGS"
85         AC_DEFINE(HAVE_ZLIB)
86 fi
87
88 AC_OUTPUT(Makefile)
89