* Removed the gzip compression stuff due to bugs in Internet Explorer.
[citadel.git] / webcit / configure.in
index d0ce46ca47206ad41d866e2c236a75891addf8cd..578a9081cca8601b20c7f820ecff0301aa3ca30e 100644 (file)
@@ -4,8 +4,11 @@ AC_INIT(webserver.c)
 
 AC_CANONICAL_HOST
 
+AC_ARG_WITH(with_libical, [  --with-libical          use libical calendaring library])
+
 dnl Set some system-specific variables which are OK to set before compiler
 dnl checks:
+PTHREAD_DEFS=-D_REENTRANT
 case "$host" in
        dnl Tru64 Unix requires we use -pthread instead of linking the threads
        dnl libraries directly, and we can't build threaded programs with gcc
@@ -17,12 +20,29 @@ case "$host" in
        dnl FreeBSD is similar:
        *-*-freebsd*)
                LIBS=-pthread
+               PTHREAD_DEFS=-D_THREAD_SAFE
+       ;;
+       *-*-solaris*)
+               PTHREAD_DEFS='-D_REENTRANT -D_PTHREADS'
        ;;
 esac
+AC_SUBST(PTHREAD_DEFS)
 
 dnl Checks for programs.
 AC_PROG_CC
-test "$GCC" = yes && CFLAGS="$CFLAGS -Wall"
+
+dnl Configure compiler flags for GCC
+if test "$GCC" = yes; then
+       case "$host" in
+               *-*-solaris*)
+                       CFLAGS="$CFLAGS -Wall -Wno-char-subscripts"
+               ;;
+               *)
+                       CFLAGS="$CFLAGS -Wall"
+               ;;
+       esac
+fi
+
 missing_dir=`cd $ac_aux_dir && pwd`
 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
 
@@ -31,6 +51,8 @@ if test "$LIBS" != -pthread; then
        AC_CHECK_LIB(pthread, pthread_create)
        AC_CHECK_LIB(pthreads, pthread_create)
 fi
+AC_SEARCH_LIBS(gethostbyname, nsl)
+AC_SEARCH_LIBS(connect, socket)
 
 dnl Checks for header files.
 AC_HEADER_STDC
@@ -49,4 +71,18 @@ dnl AC_FUNC_VPRINTF
 dnl AC_CHECK_FUNCS(strerror)
 AC_REPLACE_FUNCS(snprintf)
 
+dnl Checks for the libical calendaring library.
+if test "x$with_libical" != xno ; then
+        AC_CHECK_HEADERS(ical.h,
+                [AC_CHECK_LIB(ical, icalcomponent_new,
+                        [ok_libical=yes],,
+        )])
+fi
+
+if test "x$ok_libical" != xno ; then
+        LIBS="-lical $LIBS"
+        AC_DEFINE(HAVE_LIBICAL)
+fi
+
 AC_OUTPUT(Makefile)
+