* solaris cleanups and warning fixes
[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         *-*-solaris*)
24                 PTHREAD_DEFS=-D_REENTRANT -D_PTHREADS
25         ;;
26 esac
27 AC_SUBST(PTHREAD_DEFS)
28
29 dnl Checks for programs.
30 AC_PROG_CC
31
32 dnl Configure compiler flags for GCC
33 if test "$GCC" = yes; then
34         case "$host" in
35                 *-*-solaris*)
36                         CFLAGS="$CFLAGS -Wall -Wno-char-subscripts"
37                 ;;
38                 *)
39                         CFLAGS="$CFLAGS -Wall"
40                 ;;
41         esac
42 fi
43
44 missing_dir=`cd $ac_aux_dir && pwd`
45 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
46
47 dnl Checks for libraries.
48 if test "$LIBS" != -pthread; then
49         AC_CHECK_LIB(pthread, pthread_create)
50         AC_CHECK_LIB(pthreads, pthread_create)
51 fi
52 AC_SEARCH_LIBS(gethostbyname, nsl)
53 AC_SEARCH_LIBS(connect, socket)
54
55 dnl Checks for header files.
56 AC_HEADER_STDC
57 dnl AC_HEADER_SYS_WAIT
58 AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h)
59
60 dnl Checks for typedefs, structures, and compiler characteristics.
61 AC_C_CONST
62 AC_TYPE_OFF_T
63 AC_TYPE_SIZE_T
64 dnl AC_HEADER_TIME
65
66 dnl Checks for library functions.
67 AC_TYPE_SIGNAL
68 dnl AC_FUNC_VPRINTF
69 dnl AC_CHECK_FUNCS(strerror)
70 AC_REPLACE_FUNCS(snprintf)
71
72 AC_OUTPUT(Makefile)