[ --with-notify=IOLOOP Specify the file system notification method to use
default dnotify if compilable, otherwise none)],
[ --with-passwd Build with
/etc/passwd support (default)],
if test x$withval = xno; then
[ --with-passwd-file Build with passwd-like file support (default)],
if test x$withval = xno; then
[ --with-shadow Build with shadow password support (default)],
if test x$withval = xno; then
[ --with-pam Build with PAM support (default)],
if test x$withval = xno; then
AC_ARG_WITH(checkpassword,
[ --with-checkpassword Build with checkpassword support (default)],
if test x$withval = xno; then
[ --with-bsdauth Build with BSD authentication support (default)],
if test x$withval = xno; then
[ --with-ldap Build with LDAP support],
if test x$withval = xno; then
[ --with-vpopmail Build with vpopmail support (default)],
if test x$withval = xno; then
AC_ARG_WITH(static-userdb,
[ --with-static-userdb Build with static userdb support (default)],
if test x$withval = xno; then
AC_ARG_WITH(passdb-userdb,
[ --with-passdb-userdb Build with passdb userdb support (default)],
if test x$withval = xno; then
[ --with-pgsql Build with PostgreSQL support],
if test x$withval = xno; then
[ --with-mysql Build with MySQL support],
if test x$withval = xno; then
[ --with-ssl=[gnutls|openssl] Build with GNUTLS (default) or OpenSSL],
if test x$withval = xno; then
elif test x$withval = xgnutls; then
elif test x$withval = xopenssl; then
[ --with-ssldir=DIR SSL base directory for certificates (
/etc/ssl)],
[ --with-gc Use Boehm garbage collector (currently broken)],
if test x$withval = xyes; then
if test "x$withval" = xno; then
[ --with-pop3d Build POP3 server (default)],
if test x$withval = xno; then
AM_CONDITIONAL(BUILD_POP3D, test "$want_pop3d" = "yes")
[ --with-deliver Build mail delivery agent (default)],
if test x$withval = xno; then
AM_CONDITIONAL(BUILD_DELIVER, test "$want_deliver" = "yes")
[ --with-storages Build specified mail storage formats (maildir,mbox)], [
mail_storages=`echo "$withval"|sed 's/,/ /g'` ],
mail_storages="maildir mbox")
[ --with-moduledir=DIR Base directory for dynamically loadable modules],
dnl * gcc specific options
if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
# -Wcast-qual -Wcast-align -Wconversion # too many warnings
# -Wstrict-prototypes -Wredundant-decls # may give warnings in some systems
# -Wmissing-format-attribute -Wmissing-noreturn -Wwrite-strings # a couple of warnings
CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast"
# Use std=gnu99 if we have new enough gcc
CFLAGS="$CFLAGS $old_cflags"
dnl ** just some generic stuff...
AC_CHECK_FUNC(socket, [], [
AC_CHECK_LIB(socket, socket, [
AC_CHECK_FUNC(inet_addr, [], [
AC_CHECK_LIB(nsl, inet_addr, [
AC_CHECK_FUNC(fdatasync, [
AC_CHECK_LIB(rt, fdatasync, [
if test "$have_fdatasync" = "yes"; then
AC_DEFINE(HAVE_FDATASYNC,, Define if you have fdatasync())
dnl * after -lsocket and -lnsl tests, inet_aton() may be in them
AC_CHECK_FUNCS(fcntl flock lockf inet_aton sigaction getpagesize madvise \
strcasecmp stricmp vsnprintf vsyslog writev pread \
setrlimit setproctitle seteuid setreuid setegid setresgid \
strtoull strtouq setpriority)
dnl we currently don't use epoll automatically because it fails at runtime
dnl if we're not running 2.6 kernel
if test "$ioloop" = "epoll"; then
AC_CHECK_FUNC(epoll_create, [
AC_DEFINE(IOLOOP_EPOLL,, Implement I/O loop with Linux 2.6 epoll())
if test "$ioloop" = "" || test "$ioloop" = "poll"; then
AC_DEFINE(IOLOOP_POLL,, Implement I/O loop with poll())
if test "$have_ioloop" = "no"; then
AC_DEFINE(IOLOOP_SELECT,, Implement I/O loop with select())
if test "$notify" = "none"; then
AC_DEFINE(IOLOOP_NOTIFY_NONE,, No special notify support)
if test "$notify" = "" || test "$notify" = "dnotify"; then
fcntl(0, F_SETSIG, SIGRTMIN);
fcntl(0, F_NOTIFY, DN_CREATE | DN_DELETE | DN_RENAME | DN_MULTISHOT);
AC_DEFINE(IOLOOP_NOTIFY_DNOTIFY,, Use Linux dnotify)
if test "$notify" = "dnotify"; then
AC_MSG_ERROR([dnotify requested but not available])
AC_DEFINE(IOLOOP_NOTIFY_NONE,, No special notify support)
if test "$notify" = "inotify"; then
wd = inotify_add_watch (fd, fn, IN_ALL_EVENTS);
perror ("inotify_add_watch");
inotify_rm_watch (fd, wd);
AC_DEFINE(IOLOOP_NOTIFY_INOTIFY,, Use Linux inotify)
AC_DEFINE(PREAD_WRAPPERS,, Define if
pread/pwrite needs _XOPEN_SOURCE 500)
dnl * OS specific options
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
AC_CHECK_SIZEOF(long long)
dnl * first check if we can get the size with redefining typedefs
order="int long long-long"
AC_MSG_CHECKING([type of $1])
if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
dnl * try with printf() + -Werror
if test "$fmt" != ""; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
if test "$result" != ""; then
dnl * warning check isn't working
result="`echo $type|sed 's/-/ /g'`"
if test "$result" = ""; then
type="`echo $type|sed 's/-/ /g'`"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
if test "$result" != ""; then
dnl * compiler allows redefining to anything
if test "$result" = ""; then
dnl * older autoconfs don't include
sys/types.h, so do it manually
AC_RUN_IFELSE([AC_LANG_SOURCE([[
FILE *f=fopen("conftestval", "w");
fprintf(f, "%d\n", sizeof($1));
actype="ac_cv_sizeof_`echo $type|sed 's/-/_/g'`"
if test "$size" = "`eval \"echo \\$$actype\"`"; then
result="`echo $type|sed 's/-/ /g'`"
visible="`expr $size \* 8`bit (using $result)"
if test "$result" = ""; then
visible="`expr $size \* 8`bit (unknown type)"
dnl * off_t checks, try to make it 64bit
AC_DEFINE_UNQUOTED(_FILE_OFFSET_BITS, $preferred_off_t_bits,
[If set to 64, enables 64bit off_t for some systems (eg. Linux, Solaris)])
AC_TYPEOF(off_t, long int long-long)
AC_DEFINE(UOFF_T_INT,, Define if off_t is int)
offt_bits=`expr 8 \* $ac_cv_sizeof_int`
AC_DEFINE(UOFF_T_LONG,, Define if off_t is long)
offt_bits=`expr 8 \* $ac_cv_sizeof_long`
AC_DEFINE(UOFF_T_LONG_LONG,, Define if off_t is long long)
offt_bits=`expr 8 \* $ac_cv_sizeof_long_long`
AC_MSG_ERROR([Unsupported off_t type])
dnl * Do we have struct dirent->d_type
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
AC_DEFINE(HAVE_DIRENT_D_TYPE,, Define if you have struct dirent->d_type)
dnl * Do we have OFF_T_MAX?
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
AC_DEFINE_UNQUOTED(OFF_T_MAX, $offt_max, Maximum value of off_t)
AC_DEFINE_UNQUOTED(PRIuUOFF_T, "$uofft_fmt", printf() format for uoff_t)
dnl * make sure size_t isn't signed. we'd probably work fine with it, but
dnl * it's more likely vulnerable to buffer overflows. Anyway, C99 specifies
dnl * that it's unsigned and only some old systems define it as signed.
AC_MSG_CHECKING([whether size_t is signed])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
/* return 0 if we're signed */
exit((size_t)(int)-1 <= 0 ? 0 : 1);
echo "Your system's size_t is a signed integer, Dovecot isn't designed to"
echo "support it. It probably works just fine, but it's less resistant to"
echo "buffer overflows. If you're not worried about this and still want to"
echo "compile Dovecot, set ignore_signed_size=1 environment."
if test "$ignore_signed_size" = ""; then
dnl Note: we check size_t rather than ssize_t here, because on OSX 10.2
dnl ssize_t = int and size_t = unsigned long. We're mostly concerned about
dnl printf format here, so check the size_t one.
AC_TYPEOF(size_t, unsigned-int unsigned-long unsigned-long-long)
dnl older systems didn't have ssize_t, default to int
if test "$typeof_size_t" = ""; then
AC_DEFINE(size_t, unsigned int, Define to 'unsigned int' if you don't have it)
AC_DEFINE(ssize_t, int, Define to 'int' if you don't have it)
AC_DEFINE_UNQUOTED(SSIZE_T_MAX, $ssizet_max, Maximum value of ssize_t)
AC_DEFINE_UNQUOTED(PRIuSIZE_T, "$sizet_fmt", printf() format for size_t)
AC_DEFUN([AC_CHECKTYPE2], [
AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(i_cv_type_$1,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
$2]], [[$1 t;]])],[i_cv_type_$1=yes],[i_cv_type_$1=no])])
AC_MSG_RESULT($i_cv_type_$1)
dnl some systems don't have
stdint.h, but still have some of the types
AC_CHECKTYPE2(uintmax_t, [$stdint_include])
if test $i_cv_type_uintmax_t = yes; then
AC_DEFINE(HAVE_UINTMAX_T,, Define if you have uintmax_t (C99 type))
dnl use separate check, eg. Solaris 8 has uintmax_t but not uint_fast32_t
AC_CHECKTYPE2(uint_fast32_t, [$stdint_include])
if test $i_cv_type_uint_fast32_t = yes; then
AC_DEFINE(HAVE_UINT_FAST32_T,, Define if you have uint_fast32_t (C99 type))
if test $i_cv_type_socklen_t = yes; then
AC_DEFINE(HAVE_SOCKLEN_T,, Define to 'int' if you don't have socklen_t)
AC_DEFINE_UNQUOTED(MEM_ALIGN_SIZE, $mem_align, Required memory alignment)
AC_DEFINE(HAVE_DEV_URANDOM,, Define if you have
/dev/urandom)
dnl * do we have tm_gmtoff
AC_MSG_CHECKING([for tm_gmtoff])
AC_CACHE_VAL(i_cv_field_tm_gmtoff,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
[[struct tm *tm; return tm->tm_gmtoff;]])],
[i_cv_field_tm_gmtoff=yes],
[i_cv_field_tm_gmtoff=no])])
if test $i_cv_field_tm_gmtoff = yes; then
AC_DEFINE(HAVE_TM_GMTOFF,, Define if you have struct tm->tm_gmtoff)
AC_MSG_RESULT($i_cv_field_tm_gmtoff)
dnl * how large time_t values does gmtime() accept?
AC_MSG_CHECKING([how large time_t values gmtime() accepts])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
for (bits = 1, t = 1; t > 0; ++bits, t <<= 1) {
if (gmtime(&t) == NULL) {
/* Solaris 9 breaks after 55 bits. Perhaps other systems break earlier.
Let's just do the same as Cyrus folks and limit it to 40 bits. */
AC_MSG_RESULT([check failed, assuming 31])
AC_DEFINE_UNQUOTED(TIME_T_MAX_BITS, $max_bits, max. time_t bits gmtime() can handle)
dnl * do we have struct iovec
AC_MSG_CHECKING([for struct iovec])
AC_CACHE_VAL(i_cv_struct_iovec,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
[[struct iovec *iovec;]])],
[i_cv_struct_iovec=no])])
if test $i_cv_struct_iovec = yes; then
AC_DEFINE(HAVE_STRUCT_IOVEC,, Define if you have struct iovec)
AC_MSG_RESULT($i_cv_struct_iovec)
dnl * is dev_t an integer or something else?
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
struct test { dev_t a; };
static struct test t = { 0 };
AC_DEFINE(DEV_T_STRUCT,, Define if your dev_t is a structure instead of integer type)
dnl we can't initialize structures, so don't warn about them either
if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
CFLAGS=`echo $CFLAGS|sed 's/ -W\b//'`
dnl * Do we have RLIMIT_AS?
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
getrlimit(RLIMIT_AS, &r);
AC_DEFINE(HAVE_RLIMIT_AS,, Define if you have RLIMIT_AS for setrlimit())
dnl * Do we have RLIMIT_NPROC?
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
getrlimit(RLIMIT_NPROC, &r);
AC_DEFINE(HAVE_RLIMIT_NPROC,, Define if you have RLIMIT_NPROC for setrlimit())
dnl * Linux compatible mremap()
AC_MSG_CHECKING([Linux compatible mremap()])
mremap(0, 0, 0, MREMAP_MAYMOVE);
AC_DEFINE(HAVE_LINUX_MREMAP,, Define if you have Linux-compatible mremap())
dnl * If mmap() plays nicely with write()
AC_MSG_CHECKING([whether shared mmaps get updated by write()s])
/* return 0 if we're signed */
mem = mmap(NULL, 2, PROT_READ|PROT_WRITE, MAP_SHARED, f, 0);
return strcmp(mem, "3") == 0 ? 0 : 1;
AC_DEFINE(MMAP_CONFLICTS_WRITE,, [Define if shared mmaps don't get updated by write()s])
dnl * see if fd passing works
AC_MSG_CHECKING([whether fd passing works])
CFLAGS="$CFLAGS -DBUGGY_CMSG_MACROS"
int fd[2], send_fd, recv_fd, status;
if (send_fd == -1) return 2;
if (fstat(send_fd, &st) < 0) return 2;
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fd) < 0) return 2;
if (fd_send(fd[0], send_fd, &data, 1) != 1) return 2;
if (fd_read(fd[1], &data, 1, &recv_fd) != 1) return 1;
if (fstat(recv_fd, &st2) < 0) return 2;
AC_DEFINE(BUGGY_CMSG_MACROS,, Define if you have buggy CMSG macros)
dnl no, try with BUGGY_CMSG_MACROS
dnl * Solaris compatible sendfile()
AC_CHECK_LIB(sendfile, sendfile, [
AC_DEFINE(HAVE_SOLARIS_SENDFILE,, Define if you have Solaris-compatible sendfile())
dnl * Linux compatible sendfile() - don't check if Solaris one was found.
dnl * This seems to pass with Solaris for some reason..
AC_MSG_CHECKING([Linux compatible sendfile()])
sendfile(0, 0, (void *) 0, 0);
AC_DEFINE(HAVE_LINUX_SENDFILE,, Define if you have Linux-compatible sendfile())
dnl * FreeBSD compatible sendfile()
AC_MSG_CHECKING([FreeBSD compatible sendfile()])
sendfile(0, 0, 0, 0, &hdtr, (void *) 0, 0);
AC_DEFINE(HAVE_FREEBSD_SENDFILE,, Define if you have FreeBSD-compatible sendfile())
dnl * Check for crypt() if
unistd.h compiles with _XOPEN_SOURCE + _XPG6
dnl * Add other macros there too "just in case".
AC_MSG_CHECKING([if we should use _XPG6 macro for crypt()])
#define _XOPEN_SOURCE_EXTENDED 1
AC_DEFINE(CRYPT_USE_XPG6,, Define if _XPG6 macro is needed for crypt())
dnl *** va_copy checks (from GLIB)
AC_CACHE_CHECK([for an implementation of va_copy()],lib_cv_va_copy,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
va_end (args1); va_end (args2);
AC_CACHE_CHECK([for an implementation of __va_copy()],lib_cv___va_copy,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
__va_copy (args2, args1);
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
va_end (args1); va_end (args2);
[lib_cv___va_copy=no],[])
if test "x$lib_cv_va_copy" = "xyes"; then
else if test "x$lib_cv___va_copy" = "xyes"; then
if test -n "$va_copy_func"; then
AC_DEFINE_UNQUOTED(VA_COPY,$va_copy_func,[A 'va_copy' style function])
AC_CACHE_CHECK([whether va_lists can be copied by value],lib_cv_va_val_copy,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
va_end (args1); va_end (args2);
[lib_cv_va_val_copy=yes],
[lib_cv_va_val_copy=no],[])
if test "x$lib_cv_va_val_copy" = "xno"; then
AC_DEFINE(VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
if test "$want_openssl" = "yes" && test "$have_ssl" = "no"; then
if pkg-config --exists openssl; then
PKG_CHECK_MODULES(SSL, openssl)
CFLAGS="$CFLAGS $SSL_CFLAGS"
AC_CHECK_LIB(ssl, SSL_read, [
SSL_LIBS="-lssl -lcrypto"
if test "$have_openssl" = "yes"; then
AC_DEFINE(HAVE_OPENSSL,, Build with OpenSSL support)
if test $want_gnutls = yes && test "$have_ssl" = no; then
AC_CHECK_LIB(gnutls, gnutls_global_init, [
AC_DEFINE(HAVE_GNUTLS,, Build with GNUTLS support)
SSL_LIBS="-lgnutls -lgcrypt"
if test "$have_ssl" != "no"; then
AC_DEFINE(HAVE_SSL,, Build with
SSL/TLS support)
if test "$want_gc" = "yes"; then
AC_CHECK_LIB(gc, GC_malloc, [
AC_DEFINE(USE_GC,, Define if you want to use Boehm GC)
dnl ** userdb and passdb checks
if test $want_static_userdb = yes; then
AC_DEFINE(USERDB_STATIC,, Build with static userdb support)
if test $want_passdb_userdb = yes; then
AC_DEFINE(USERDB_PASSDB,, Build with passdb userdb support)
if test $want_passwd = yes; then
AC_DEFINE(USERDB_PASSWD,, Build with passwd support)
AC_DEFINE(PASSDB_PASSWD,, Build with passwd support)
if test $want_passwd_file = yes; then
AC_DEFINE(USERDB_PASSWD_FILE,, Build with passwd-file support)
AC_DEFINE(PASSDB_PASSWD_FILE,, Build with passwd-file support)
userdb="$userdb passwd-file"
passdb="$passdb passwd-file"
if test $want_shadow = yes; then
AC_CHECK_FUNC(getspnam, [
AC_DEFINE(PASSDB_SHADOW,, Build with shadow support)
if test $want_pam = yes; then
AC_CHECK_LIB(pam, pam_start, [
AC_DEFINE(HAVE_SECURITY_PAM_APPL_H,,
AC_DEFINE(HAVE_PAM_PAM_APPL_H,,
if test "$have_pam" = "yes"; then
AUTH_LIBS="$AUTH_LIBS -lpam"
AC_DEFINE(PASSDB_PAM,, Build with PAM support)
AC_CHECK_LIB(pam, pam_setcred, [
AC_DEFINE(HAVE_PAM_SETCRED,,
Define if you have pam_setcred())
if test $want_checkpassword = yes; then
AC_DEFINE(USERDB_CHECKPASSWORD,, Build with checkpassword userdb support)
AC_DEFINE(PASSDB_CHECKPASSWORD,, Build with checkpassword passdb support)
userdb="$userdb checkpassword"
passdb="$passdb checkpassword"
if test $want_bsdauth = yes; then
AC_CHECK_FUNC(auth_userokay, [
AC_DEFINE(PASSDB_BSDAUTH,, Build with BSD authentication support)
if test $want_ldap = yes; then
AC_CHECK_LIB(ldap, ldap_init, [
AC_CHECK_LIB(ldap, ldap_initialize, [
AC_DEFINE(LDAP_HAVE_INITIALIZE,, Define if you have ldap_initialize)
AUTH_LIBS="$AUTH_LIBS -lldap"
AC_DEFINE(USERDB_LDAP,, Build with LDAP support)
AC_DEFINE(PASSDB_LDAP,, Build with LDAP support)
if test $want_pgsql = yes; then
if test "$PGSQL_LIBDIR" != ""; then
LIBS="$LIBS -L$PGSQL_LIBDIR"
AC_CHECK_LIB(pq, PQconnectdb, [
if test "$PGSQL_INCLUDE" != ""; then
CPPFLAGS="$CPPFLAGS -I $PGSQL_INCLUDE"
if test "$PGSQL_INCLUDE" != ""; then
SQL_CFLAGS="$SQL_CFLAGS -I$PGSQL_INCLUDE"
if test "$PGSQL_LIBDIR" != ""; then
SQL_LIBS="$SQL_LIBS -L$PGSQL_LIBDIR"
SQL_LIBS="$SQL_LIBS -lpq"
AC_DEFINE(HAVE_PGSQL,, Build with PostgreSQL support)
if test $want_mysql = yes; then
if test "$MYSQL_LIBDIR" != ""; then
LIBS="$LIBS -L$MYSQL_LIBDIR"
AC_CHECK_LIB(mysqlclient, mysql_init, [
mysql_lib="-lmysqlclient -lz"
if test "$mysql_lib" != ""; then
if test "$MYSQL_INCLUDE" != ""; then
CPPFLAGS="$CPPFLAGS -I $MYSQL_INCLUDE"
if test "$MYSQL_INCLUDE" != ""; then
SQL_CFLAGS="$SQL_CFLAGS -I$MYSQL_INCLUDE"
if test "$MYSQL_LIBDIR" != ""; then
SQL_LIBS="$SQL_LIBS -L$MYSQL_LIBDIR"
SQL_LIBS="$SQL_LIBS $mysql_lib"
AC_CHECK_LIB(mysqlclient, mysql_ssl_set, [
AC_DEFINE(HAVE_MYSQL_SSL,, Define if your MySQL library has SSL functions)
if test "x$have_openssl" = "yes"; then
ssl_define="#define HAVE_OPENSSL"
mysql_set_ssl(0, 0, 0, 0, 0, 0);
AC_DEFINE(HAVE_MYSQL_SSL_CIPHER,, Define if your MySQL library supports setting cipher)
AC_DEFINE(HAVE_MYSQL,, Build with MySQL support)
if test "$have_sql" = yes; then
AC_DEFINE(PASSDB_SQL,, Build with SQL support)
AC_DEFINE(USERDB_SQL,, Build with SQL support)
AUTH_LIBS="$AUTH_LIBS $SQL_LIBS"
if test $want_vpopmail = yes; then
vpopmail_home="`echo ~vpopmail`"
AC_MSG_CHECKING([for vpopmail configuration at $vpop_libdeps])
if test -f $vpop_libdeps; then
AUTH_LIBS="$AUTH_LIBS `cat $vpop_libdeps`"
AC_DEFINE(USERDB_VPOPMAIL,, Build with vpopmail support)
AC_DEFINE(PASSDB_VPOPMAIL,, Build with vpopmail support)
userdb="$userdb vpopmail"
passdb="$passdb vpopmail"
if test $need_crypt = yes; then
AC_CHECK_LIB(crypt, crypt, [
AUTH_LIBS="-lcrypt $AUTH_LIBS"
AC_MSG_ERROR([crypt() wasn't found])
MODULE_LIBS="-export-dynamic"
AC_CHECK_LIB(dl, dlopen, [
MODULE_LIBS="-export-dynamic -ldl"
if test $have_modules = yes; then
AC_DEFINE(HAVE_MODULES,, Define if you have dynamic module support)
userdb="$userdb (modules)"
passdb="$passdb (modules)"
dnl ** Index file compatibility flags
dnl * currently just checking for endianess
if test $ac_cv_c_bigendian = yes; then
AC_DEFINE_UNQUOTED(MAIL_INDEX_COMPAT_FLAGS, $flags, Index file compatibility flags)
if test "x$want_ipv6" = "xyes"; then
AC_MSG_CHECKING([for IPv6])
AC_CACHE_VAL(i_cv_type_in6_addr,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
[[struct in6_addr i;]])],
[i_cv_type_in6_addr=yes],
[i_cv_type_in6_addr=no])])
if test $i_cv_type_in6_addr = yes; then
AC_DEFINE(HAVE_IPV6,, Build with IPv6 support)
AC_MSG_RESULT($i_cv_type_in6_addr)
for storage in $mail_storages; do
STORAGE_LIBS="$STORAGE_LIBS `eval \"echo \\$${storage}_libs\"`"
STORAGE_LIBS="$STORAGE_LIBS $index_libs"
capability="IMAP4rev1 SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS"
AC_DEFINE_UNQUOTED(CAPABILITY_STRING, "$capability", IMAP capabilities)
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
echo "Install prefix ...................... : $prefix"
echo "File offsets ........................ : ${offt_bits}bit"
echo "I/O loop method ..................... : $ioloop"
echo "File change notification method ..... : $notify"
echo "Building with SSL support ........... : $have_ssl"
echo "Building with IPv6 support .......... : $want_ipv6"
echo "Building with pop3 server ........... : $want_pop3d"
echo "Building with mail delivery agent .. : $want_deliver"
echo "Building with user database modules . :$userdb"
echo "Building with password lookup modules :$passdb"