configure.ac revision c4d85d3de043eacceeebcc65edb94761d64d6691
8a77240a809197c92c0736c431b4b88947a7bac1Christian MaederAC_PREREQ([2.59])
306763c67bb99228487345b32ab8c5c6cd41f23cChristian Maeder# Be sure to update ABI version also if anything changes that might require
306763c67bb99228487345b32ab8c5c6cd41f23cChristian Maeder# recompiling plugins. Most importantly that means if any structs are changed.
e6d40133bc9f858308654afb1262b8b483ec5922Till MossakowskiAC_INIT([Dovecot],[2.2.1],[dovecot@dovecot.org])
d5fe06af711a6912ae028ebf873eada4ee8733f8Christian MaederAC_DEFINE_UNQUOTED([DOVECOT_ABI_VERSION], "2.2.ABIv0($PACKAGE_VERSION)", [Dovecot ABI version])
daf3b6a9ad8839ca019f14f628bbf237805b493eChristian MaederAC_CONFIG_SRCDIR([src])
306763c67bb99228487345b32ab8c5c6cd41f23cChristian MaederAM_INIT_AUTOMAKE([foreign])
e3c3e8934edda5b2a7c0d11e44fcfb38094dc80bKlaus LuettichAM_MAINTAINER_MODE
e6d40133bc9f858308654afb1262b8b483ec5922Till MossakowskiPKG_PROG_PKG_CONFIG
306763c67bb99228487345b32ab8c5c6cd41f23cChristian MaederACLOCAL_AMFLAGS='-I $(top_srcdir)'
e3c3e8934edda5b2a7c0d11e44fcfb38094dc80bKlaus LuettichAC_SUBST(ACLOCAL_AMFLAGS)
2eb84fc82d3ffa9116bc471fda3742bd9e5a24bbChristian Maederdnl TEST_WITH(name, value, [plugin])
a14767aeac3e78ed100f5b75e210ba563ee10dbaChristian MaederAC_DEFUN([TEST_WITH], [
8d97ef4f234681b11bb5924bd4d03adef858d2d2Christian Maeder want=want_`echo $1|sed s/-/_/g`
2eb84fc82d3ffa9116bc471fda3742bd9e5a24bbChristian Maeder if test $2 = yes || test $2 = no || test $2 = auto; then
2eb84fc82d3ffa9116bc471fda3742bd9e5a24bbChristian Maeder eval $want=$2
8ca6bd4e7de178daa43f05b12cc26dc14d00ad3aChristian Maeder elif test $2 = plugin; then
8ca6bd4e7de178daa43f05b12cc26dc14d00ad3aChristian Maeder if test "$3" = plugin; then
961978c71545e0177683279f8b63358b3e3804b8Christian Maeder eval $want=plugin
0d72630889db51ffe7a0336cbb7fde5dbe415e9dEwaryst Schulz AC_ERROR([--with-$1=plugin not supported])
68e06f3c48e4d31d4956cf781d788ce114ffbb66Christian Maeder elif `echo $2|grep '^/' >/dev/null`; then
6fd36be5d272b82fbd4eb489fc333d9b4c40bd01Maciek Makowski AC_ERROR([--with-$1=path not supported. You may want to use instead:
a7e812b473ac8f0207cec03cc0e4f85a8110b0ebChristian MaederCPPFLAGS=-I$2/include LDFLAGS=-L$2/lib ./configure --with-$1])
f8b715ab2993083761c0aedb78f1819bcf67b6ccChristian Maeder AC_ERROR([--with-$1: Unknown value: $2])
0c2a90cbfb63865ff485c3fbe20a14589a5914beTill MossakowskiAC_ARG_ENABLE(devel-checks,
c74040e2ca9d0534d0c4244f69a3e76a01341f05Klaus LuettichAS_HELP_STRING([--enable-devel-checks], [Enable some extra expensive checks for developers]),
9ab0e17a1478d65b355987bc148e288844df3810Christian Maeder if test x$enableval = xyes; then
f5948eb60db57088152ad0cb07d6a0863afbb6e9Heng Jiang AC_DEFINE(DEBUG,, Build with extra debugging checks)
d22e7ef710975951a551545192daf7ef3a94bd65Mingyi Liu want_devel_checks=yes
961978c71545e0177683279f8b63358b3e3804b8Christian MaederAC_ARG_ENABLE(asserts,
1a5414972199f27756b513d5cf515e4c0d688c08Ewaryst SchulzAS_HELP_STRING([--enable-asserts], [Enable asserts (default)]),
1a5414972199f27756b513d5cf515e4c0d688c08Ewaryst Schulz if test x$enableval = xno; then
e16b3696b2c173aac14200321868ed81b8f7dc69Christian Maeder AC_DEFINE(DISABLE_ASSERTS,, Disable asserts)
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von SchroederAC_ARG_WITH(shared-libs,
c04f0404f38621101b7cde8a25ea996f927bc172Christian MaederAS_HELP_STRING([--with-shared-libs], [Link binaries using shared Dovecot libraries (default)]),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder want_shared_libs=$withval,
afae8493e1c904789e3352f6daae63bd66cf057dTill Mossakowski want_shared_libs=yes)
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAM_CONDITIONAL(BUILD_SHARED_LIBS, test "$want_shared_libs" = "yes")
e16b3696b2c173aac14200321868ed81b8f7dc69Christian MaederAC_ARG_WITH(mem-align,
e16b3696b2c173aac14200321868ed81b8f7dc69Christian MaederAS_HELP_STRING([--with-mem-align=BYTES], [Set the memory alignment (default: 8)]),
e16b3696b2c173aac14200321868ed81b8f7dc69Christian Maeder mem_align=$withval,
e16b3696b2c173aac14200321868ed81b8f7dc69Christian MaederAC_ARG_WITH(ioloop,
e16b3696b2c173aac14200321868ed81b8f7dc69Christian MaederAS_HELP_STRING([--with-ioloop=IOLOOP], [Specify the I/O loop method to use (epoll, kqueue, poll; best for the fastest available; default is best)]),
e16b3696b2c173aac14200321868ed81b8f7dc69Christian Maeder ioloop=$withval,
1f086d5155f47fdad9a0de4e46bbebb2c4b33d30Christian MaederAC_ARG_WITH(notify,
80246f8035e6c6caa10b30a06460679acfd9e382Till MossakowskiAS_HELP_STRING([--with-notify=NOTIFY], [Specify the file system notification method to use (inotify, kqueue, dnotify, none; default is detected in the above order)]),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder notify=$withval,
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAC_ARG_WITH(nss,
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAS_HELP_STRING([--with-nss], [Build with NSS module support (auto)]),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder TEST_WITH(nss, $withval),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder want_nss=auto)
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAC_ARG_WITH(shadow,
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAS_HELP_STRING([--with-shadow], [Build with shadow password support (auto)]),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder TEST_WITH(shadow, $withval),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder want_shadow=auto)
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAC_ARG_WITH(pam,
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAS_HELP_STRING([--with-pam], [Build with PAM support (auto)]),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder TEST_WITH(pam, $withval),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder want_pam=auto)
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAC_ARG_WITH(bsdauth,
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAS_HELP_STRING([--with-bsdauth], [Build with BSD authentication support (auto)]),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder TEST_WITH(bsdauth, $withval),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder want_bsdauth=auto)
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAC_ARG_WITH(gssapi,
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAS_HELP_STRING([--with-gssapi=yes|plugin Build with GSSAPI authentication support]),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder TEST_WITH(gssapi, $withval, plugin),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder want_gssapi=no)
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAC_ARG_WITH(sia,
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAS_HELP_STRING([--with-sia], [Build with Tru64 SIA support]),
70731e5459a18fc473bdc962ca94d1c12de974afChristian Maeder TEST_WITH(sia, $withval),
e3c3e8934edda5b2a7c0d11e44fcfb38094dc80bKlaus LuettichAC_ARG_WITH(ldap,
1f086d5155f47fdad9a0de4e46bbebb2c4b33d30Christian MaederAS_HELP_STRING([--with-ldap=yes|plugin], [Build with LDAP support]),
f5948eb60db57088152ad0cb07d6a0863afbb6e9Heng Jiang TEST_WITH(ldap, $withval, plugin),
0e2ae85e2453466d03c1fc5884a3d693235bb9d9Christian Maeder want_ldap=no)
0e2ae85e2453466d03c1fc5884a3d693235bb9d9Christian MaederAC_ARG_WITH(vpopmail,
16e124196c6b204769042028c74f533509c9b5d3Christian MaederAS_HELP_STRING([--with-vpopmail], [Build with vpopmail support (auto)]),
4c7f058cdd19ce67b2b5d4b7f69703d0f8a21e38Christian Maeder if test x$withval = xno; then
351145cfe8c03b4d47133c96b209f2bd6cfbf504Christian Maeder want_vpopmail=no
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian Maeder if test x$withval = xyes || test x$withval = xauto; then
4c7f058cdd19ce67b2b5d4b7f69703d0f8a21e38Christian Maeder vpopmail_home="`echo ~vpopmail`"
4c7f058cdd19ce67b2b5d4b7f69703d0f8a21e38Christian Maeder want_vpopmail=$withval
4c7f058cdd19ce67b2b5d4b7f69703d0f8a21e38Christian Maeder vpopmail_home="$withval"
e3c3e8934edda5b2a7c0d11e44fcfb38094dc80bKlaus Luettich want_vpopmail=yes
e16b3696b2c173aac14200321868ed81b8f7dc69Christian Maeder want_vpopmail=no
e3c3e8934edda5b2a7c0d11e44fcfb38094dc80bKlaus Luettich# Berkeley DB support is more or less broken. Disabled for now.
1f086d5155f47fdad9a0de4e46bbebb2c4b33d30Christian Maeder#AC_ARG_WITH(db,
a65c6747c9acbbebc93baba7bae94d2e3d8cdafbTill Mossakowski#AS_HELP_STRING([--with-db], [Build with Berkeley DB support]),
e85b224577b78d08ba5c39fe9dcc2e53995454a2Christian Maeder# TEST_WITH(db, $withval),
68a0dfd3b2ae76877534ec1495aec6128dfbd287Christian MaederAC_ARG_WITH(cdb,
0e2ae85e2453466d03c1fc5884a3d693235bb9d9Christian MaederAS_HELP_STRING([--with-cdb], [Build with CDB support]),
0e2ae85e2453466d03c1fc5884a3d693235bb9d9Christian Maeder TEST_WITH(cdb, $withval),
e3c3e8934edda5b2a7c0d11e44fcfb38094dc80bKlaus Luettichdnl The --with-sql is useful only if Dovecot is being built with all the SQL
e3c3e8934edda5b2a7c0d11e44fcfb38094dc80bKlaus Luettichdnl drivers as modules. If any SQL driver is built-in, this option is ignored.
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAC_ARG_WITH(sql,
8c7aa750542dcadb94b971be712564a9a8f1d189Christian MaederAS_HELP_STRING([--with-sql=yes|plugin], [Build with generic SQL support]),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder TEST_WITH(sql, $withval, plugin),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAC_ARG_WITH(pgsql,
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAS_HELP_STRING([--with-pgsql], [Build with PostgreSQL driver support]),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder TEST_WITH(pgsql, $withval),
6974b703484f213938fbada59dba61e49840d044Christian Maeder want_pgsql=no)
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAC_ARG_WITH(mysql,
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAS_HELP_STRING([--with-mysql], [Build with MySQL driver support]),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder TEST_WITH(mysql, $withval),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_mysql=no)
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAC_ARG_WITH(sqlite,
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAS_HELP_STRING([--with-sqlite], [Build with SQLite3 driver support]),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder TEST_WITH(sqlite, $withval),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_sqlite=no)
fbf1cdad9a9775bd7332e85f01b6a307d7dbb1cfChristian MaederAC_ARG_WITH(lucene,
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAS_HELP_STRING([--with-lucene], [Build with CLucene full text search support]),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder TEST_WITH(lucene, $withval),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_lucene=no)
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAM_CONDITIONAL(BUILD_LUCENE, test "$want_lucene" = "yes")
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAC_ARG_WITH(stemmer,
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAS_HELP_STRING([--with-stemmer], [Build with libstemmer support (for CLucene)]),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder TEST_WITH(stemmer, $withval),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_stemmer=auto)
6974b703484f213938fbada59dba61e49840d044Christian MaederAC_ARG_WITH(solr,
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAS_HELP_STRING([--with-solr], [Build with Solr full text search support]),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder TEST_WITH(solr, $withval),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_solr=no)
4ef5e33657aae95850b7e6941f67ac1fb73cd13fChristian MaederAC_ARG_WITH(zlib,
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAS_HELP_STRING([--with-zlib], [Build with zlib compression support]),
6974b703484f213938fbada59dba61e49840d044Christian Maeder TEST_WITH(zlib, $withval),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_zlib=auto)
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAC_ARG_WITH(bzlib,
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAS_HELP_STRING([--with-bzlib], [Build with bzlib compression support]),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder TEST_WITH(bzlib, $withval),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_bzlib=auto)
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAC_ARG_WITH(libcap,
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAS_HELP_STRING([--with-libcap], [Build with libcap support (Dropping capabilities).]),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder TEST_WITH(libcap, $withval),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_libcap=auto)
1dfd1687e9ee6a45e2cb5268a701ead79c1c1f79Christian MaederAC_ARG_WITH(libwrap,
1dfd1687e9ee6a45e2cb5268a701ead79c1c1f79Christian MaederAS_HELP_STRING([--with-libwrap], [Build with libwrap, ie. TCP-wrappers]),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder TEST_WITH(libwrap, $withval),
1dfd1687e9ee6a45e2cb5268a701ead79c1c1f79Christian Maeder want_libwrap=no)
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAC_ARG_WITH(ssl,
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAS_HELP_STRING([--with-ssl=gnutls|openssl], [Build with GNUTLS or OpenSSL (default)]),
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder if test x$withval = xno; then
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_gnutls=no
6974b703484f213938fbada59dba61e49840d044Christian Maeder want_openssl=no
6974b703484f213938fbada59dba61e49840d044Christian Maeder elif test x$withval = xgnutls; then
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder AC_ERROR([GNUTLS support is broken currently])
6974b703484f213938fbada59dba61e49840d044Christian Maeder want_gnutls=yes
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_openssl=no
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder elif test x$withval = xopenssl; then
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_gnutls=no
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_openssl=yes
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder elif test x$withval = xyes; then
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_gnutls=no
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_openssl=yes
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder AC_ERROR([--with-ssl: Invalid value: $withval])
1dfd1687e9ee6a45e2cb5268a701ead79c1c1f79Christian Maeder want_gnutls=no
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder want_openssl=auto
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAC_ARG_WITH(ssldir,
6974b703484f213938fbada59dba61e49840d044Christian MaederAS_HELP_STRING([--with-ssldir=DIR], [SSL base directory for certificates (/etc/ssl)]),
e3c3e8934edda5b2a7c0d11e44fcfb38094dc80bKlaus Luettich ssldir="$withval",
fbf1cdad9a9775bd7332e85f01b6a307d7dbb1cfChristian MaederAC_SUBST(ssldir)
4b338e9d8a4e0bffb4d1bc6fb5fa371a8a0dec1aTill MossakowskiAC_ARG_WITH(rundir,
ef60398f3b9f24614b074f8f0f1349ab527e1c77Christian MaederAS_HELP_STRING([--with-rundir=DIR], [Runtime data directory (LOCALSTATEDIR/run/dovecot)]),
4b338e9d8a4e0bffb4d1bc6fb5fa371a8a0dec1aTill Mossakowski rundir="$withval",
961978c71545e0177683279f8b63358b3e3804b8Christian MaederAC_SUBST(rundir)
eaf34cf96fbfcdcce7f3bdb322c4ea7ebd1fd220Liam O'ReillyAC_ARG_WITH(statedir,
0015e1756b734b34d4b550318c078f9a0c585611Christian MaederAS_HELP_STRING([--with-statedir=DIR], [Permanent data directory (LOCALSTATEDIR/lib/dovecot)]),
e3c3e8934edda5b2a7c0d11e44fcfb38094dc80bKlaus Luettich statedir="$withval",
cd6e5706893519bfcf24539afa252fcbed5097ddKlaus Luettich statedir=$localstatedir/lib/$PACKAGE
e85b224577b78d08ba5c39fe9dcc2e53995454a2Christian MaederAC_SUBST(statedir)
2ce581897091465f0d602e2e36c4ea687230855fChristian MaederAC_ARG_WITH([systemdsystemunitdir],
fbf1cdad9a9775bd7332e85f01b6a307d7dbb1cfChristian MaederAS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files (auto=detect)]), [
81f49ee02aaa3bc870401f8883bf52742eb3ea7aJonathan von Schroeder if test "$withval" = "auto"; then
d6c6b2543c509ec7f6213e4cba675d96304a7fd6Christian Maeder systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
d6c6b2543c509ec7f6213e4cba675d96304a7fd6Christian Maeder elif test "$withval" != "no"; then
c7e03d0708369f944b6f235057b39142a21599f2Mihai Codescu systemdsystemunitdir=$withval
2d25d5c234b53c78575bb8c5734832b5f2210debMaciek Makowskiif test "$systemdsystemunitdir" != ""; then
3b4439aa37e4229ad6e83d46bd303c2799784c80Till Mossakowski AC_SUBST(systemdsystemunitdir)
0992b212df8eec8af18e1c208da54897021964c4Christian Maeder AC_DEFINE(HAVE_SYSTEMD,, Define if you want to use systemd socket activation)
7df3d45ef67eebbf8c492bb5c342d202caa4d34bChristian MaederAM_CONDITIONAL(HAVE_SYSTEMD, test "$systemdsystemunitdir" != "")
3b70d8ee5c2927f843d5d907e6ef724f867f1b40Till MossakowskiAC_ARG_WITH(gc,
ca732bc259f74cb4f3f725daab7fe80fc7e1d9a0Till MossakowskiAS_HELP_STRING([--with-gc], [Use Boehm garbage collector]),
e85b224577b78d08ba5c39fe9dcc2e53995454a2Christian Maeder TEST_WITH(gc, $withval),
1a5414972199f27756b513d5cf515e4c0d688c08Ewaryst SchulzAC_ARG_WITH(storages,
eca4db63ed0bdbd93b62678feea6e3eb80aa47bbChristian MaederAS_HELP_STRING([--with-storages], [Build with specified mail storage formats (mdbox sdbox maildir mbox cydir imapc pop3c)]), [
9eb910977472b66b5c65223518f4846bf5c2ef75Christian Maeder if test "$withval" = "yes" || test "$withval" = "no"; then
2fcae3e3d61ea194a6ce5f0bd4afc1b6ed4b2faeChristian Maeder AC_MSG_ERROR([--with-storages needs storage list as parameter])
eca4db63ed0bdbd93b62678feea6e3eb80aa47bbChristian Maeder mail_storages="shared `echo "$withval"|sed 's/,/ /g'`" ],
a7be28e157e9ceeec73a8fd0e642c36ea29d4218Christian Maeder mail_storages="shared mdbox sdbox maildir mbox cydir imapc pop3c")
a7be28e157e9ceeec73a8fd0e642c36ea29d4218Christian MaederAC_SUBST(mail_storages)
a7be28e157e9ceeec73a8fd0e642c36ea29d4218Christian Maedermail_storages="$mail_storages raw fail"
a7be28e157e9ceeec73a8fd0e642c36ea29d4218Christian Maeder# drop duplicates
fbf1cdad9a9775bd7332e85f01b6a307d7dbb1cfChristian Maederduplicates=`(for i in $mail_storages; do echo $i; done)|sort|uniq -d|xargs echo`
df6f4a9e6b3d0542ecc181fbc1bcec2affca1d30Christian Maederif test "$duplicates" != ""; then
e953bea49e7f0e1a43bccf2a66c5e2a2b50848e0Christian Maeder AC_ERROR([Duplicate --with-storages: $duplicates])
1f086d5155f47fdad9a0de4e46bbebb2c4b33d30Christian MaederDC_DOVECOT_MODULEDIR
2b4130336e941b7d01c78a6da55449a4c6eca609Till MossakowskiAC_ARG_WITH(docs,
a14767aeac3e78ed100f5b75e210ba563ee10dbaChristian MaederAS_HELP_STRING([--with-docs], [Install documentation (default)]),
71bf376677866b4735ae3c13ee08a863d25c1188Christian Maeder if test x$withval = xno; then
71bf376677866b4735ae3c13ee08a863d25c1188Christian Maeder want_docs=yes)
71bf376677866b4735ae3c13ee08a863d25c1188Christian MaederAM_CONDITIONAL(BUILD_DOCS, test "$want_docs" = "yes")
e24ad3f655daa60ddabe690e4b11de3187996c16cmaederdnl always enable all of the passbs and userdbs that don't require extra libs
e24ad3f655daa60ddabe690e4b11de3187996c16cmaederwant_passwd=yes
22573c6b275549f2fe22f38daf53230edcdb6c6bChristian Maederwant_passwd_file=yes
b524978df6a89e40139f2862ad9eb6f9f5c8a1b5Ewaryst Schulzwant_checkpassword=yes
cae4916b0844b837a4dd7e29730c56a3e26ef94dEwaryst Schulzwant_prefetch_userdb=yes
59ff8134f94a323b1a6fe967bb687cccf068d9c2Ewaryst SchulzAC_PROG_CXX # lucene plugin needs this
59ff8134f94a323b1a6fe967bb687cccf068d9c2Ewaryst SchulzAC_HEADER_STDC
70731e5459a18fc473bdc962ca94d1c12de974afChristian MaederAC_PROG_LIBTOOL
AC_DEFINE([DOVECOT_VERSION_MAJOR], regexp(AC_PACKAGE_VERSION, [^\([0-9]+\)\.\([0-9]+\)], [\1]), [Dovecot major version])
AC_DEFINE([DOVECOT_VERSION_MINOR], regexp(AC_PACKAGE_VERSION, [^\([0-9]+\)\.\([0-9]+\)], [\2]), [Dovecot minor version])
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])