configure.ac revision e37aed073e70daf34e3791a01f232810626208e8
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_PREREQ([2.59])
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen# Be sure to update ABI version also if anything changes that might require
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen# recompiling plugins. Most importantly that means if any structs are changed.
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_INIT([Dovecot],[2.2.beta2],[dovecot@dovecot.org])
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_DEFINE_UNQUOTED([DOVECOT_ABI_VERSION], "2.2.ABIv0($PACKAGE_VERSION)", [Dovecot ABI version])
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_CONFIG_SRCDIR([src])
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAM_INIT_AUTOMAKE([foreign])
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAM_MAINTAINER_MODE
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenPKG_PROG_PKG_CONFIG
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenACLOCAL_AMFLAGS='-I $(top_srcdir)'
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_SUBST(ACLOCAL_AMFLAGS)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainendnl TEST_WITH(name, value, [plugin])
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_DEFUN([TEST_WITH], [
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want=want_`echo $1|sed s/-/_/g`
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen if test $2 = yes || test $2 = no || test $2 = auto; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen eval $want=$2
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen elif test $2 = plugin; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen if test "$3" = plugin; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen eval $want=plugin
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen AC_ERROR([--with-$1=plugin not supported])
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen elif `echo $2|grep '^/' >/dev/null`; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen AC_ERROR([--with-$1=path not supported. You may want to use instead:
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenCPPFLAGS=-I$2/include LDFLAGS=-L$2/lib ./configure --with-$1])
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen AC_ERROR([--with-$1: Unknown value: $2])
8fd00f8716a931e84f33e29c8d3c579ebd718411Timo SirainenAC_ARG_ENABLE(devel-checks,
8fd00f8716a931e84f33e29c8d3c579ebd718411Timo SirainenAS_HELP_STRING([--enable-devel-checks], [Enable some extra expensive checks for developers]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen if test x$enableval = xyes; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen AC_DEFINE(DEBUG,, Build with extra debugging checks)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_devel_checks=yes
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_ENABLE(asserts,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--enable-asserts], [Enable asserts (default)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen if test x$enableval = xno; then
8fd00f8716a931e84f33e29c8d3c579ebd718411Timo Sirainen AC_DEFINE(DISABLE_ASSERTS,, Disable asserts)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(shared-libs,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-shared-libs], [Link binaries using shared Dovecot libraries (default)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_shared_libs=$withval,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_shared_libs=yes)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAM_CONDITIONAL(BUILD_SHARED_LIBS, test "$want_shared_libs" = "yes")
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(mem-align,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-mem-align=BYTES], [Set the memory alignment (default: 8)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen mem_align=$withval,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(ioloop,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-ioloop=IOLOOP], [Specify the I/O loop method to use (epoll, kqueue, poll; best for the fastest available; default is best)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen ioloop=$withval,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(notify,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-notify=NOTIFY], [Specify the file system notification method to use (inotify, kqueue, dnotify, none; default is detected in the above order)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen notify=$withval,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(nss,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-nss], [Build with NSS module support (auto)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(nss, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_nss=auto)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(shadow,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-shadow], [Build with shadow password support (auto)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(shadow, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_shadow=auto)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(pam,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-pam], [Build with PAM support (auto)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(pam, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_pam=auto)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(bsdauth,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-bsdauth], [Build with BSD authentication support (auto)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(bsdauth, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_bsdauth=auto)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(gssapi,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-gssapi=yes|plugin Build with GSSAPI authentication support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(gssapi, $withval, plugin),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_gssapi=no)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(sia,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-sia], [Build with Tru64 SIA support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(sia, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(ldap,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-ldap=yes|plugin], [Build with LDAP support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(ldap, $withval, plugin),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_ldap=no)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(vpopmail,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-vpopmail], [Build with vpopmail support (auto)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen if test x$withval = xno; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_vpopmail=no
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen if test x$withval = xyes || test x$withval = xauto; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen vpopmail_home="`echo ~vpopmail`"
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_vpopmail=$withval
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen vpopmail_home="$withval"
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_vpopmail=yes
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_vpopmail=no
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen# Berkeley DB support is more or less broken. Disabled for now.
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen#AC_ARG_WITH(db,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen#AS_HELP_STRING([--with-db], [Build with Berkeley DB support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen# TEST_WITH(db, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(cdb,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-cdb], [Build with CDB support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(cdb, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainendnl The --with-sql is useful only if Dovecot is being built with all the SQL
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainendnl drivers as modules. If any SQL driver is built-in, this option is ignored.
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(sql,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-sql=yes|plugin], [Build with generic SQL support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(sql, $withval, plugin),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(pgsql,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-pgsql], [Build with PostgreSQL driver support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(pgsql, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_pgsql=no)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(mysql,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-mysql], [Build with MySQL driver support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(mysql, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_mysql=no)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(sqlite,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-sqlite], [Build with SQLite3 driver support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(sqlite, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_sqlite=no)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(lucene,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-lucene], [Build with CLucene full text search support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(lucene, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_lucene=no)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAM_CONDITIONAL(BUILD_LUCENE, test "$want_lucene" = "yes")
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(stemmer,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-stemmer], [Build with libstemmer support (for CLucene)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(stemmer, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_stemmer=auto)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(solr,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-solr], [Build with Solr full text search support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(solr, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_solr=no)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(zlib,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-zlib], [Build with zlib compression support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(zlib, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_zlib=auto)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(bzlib,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-bzlib], [Build with bzlib compression support]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(bzlib, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_bzlib=auto)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(libcap,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-libcap], [Build with libcap support (Dropping capabilities).]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(libcap, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_libcap=auto)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(libwrap,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-libwrap], [Build with libwrap, ie. TCP-wrappers]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(libwrap, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_libwrap=no)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(ssl,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-ssl=gnutls|openssl], [Build with GNUTLS or OpenSSL (default)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen if test x$withval = xno; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_gnutls=no
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_openssl=no
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen elif test x$withval = xgnutls; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen AC_ERROR([GNUTLS support is broken currently])
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_gnutls=yes
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_openssl=no
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen elif test x$withval = xopenssl; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_gnutls=no
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_openssl=yes
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen elif test x$withval = xyes; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_gnutls=no
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_openssl=yes
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen AC_ERROR([--with-ssl: Invalid value: $withval])
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_gnutls=no
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen want_openssl=auto
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(ssldir,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-ssldir=DIR], [SSL base directory for certificates (/etc/ssl)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen ssldir="$withval",
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_SUBST(ssldir)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(rundir,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-rundir=DIR], [Runtime data directory (LOCALSTATEDIR/run/dovecot)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen rundir="$withval",
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen rundir=$localstatedir/run/$PACKAGE
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_SUBST(rundir)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(statedir,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-statedir=DIR], [Permanent data directory (LOCALSTATEDIR/lib/dovecot)]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen statedir="$withval",
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen statedir=$localstatedir/lib/$PACKAGE
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_SUBST(statedir)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH([systemdsystemunitdir],
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files (auto=detect)]), [
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen if test "$withval" = "auto"; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen elif test "$withval" != "no"; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen systemdsystemunitdir=$withval
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainenif test "$systemdsystemunitdir" != ""; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen AC_SUBST(systemdsystemunitdir)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen AC_DEFINE(HAVE_SYSTEMD,, Define if you want to use systemd socket activation)
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAM_CONDITIONAL(HAVE_SYSTEMD, test "$systemdsystemunitdir" != "")
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(gc,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-gc], [Use Boehm garbage collector]),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen TEST_WITH(gc, $withval),
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAC_ARG_WITH(storages,
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo SirainenAS_HELP_STRING([--with-storages], [Build with specified mail storage formats (mdbox sdbox maildir mbox cydir imapc pop3c)]), [
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen if test "$withval" = "yes" || test "$withval" = "no"; then
e8bdf1be00aec45d0c6dd72ad9c8be02a3dfc778Timo Sirainen AC_MSG_ERROR([--with-storages needs storage list as parameter])
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen mail_storages="shared `echo "$withval"|sed 's/,/ /g'`" ],
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen mail_storages="shared mdbox sdbox maildir mbox cydir imapc pop3c")
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenAC_SUBST(mail_storages)
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainenmail_storages="$mail_storages raw fail"
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen# drop duplicates
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainenduplicates=`(for i in $mail_storages; do echo $i; done)|sort|uniq -d|xargs echo`
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainenif test "$duplicates" != ""; then
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen AC_ERROR([Duplicate --with-storages: $duplicates])
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenDC_DOVECOT_MODULEDIR
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenAC_ARG_WITH(docs,
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenAS_HELP_STRING([--with-docs], [Install documentation (default)]),
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen if test x$withval = xno; then
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen want_docs=yes
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen want_docs=yes)
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenAM_CONDITIONAL(BUILD_DOCS, test "$want_docs" = "yes")
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainendnl always enable all of the passbs and userdbs that don't require extra libs
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainenwant_passwd=yes
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainenwant_passwd_file=yes
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainenwant_checkpassword=yes
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainenwant_prefetch_userdb=yes
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenAC_PROG_CXX # lucene plugin needs this
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenAC_HEADER_STDC
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenAC_PROG_LIBTOOL
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenAC_DEFINE_UNQUOTED(DOVECOT_NAME, "$PACKAGE_NAME", Dovecot name)
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenAC_DEFINE_UNQUOTED(DOVECOT_STRING, "$PACKAGE_STRING", Dovecot string)
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenAC_DEFINE_UNQUOTED(DOVECOT_VERSION, "$PACKAGE_VERSION", Dovecot version)
65d89650662f7f1681a3431c585bfc9721a85149Timo SirainenAC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h malloc.h inttypes.h \
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen sys/uio.h sys/sysmacros.h sys/resource.h sys/select.h libgen.h \
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen sys/quota.h sys/fs/ufs_quota.h ufs/ufs/quota.h jfs/quota.h \
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen mntent.h sys/mnttab.h sys/event.h sys/time.h sys/mkdev.h linux/dqblk_xfs.h \
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen xfs/xqm.h execinfo.h ucontext.h malloc_np.h sys/utsname.h sys/vmount.h \
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainen sys/utsname.h glob.h linux/falloc.h ucred.h sys/ucred.h)
65d89650662f7f1681a3431c585bfc9721a85149Timo Sirainendnl * clang check
CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast"
# clang 3.3+ unfortunately this gives warnings with hash.h
AC_CHECK_HEADER(tcpd.h, [
#include <tcpd.h>
AC_ERROR([Can't build with libwrap support: tcpd.h not found])
AC_DEFINE(PACKAGE_WEBPAGE, "http://www.dovecot.org/", Support URL)
dnl strtoimax and strtoumax are macros in HP-UX, so inttypes.h must be included
#include <inttypes.h>
#include <inttypes.h>
#include <sys/epoll.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <sys/inotify.h>
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
AC_DEFINE(PREAD_WRAPPERS,, Define if pread/pwrite needs _XOPEN_SOURCE 500)
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
int fd = creat("conftest.temp", 0600);
unlink("conftest.temp");
# for getting fd_send/fd_recv working:
AC_DEFINE(PREAD_BROKEN,, Defint if pread/pwrite implementation is broken)
#include <sys/types.h>
#include <stdio.h>
#include <sys/types.h>
dnl * older autoconfs don't include sys/types.h, so do it manually
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
d.d_type = DT_DIR;
#include <limits.h>
#include <sys/types.h>
#include <sys/types.h>
echo "..ignoring as requested.."
#include <sys/types.h>
dnl some systems don't have stdint.h, but still have some of the types
AC_CHECK_HEADER(stdint.h, [
stdint_include="#include <stdint.h>"
AC_CHECKTYPE2(socklen_t, [#include <sys/socket.h>])
AC_MSG_CHECKING([for /dev/urandom])
AC_CHECK_HEADER(openssl/rand.h, [
AC_DEFINE(HAVE_OPENSSL_RAND_H,, Define if you have openssl/rand.h)
#include <time.h>]],
#include <stdio.h>
#include <time.h>
f = fopen("conftest.temp", "w");
i_cv_gmtime_max_time_t=`cat conftest.temp`
rm -f conftest.temp
#include <sys/types.h>
AC_DEFINE_UNQUOTED(FLEXIBLE_ARRAY_MEMBER, $flexible_value, How to define flexible array members in structs)
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>]],
#include <sys/types.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/prctl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
int f = open("conftest.mmap", O_RDWR|O_CREAT|O_TRUNC, 0600);
unlink("conftest.mmap");
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include "fdpass.h"
send_fd = creat("conftest.fdpass", 0600);
unlink("conftest.fdpass");
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/sendfile.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <stdlib.h>
dnl * Check for crypt() if unistd.h compiles with _XOPEN_SOURCE + _XPG6
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
unsigned long x = st.st_mtim.tv_nsec;
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
unsigned long x = st.st_mtimespec.tv_nsec;
AC_CACHE_CHECK([if statvfs.f_mntfromname exists],i_cv_have_statvfs_f_mntfromname,[
#include <sys/types.h>
#include <sys/statvfs.h>
char *p = buf.f_mntfromname;
AC_DEFINE(HAVE_STATVFS_MNTFROMNAME,, Define if you have statvfs.f_mntfromname)
AC_CACHE_CHECK([if statfs.f_mntfromname exists],i_cv_have_statfs_f_mntfromname,[
#include <sys/param.h>
#include <sys/mount.h>
char *p = buf.f_mntfromname;
AC_DEFINE(HAVE_STATFS_MNTFROMNAME,, Define if you have statfs.f_mntfromname)
dnl * Check if we have struct dqblk.dqb_curblocks
AC_CACHE_CHECK([if struct dqblk.dqb_curblocks exists],i_cv_have_dqblk_dqb_curblocks,[
#include <sys/types.h>
#include "$srcdir/src/plugins/quota/quota-fs.h"
unsigned int x = dqblk.dqb_curblocks;
AC_DEFINE(HAVE_STRUCT_DQBLK_CURBLOCKS,, Define if struct sqblk.dqb_curblocks exists)
dnl * Check if we have struct dqblk.dqb_curspace
AC_CACHE_CHECK([if struct dqblk.dqb_curspace exists],i_cv_have_dqblk_dqb_curspace,[
#include <sys/types.h>
#include "$srcdir/src/plugins/quota/quota-fs.h"
unsigned int x = dqblk.dqb_curspace;
AC_DEFINE(HAVE_STRUCT_DQBLK_CURSPACE,, Define if struct sqblk.dqb_curspace exists)
#include <sys/types.h>
#include <sys/fs/ufs_quota.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdarg.h>
#include <stdarg.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/vmount.h>
if test "$PKG_CONFIG" != "" && $PKG_CONFIG --exists openssl 2>/dev/null; then
AC_CHECK_HEADER(gnutls/gnutls.h, [
AC_ERROR([Can't build with GNUTLS: gnutls/gnutls.h not found])
AC_DEFINE(HAVE_SSL,, Build with SSL/TLS support)
AC_CHECK_HEADER(shadow.h, [
AC_ERROR([Can't build with shadow support: shadow.h not found])
AC_CHECK_HEADER(security/pam_appl.h, [
Define if you have security/pam_appl.h)
AC_CHECK_HEADER(pam/pam_appl.h, [
Define if you have pam/pam_appl.h)
AC_ERROR([Can't build with PAM support: pam_appl.h not found])
# have gssapi.h
AC_CHECK_HEADER([gssapi/gssapi.h], [
AC_DEFINE(HAVE_GSSAPI_GSSAPI_H,, GSSAPI headers in gssapi/gssapi.h)
AC_CHECK_HEADER([gssapi.h], [
AC_DEFINE(HAVE_GSSAPI_H,, GSSAPI headers in gssapi.h)
# include <gssapi.h>
# include <gssapi/gssapi.h>
#include <krb5.h>
#include <string.h>
AC_ERROR([Can't build with GSSAPI support: gssapi.h not found])
AC_CHECK_HEADER(ldap.h, [
AC_ERROR([Can't build with LDAP support: ldap.h not found])
#include <db.h>
AC_CHECK_HEADER(db.h, [
AC_ERROR([Can't build with db support: db.h not found])
AC_CHECK_HEADER(cdb.h, [
AC_ERROR([Can't build with CDB support: cdb.h not found])
if test -r "$i/$j/libpq-fe.h"; then
AC_CHECK_HEADER(libpq-fe.h, [
AC_ERROR([Can't build with PostgreSQL support: libpq-fe.h not found])
for j in include include/mysql ""; do
if test -r "$i/$j/mysql.h"; then
AC_CHECK_HEADER(mysql.h, [
#include <mysql.h>
AC_ERROR([Can't build with MySQL support: mysql.h not found])
AC_CHECK_HEADER(sqlite3.h, [
AC_ERROR([Can't build with SQLite support: sqlite3.h not found])
vpop_etc="$vpopmail_home/etc"
AC_MSG_CHECKING([for vpopmail configuration at $vpop_etc/lib_deps])
if ! test -f $vpop_etc/lib_deps; then
AC_MSG_CHECKING([for vpopmail configuration at $vpop_etc/lib_deps])
if test -f $vpop_etc/lib_deps; then
AUTH_CFLAGS="$AUTH_CFLAGS `cat $vpop_etc/inc_deps` $CFLAGS"
AUTH_LIBS="$AUTH_LIBS `cat $vpop_etc/lib_deps`"
AC_ERROR([Can't build with vpopmail support: $vpop_etc/lib_deps not found])
# shrext_cmds comes from libtool.m4
#include <nss.h>
AC_ERROR([Can't build with NSS support: nss.h not found or not usable])
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>]],
maildir_libs='$(top_builddir)/src/lib-storage/index/maildir/libstorage_maildir.la'
mbox_libs='$(top_builddir)/src/lib-storage/index/mbox/libstorage_mbox.la'
dbox_common_libs='$(top_builddir)/src/lib-storage/index/dbox-common/libstorage_dbox_common.la'
sdbox_libs='$(top_builddir)/src/lib-storage/index/dbox-single/libstorage_dbox_single.la'
mdbox_libs='$(top_builddir)/src/lib-storage/index/dbox-multi/libstorage_dbox_multi.la'
cydir_libs='$(top_builddir)/src/lib-storage/index/cydir/libstorage_cydir.la'
imapc_libs='$(top_builddir)/src/lib-storage/index/imapc/libstorage_imapc.la $(top_builddir)/src/lib-imap-client/libimap_client.la'
pop3c_libs='$(top_builddir)/src/lib-storage/index/pop3c/libstorage_pop3c.la'
raw_libs='$(top_builddir)/src/lib-storage/index/raw/libstorage_raw.la'
shared_libs='$(top_builddir)/src/lib-storage/index/shared/libstorage_shared.la'
CORE_LIBS='$(top_builddir)/src/lib-dovecot/libdovecot.la'
STORAGE_LIB='$(top_builddir)/src/lib-storage/libdovecot-storage.la'
LIBDOVECOT_DEPS='$(top_builddir)/src/lib-dovecot/libdovecot.la'
LIBDOVECOT_STORAGE_DEPS='$(top_builddir)/src/lib-storage/libdovecot-storage.la $(top_builddir)/src/lib-imap-storage/libimap-storage.la'
LIBDOVECOT_LOGIN='$(top_builddir)/src/login-common/libdovecot-login.la'
LIBDOVECOT_COMPRESS='$(top_builddir)/src/lib-compression/libcompression.la'
LIBDOVECOT_LDA='$(top_builddir)/src/lib-lda/libdovecot-lda.la'
LIBDOVECOT_DEPS='$(top_builddir)/src/lib-master/libmaster.la $(top_builddir)/src/lib-settings/libsettings.la $(top_builddir)/src/lib-http/libhttp.la $(top_builddir)/src/lib-dict/libdict.la $(top_builddir)/src/lib-dns/libdns.la $(top_builddir)/src/lib-fs/libfs.la $(top_builddir)/src/lib-imap/libimap.la $(top_builddir)/src/lib-mail/libmail.la $(top_builddir)/src/lib-auth/libauth.la $(top_builddir)/src/lib-charset/libcharset.la $(top_builddir)/src/lib-ssl-iostream/libssl_iostream.la $(top_builddir)/src/lib-test/libtest.la $(top_builddir)/src/lib/liblib.la'
LIBDOVECOT_STORAGE_LAST='$(top_builddir)/src/lib-storage/list/libstorage_list.la $(top_builddir)/src/lib-storage/index/libstorage_index.la $(top_builddir)/src/lib-storage/libstorage.la $(top_builddir)/src/lib-index/libindex.la $(top_builddir)/src/lib-imap-storage/libimap-storage.la'
LIBDOVECOT_STORAGE_FIRST='$(top_builddir)/src/lib-storage/libstorage_service.la $(top_builddir)/src/lib-storage/register/libstorage_register.la'
LIBDOVECOT_LOGIN='$(top_builddir)/src/login-common/liblogin.la'
LIBDOVECOT_COMPRESS='$(top_builddir)/src/lib-compression/libcompression.la'
LIBDOVECOT_LDA='$(top_builddir)/src/lib-lda/liblda.la'
LIBDOVECOT_SQL='$(top_builddir)/src/lib-sql/libsql.la'
AC_CHECK_HEADER(zlib.h, [
AC_ERROR([Can't build with zlib support: zlib.h not found])
AC_CHECK_HEADER(bzlib.h, [
AC_ERROR([Can't build with bzlib support: bzlib.h not found])
if test -f /usr/include/rpcsvc/rquota.x && test -n "$RPCGEN"; then
AC_CHECK_HEADER(expat.h, [
AC_ERROR([Can't build with Solr support: expat.h not found])
FILES1=`find $srcdir/src -name '*settings.[[ch]]'|grep "$srcdir/src/lib-" | sed 's/^\(.*\)\(.\)$/\2 \1\2/' | grep -v 'lib-master.*c$' | sort -r | sed s/^..//`
FILES2=`find $srcdir/src -name '*settings.[[ch]]'|grep -v "$srcdir/src/lib-" | sed 's/^\(.*\)\(.\)$/\2 \1\2/' | grep -v all-settings | sort -r | sed s/^..//`
SETTING_FILES=`echo $FILES1 $FILES2 | sed -e s,$srcdir/src,./src,g -e 's,./src,$(top_srcdir)/src,g'`
capability="$capability_banner SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE BINARY MOVE"
AC_DEFINE_UNQUOTED(CAPABILITY_BANNER_STRING, "$capability_banner", IMAP capabilities advertised in banner)
chmod +x cc-wrapper.sh
CC=`pwd`/cc-wrapper.sh
RUN_TEST='$(SHELL) $(top_srcdir)/run-test.sh'
AC_CONFIG_HEADERS([config.h])