HUGE PATCH. This moves all of mime_parser.c and all
[citadel.git] / citadel / configure.ac
index f0e0c74982f80a0f90300a4139b0efb6b657a7ce..74e707208efad53ded8cc3b96064d192e6dcd1de 100644 (file)
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
 AC_PREREQ(2.52)
-AC_INIT([Citadel], [7.11], [http://www.citadel.org/])
+AC_INIT([Citadel], [7.24], [http://www.citadel.org/])
 AC_REVISION([$Revision: 5108 $])
 AC_CONFIG_SRCDIR([citserver.c])
 AC_PREFIX_DEFAULT(/usr/local/citadel)
@@ -153,6 +153,7 @@ AC_ARG_WITH(with_zlib, [  --with-zlib             use zlib compression if presen
 AC_ARG_WITH(with_ldap, [  --with-ldap             use OpenLDAP client library])
 AC_ARG_WITH(with_libical, [  --with-libical          use libical calendaring library])
 AC_ARG_WITH(with_libsieve, [  --with-libsieve         use libsieve mail sorting library])
+AC_ARG_WITH(with_expat, [  --with-expat            use Expat XML parser])
 
 if test "x$with_db" != xno -a "x$with_db" != xyes -a "$with_db"; then
        db_dir="$with_db"
@@ -165,6 +166,8 @@ else
        test -d /usr/local/BerkeleyDB.4.1 && db_dir=/usr/local/BerkeleyDB.4.1
        test -d /usr/local/BerkeleyDB.4.2 && db_dir=/usr/local/BerkeleyDB.4.2
        test -d /usr/local/BerkeleyDB.4.3 && db_dir=/usr/local/BerkeleyDB.4.3
+       test -d /usr/local/BerkeleyDB.4.4 && db_dir=/usr/local/BerkeleyDB.4.4
+       test -d /usr/local/BerkeleyDB.4.5 && db_dir=/usr/local/BerkeleyDB.4.5
 fi
 
 dnl By default, we only build the client (citadel and whobbs) unless we can
@@ -242,6 +245,8 @@ dnl DEFS="$DEFS $PTHREAD_DEFS"
 dnl Checks for programs.
 AC_PROG_CC
 
+
+
 dnl Set up system-dependent compiler flags.
 if test "$GCC" = yes; then
        if test "$CC" = icc; then
@@ -272,6 +277,15 @@ if test "x$enable_pie" = xyes; then
        fi
 fi
 
+AC_MSG_CHECKING([how to create dependancy checks])
+                if test -n "`$CC -V 2>&1 |grep Sun`"; then 
+                       DEPEND_FLAG=-xM;
+                else 
+                       DEPEND_FLAG=-M
+                fi
+AC_SUBST(DEPEND_FLAG)
+
+
 AC_PROG_INSTALL
 AC_PROG_YACC
 missing_dir=`cd $ac_aux_dir && pwd`
@@ -285,6 +299,7 @@ AC_CHECK_SIZEOF(char, 0)
 AC_CHECK_SIZEOF(short, 0)
 AC_CHECK_SIZEOF(int, 0)
 AC_CHECK_SIZEOF(long, 0)
+AC_CHECK_SIZEOF(size_t, 0)
 dnl AC_CHECK_SIZEOF(long long, 0)
 
 dnl Checks for libraries.
@@ -292,7 +307,32 @@ dnl Checks for libraries.
 dnl We want to test for the following in libc before checking for their
 dnl respective libraries, because some systems (like Irix) have both, and the
 dnl non-libc versions may be broken.
-AC_CHECK_FUNCS(crypt gethostbyname connect)
+AC_CHECK_FUNCS(crypt gethostbyname connect flock)
+
+
+dnl disable backtrace if we don't want it.
+AC_ARG_WITH(backtrace, 
+                   [  --with-backtrace          enable backtrace dumps in the syslog],
+                       [ if test "x$withval" != "xno" ; then
+                            CFLAGS="$CFLAGS  -rdynamic "
+                            LDFLAGS="$LDFLAGS  -rdynamic "
+                            SERVER_LDFLAGS="$SERVER_LDFLAGS  -rdynamic "
+                             AC_CHECK_FUNCS(backtrace)
+                         fi
+                       ]
+)
+
+dnl disable backtrace if we don't want it.
+AC_ARG_WITH(gprof, 
+                   [  --with-gprof          enable profiling],
+                       [ if test "x$withval" != "xno" ; then
+                            CFLAGS="$CFLAGS  -pg "
+                            LDFLAGS="$LDFLAGS  -pg "
+                            SERVER_LDFLAGS="$SERVER_LDFLAGS  -pg "
+                         fi
+                       ]
+)
+
 
 if test "$ac_cv_func_gethostbyname" = no; then
        AC_CHECK_LIB(nsl, gethostbyname)
@@ -353,6 +393,26 @@ fi
 
 test -d /usr/kerberos/include && CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
 
+
+dnl Check for libcitadel
+AC_CHECK_HEADER(libcitadel.h,
+       [AC_CHECK_LIB(citadel, libcitadel_version_string,
+               [
+                       AC_MSG_RESULT(OK)
+                       LIBS="-lcitadel $LIBS"
+               ],
+               [
+                       AC_MSG_ERROR(libcitadel was not found or is not usable.  Please install libcitadel.)
+               ]
+       ,
+       )],
+       [
+               AC_MSG_ERROR(libcitadel.h was not found or is not usable.  Please install libcitadel.)
+       ]
+)
+
+
+
 # The big search for OpenSSL
 if test "$with_ssl" != "no"; then
        saved_LIBS="$LIBS"
@@ -538,6 +598,22 @@ fi
 
 
 
+dnl Checks for the Expat XML parser.
+if test "x$with_expat" != xno ; then
+       AC_CHECK_HEADERS(expat.h,
+               [AC_CHECK_LIB(expat, XML_ParserCreateNS,
+                       [ok_expat=yes],,
+       )])
+fi
+
+if test "x$ok_expat" = xyes ; then
+       SERVER_LIBS="-lexpat $SERVER_LIBS"
+       AC_DEFINE(HAVE_EXPAT, [], [define this if you have the Expat XML parser available])
+fi
+
+
+
+
 dnl Checks for the libical calendaring library.
 if test "x$with_libical" != xno ; then
        AC_CHECK_HEADERS(ical.h,
@@ -756,6 +832,7 @@ AC_CACHE_CHECK([the weather], ac_cv_weather, [
 
 
 
+
 AC_CACHE_CHECK([under the bed], ac_cv_under_the_bed, [
        number=`date | cut -c 19`
        case $number in
@@ -790,6 +867,7 @@ echo 'zlib compression:                ' $ok_zlib
 echo 'Calendar support:                ' $ok_libical
 echo 'LDAP support:                    ' $ok_ldap
 echo 'Sieve mailbox filtering support: ' $ok_libsieve
+echo 'Expat XML parser present:        ' $ok_expat
 echo 
 echo 'Note: if you are not using Linux, make sure you are using GNU make'
 echo '(gmake) to compile Citadel.'