1 dnl Process this file with autoconf to produce a configure script.
7 AC_ARG_WITH(with_libical, [ --with-libical use libical calendaring library])
9 dnl Set some system-specific variables which are OK to set before compiler
11 PTHREAD_DEFS=-D_REENTRANT
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.
17 test -z "$CC" && CC=cc
20 dnl FreeBSD is similar:
23 PTHREAD_DEFS=-D_THREAD_SAFE
26 PTHREAD_DEFS='-D_REENTRANT -D_PTHREADS'
29 AC_SUBST(PTHREAD_DEFS)
31 dnl Checks for programs.
34 dnl Configure compiler flags for GCC
35 if test "$GCC" = yes; then
38 CFLAGS="$CFLAGS -Wall -Wno-char-subscripts"
41 CFLAGS="$CFLAGS -Wall"
46 missing_dir=`cd $ac_aux_dir && pwd`
47 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
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)
54 AC_SEARCH_LIBS(gethostbyname, nsl)
55 AC_SEARCH_LIBS(connect, socket)
57 dnl Checks for header files.
59 dnl AC_HEADER_SYS_WAIT
60 AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h)
62 dnl Checks for typedefs, structures, and compiler characteristics.
68 dnl Checks for library functions.
71 dnl AC_CHECK_FUNCS(strerror)
72 AC_REPLACE_FUNCS(snprintf)
74 dnl Checks for the libical calendaring library.
75 if test "x$with_libical" != xno ; then
76 AC_CHECK_HEADERS(ical.h,
77 [AC_CHECK_LIB(ical, icalcomponent_new,
82 if test "x$ok_libical" != xno ; then
84 AC_DEFINE(HAVE_LIBICAL)