1 dnl Process this file with autoconf to produce a configure script.
7 AC_ARG_WITH(with_zlib, [ --with-zlib use zlib compression if present])
8 AC_ARG_WITH(with_libical, [ --with-libical use libical calendaring library])
10 dnl Set some system-specific variables which are OK to set before compiler
12 PTHREAD_DEFS=-D_REENTRANT
14 dnl Tru64 Unix requires we use -pthread instead of linking the threads
15 dnl libraries directly, and we can't build threaded programs with gcc
16 dnl due to header file problems.
18 test -z "$CC" && CC=cc
21 dnl FreeBSD is similar:
24 PTHREAD_DEFS=-D_THREAD_SAFE
27 PTHREAD_DEFS='-D_REENTRANT -D_PTHREADS'
30 AC_SUBST(PTHREAD_DEFS)
32 dnl Checks for programs.
35 dnl Configure compiler flags for GCC
36 if test "$GCC" = yes; then
39 CFLAGS="$CFLAGS -Wall -Wno-char-subscripts"
42 CFLAGS="$CFLAGS -Wall"
47 missing_dir=`cd $ac_aux_dir && pwd`
48 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
50 dnl Checks for libraries.
51 if test "$LIBS" != -pthread; then
52 AC_CHECK_LIB(pthread, pthread_create)
53 AC_CHECK_LIB(pthreads, pthread_create)
55 AC_SEARCH_LIBS(gethostbyname, nsl)
56 AC_SEARCH_LIBS(connect, socket)
58 dnl Checks for header files.
60 dnl AC_HEADER_SYS_WAIT
61 AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h)
63 dnl Checks for typedefs, structures, and compiler characteristics.
69 dnl Checks for library functions.
72 dnl AC_CHECK_FUNCS(strerror)
73 AC_REPLACE_FUNCS(snprintf)
75 dnl Checks for the zlib compression library.
76 if test "x$with_zlib" != xno ; then
77 AC_CHECK_HEADERS(zlib.h,
78 [AC_CHECK_LIB(z, zlibVersion,
83 if test "x$ok_zlib" != xno ; then
88 dnl Checks for the libical calendaring library.
89 if test "x$with_libical" != xno ; then
90 AC_CHECK_HEADERS(ical.h,
91 [AC_CHECK_LIB(ical, icalcomponent_new,
96 if test "x$ok_libical" != xno ; then
98 AC_DEFINE(HAVE_LIBICAL)