configure.in revision fc1696e32dd732a5bbabc3c8f64810448e327043
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAM_CONFIG_HEADER(config.h)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAM_INIT_AUTOMAKE(dovecot, 1.0-test13)
472369cba85d9f7c995dda60e7cd01d78b4a960aTimo SirainenAM_MAINTAINER_MODE
b1f37113a5760bee842c5a7678bb5fa6f5bd8b60Timo SirainenAC_STDC_HEADERS
94d8e51119003d2bc5a100c663f90141f297385dTimo SirainenAC_ARG_PROGRAM
e28fa207d1a097fa6e4a867f74ee0761472ef1ceTimo SirainenAM_PROG_LIBTOOL
13d98ffa534f2e7d04a832c9d0153fc9c568b878Timo SirainenAC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h)
13d98ffa534f2e7d04a832c9d0153fc9c568b878Timo SirainenAC_CHECK_HEADERS(sys/uio.h sys/sysmacros.h sys/resource.h linux/mman.h)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_CHECK_HEADERS(sys/select.h)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen# check posix headers
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo SirainenAC_CHECK_HEADERS(sys/time.h)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_ARG_ENABLE(ipv6,
5694eeb99b69dea8033ca77ad69743c6b4871370Timo Sirainen[ --enable-ipv6 Enable IPv6 support (default)],
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen if test x$enableval = xno; then
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_ipv6=yes
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_ipv6=yes)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_ARG_ENABLE(debug,
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen[ --enable-debug Enable some extra checks for debugging],
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen if test x$enableval = xyes; then
220e21750948941dc6e33b8f11b552fa21d7f81eTimo Sirainen AC_DEFINE(DEBUG,, Build with extra debugging checks)
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo SirainenAC_ARG_ENABLE(asserts,
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo Sirainen[ --enable-asserts Enable asserts (default)],
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo Sirainen if test x$enableval = xno; then
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo Sirainen AC_DEFINE(DISABLE_ASSERTS,, Disable asserts)
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo SirainenAC_ARG_WITH(file-offset-size,
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo Sirainen[ --with-file-offset-size=BITS Set size of file offsets. Usually 32 or 64.
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo Sirainen (default: 64 if available)],
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo Sirainen preferred_off_t_bits=$withval,
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen preferred_off_t_bits=64)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_ARG_WITH(mem-align,
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen[ --with-mem-align=BYTES Set the memory alignment (default: 8)],
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen mem_align=$withval,
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_ARG_WITH(passwd,
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen[ --with-passwd Build with /etc/passwd support (default)],
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen if test x$withval = xno; then
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_passwd=no
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_passwd=yes
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_passwd=yes)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_ARG_WITH(passwd-file,
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo Sirainen[ --with-passwd-file Build with passwd-like file support (default)],
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo Sirainen if test x$withval = xno; then
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo Sirainen want_passwd_file=no
8a0ad174adb1eb5108511b90e97f4e5f9089b0eeTimo Sirainen want_passwd_file=yes
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_passwd_file=yes)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_ARG_WITH(shadow,
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen[ --with-shadow Build with shadow password support (default)],
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen if test x$withval = xno; then
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_shadow=no
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_shadow=yes
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_shadow=yes)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_ARG_WITH(pam,
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen[ --with-pam Build with PAM support (default)],
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen if test x$withval = xno; then
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Sirainen want_pam=yes)
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo SirainenAC_ARG_WITH(bsdauth,
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Sirainen[ --with-bsdauth Build with BSD authentication support (default)],
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Sirainen if test x$withval = xno; then
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Sirainen want_bsdauth=no
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Sirainen want_bsdauth=yes
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Sirainen want_bsdauth=yes)
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenAC_ARG_WITH(ldap,
db8b0a3f74a20528d66a3c4be7df920e5c4554c2Timo Sirainen[ --with-ldap Build with LDAP support],
db8b0a3f74a20528d66a3c4be7df920e5c4554c2Timo Sirainen if test x$withval = xno; then
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_ldap=yes
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_ldap=no)
db8b0a3f74a20528d66a3c4be7df920e5c4554c2Timo SirainenAC_ARG_WITH(vpopmail,
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen[ --with-vpopmail Build with vpopmail support (default)],
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen if test x$withval = xno; then
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_vpopmail=no
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_vpopmail=yes
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen want_vpopmail=yes)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_ARG_WITH(static-userdb,
1701e3f91107051b1704721bf1dc1e32491faaf9Timo Sirainen[ --with-static-userdb Build with static userdb support (default)],
2649b237dd4690575e75a30b2bf3b39ebd37b835Timo Sirainen if test x$withval = xno; then
63e207529879438e9f4412d97cdc34bdc82a3702Timo Sirainen want_static_userdb=no
2649b237dd4690575e75a30b2bf3b39ebd37b835Timo Sirainen want_static_userdb=yes
2649b237dd4690575e75a30b2bf3b39ebd37b835Timo Sirainen want_static_userdb=yes)
2649b237dd4690575e75a30b2bf3b39ebd37b835Timo SirainenAC_ARG_WITH(pgsql,
2649b237dd4690575e75a30b2bf3b39ebd37b835Timo Sirainen[ --with-pgsql Build with PostgreSQL support],
2649b237dd4690575e75a30b2bf3b39ebd37b835Timo Sirainen if test x$withval = xno; then
2649b237dd4690575e75a30b2bf3b39ebd37b835Timo Sirainen want_pgsql=no
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Sirainen want_pgsql=yes
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_pgsql=no)
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenAC_ARG_WITH(mysql,
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen[ --with-mysql Build with MySQL support],
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen if test x$withval = xno; then
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_mysql=no
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_mysql=yes
3fe67ec75ccae1230bb9eb9f16affc48377f6441Timo Sirainen want_mysql=no)
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenAC_ARG_WITH(cyrus-sasl2,
2a6dcd984104fed84bed8795ccdfabb20e41ce52Timo Sirainen[ --with-cyrus-sasl2 Build with Cyrus SASL 2 library support],
2a6dcd984104fed84bed8795ccdfabb20e41ce52Timo Sirainen if test x$withval = xno; then
2a6dcd984104fed84bed8795ccdfabb20e41ce52Timo Sirainen want_cyrus_sasl2=no
2a6dcd984104fed84bed8795ccdfabb20e41ce52Timo Sirainen want_cyrus_sasl2=yes
5da1aa5197a43d83f0fb3eeb83125c7cd73d1b62Timo Sirainen want_cyrus_sasl2=no)
2a6dcd984104fed84bed8795ccdfabb20e41ce52Timo SirainenAC_ARG_WITH(ssl,
2a6dcd984104fed84bed8795ccdfabb20e41ce52Timo Sirainen[ --with-ssl=[gnutls|openssl] Build with GNUTLS (default) or OpenSSL],
2a6dcd984104fed84bed8795ccdfabb20e41ce52Timo Sirainen if test x$withval = xno; then
2a6dcd984104fed84bed8795ccdfabb20e41ce52Timo Sirainen want_gnutls=no
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_openssl=no
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen elif test x$withval = xgnutls; then
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_gnutls=yes
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_openssl=no
5214b67a7dabab87da74e04bb8b227f94b95bce4Timo Sirainen elif test x$withval = xopenssl; then
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_gnutls=no
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_openssl=yes
27586e4785d56aeb76e1fd96af8db799688dc64aTimo Sirainen want_gnutls=yes
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_openssl=yes
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_gnutls=yes
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen want_openssl=yes
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenAC_ARG_WITH(ssldir,
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen[ --with-ssldir=DIR SSL base directory for certificates (/etc/ssl)],
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen ssldir="$withval",
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenAC_SUBST(ssldir)
5da1aa5197a43d83f0fb3eeb83125c7cd73d1b62Timo SirainenAC_ARG_WITH(gc,
e5acc283bf030b0b5c79ca4e52d315c516a299faPascal Volk[ --with-gc Use Boehm garbage collector (currently broken)],
e5acc283bf030b0b5c79ca4e52d315c516a299faPascal Volk if test x$withval = xyes; then
e5acc283bf030b0b5c79ca4e52d315c516a299faPascal Volk if test "x$withval" = xno; then
db8b0a3f74a20528d66a3c4be7df920e5c4554c2Timo SirainenAC_ARG_WITH(pop3d,
db8b0a3f74a20528d66a3c4be7df920e5c4554c2Timo Sirainen[ --with-pop3d Build POP3 server (default)],
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen if test x$withval = xno; then
5666a3d6a7ea89362b8d9e8b39b15424cd9d6388Timo Sirainen want_pop3d=no
1701e3f91107051b1704721bf1dc1e32491faaf9Timo Sirainen want_pop3d=yes
b365bd121cdc87f63e1dd47c5085a27091118e00Timo Sirainen want_pop3d=yes)
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo SirainenAM_CONDITIONAL(BUILD_POP3D, test "$want_pop3d" = "yes")
adb6413686e52e00dded4932babcc08ff041876bTimo SirainenAC_ARG_WITH(storages,
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen[ --with-storages Build specified mail storage formats (maildir,mbox)], [
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen mail_storages=`echo "$withval"|sed 's/,/ /g'` ],
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen mail_storages="maildir mbox")
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo SirainenAC_ARG_WITH(moduledir,
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo Sirainen[ --with-moduledir=DIR Base directory for dynamically loadable modules],
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo Sirainen moduledir="$withval",
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo SirainenAC_SUBST(moduledir)
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo Sirainendnl * gcc specific options
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo Sirainenif test "x$ac_cv_prog_gcc" = "xyes"; then
b365bd121cdc87f63e1dd47c5085a27091118e00Timo Sirainen # -Wcast-qual -Wcast-align -Wconversion # too many warnings
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo Sirainen # -Wstrict-prototypes -Wredundant-decls # may give warnings in some systems
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo Sirainen # -Wmissing-format-attribute -Wmissing-noreturn -Wwrite-strings # a couple of warnings
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo Sirainen CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast"
02e61e13a8360a9d3ec92c5fa5ae60c0f0181b71Timo Sirainendnl ** just some generic stuff...
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo SirainenAC_CHECK_FUNC(socket, [], [
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo Sirainen AC_CHECK_LIB(socket, socket, [
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo Sirainen LIBS="$LIBS -lsocket"
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo SirainenAC_CHECK_FUNC(inet_addr, [], [
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo Sirainen AC_CHECK_LIB(nsl, inet_addr, [
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo Sirainen LIBS="$LIBS -lnsl"
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo SirainenAC_CHECK_FUNC(fdatasync, [
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo Sirainen have_fdatasync=yes
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo Sirainen AC_CHECK_LIB(rt, fdatasync, [
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo Sirainen have_fdatasync=yes
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo Sirainen LIBS="$LIBS -lrt"
b365bd121cdc87f63e1dd47c5085a27091118e00Timo Sirainenif test "$have_fdatasync" = "yes"; then
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen AC_DEFINE(HAVE_FDATASYNC,, Define if you have fdatasync())
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainendnl * after -lsocket and -lnsl tests, inet_aton() may be in them
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenAC_CHECK_FUNCS(fcntl flock lockf inet_aton sigaction getpagesize madvise \
b365bd121cdc87f63e1dd47c5085a27091118e00Timo Sirainen strcasecmp stricmp vsnprintf vsyslog writev pread \
5214b67a7dabab87da74e04bb8b227f94b95bce4Timo Sirainen setrlimit setproctitle)
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenAC_CHECK_FUNC(poll, [
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen AC_DEFINE(IOLOOP_POLL,, Implement I/O loop with poll())
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen AC_DEFINE(IOLOOP_SELECT,, Implement I/O loop with select())
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo Sirainendnl * dnotify?
02e61e13a8360a9d3ec92c5fa5ae60c0f0181b71Timo SirainenAC_TRY_COMPILE([
02e61e13a8360a9d3ec92c5fa5ae60c0f0181b71Timo Sirainen #define _GNU_SOURCE
c58c12049c883b281c088d47a2a7278c21c390e1Timo Sirainen fcntl(0, F_SETSIG, SIGRTMIN);
c58c12049c883b281c088d47a2a7278c21c390e1Timo Sirainen fcntl(0, F_NOTIFY, DN_CREATE | DN_DELETE | DN_RENAME | DN_MULTISHOT);
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo Sirainen AC_DEFINE(IOLOOP_NOTIFY_DNOTIFY,, Use Linux dnotify)
1c1cecd3dfaf71b0c9499b044023e631841e88aaTimo Sirainen AC_DEFINE(IOLOOP_NOTIFY_NONE,, No special notify support)
1c1cecd3dfaf71b0c9499b044023e631841e88aaTimo SirainenAC_TRY_COMPILE([
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen #ifdef __GLIBC__
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo Sirainen we have glibc
c1d19144dd7b1de6822df6ed1d10af0c9cb38840Timo Sirainen AC_DEFINE(PREAD_WRAPPERS,, Define if pread/pwrite needs _XOPEN_SOURCE 500)
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainendnl * OS specific options
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainencase "$host_os" in
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenAC_CHECK_SIZEOF(int)
b365bd121cdc87f63e1dd47c5085a27091118e00Timo SirainenAC_CHECK_SIZEOF(long)
adb6413686e52e00dded4932babcc08ff041876bTimo SirainenAC_CHECK_SIZEOF(void *)
b365bd121cdc87f63e1dd47c5085a27091118e00Timo SirainenAC_CHECK_SIZEOF(long long)
b365bd121cdc87f63e1dd47c5085a27091118e00Timo SirainenAC_DEFUN([AC_TYPEOF], [
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen dnl * first check if we can get the size with redefining typedefs
b365bd121cdc87f63e1dd47c5085a27091118e00Timo Sirainen if test "$2" = ""; then
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen order="int long long-long"
b365bd121cdc87f63e1dd47c5085a27091118e00Timo Sirainen visible="unknown"
94b0ff77495c3ed14bdd4b5d7ae1eb37e8c9efb5Timo Sirainen AC_MSG_CHECKING([type of $1])
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen if test "x$ac_cv_prog_gcc" = "xyes"; then
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen dnl * try with printf() + -Werror
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen old_CFLAGS="$CFLAGS"
b365bd121cdc87f63e1dd47c5085a27091118e00Timo Sirainen CFLAGS="$CFLAGS -Werror"
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen for type in $order; do
adb6413686e52e00dded4932babcc08ff041876bTimo Sirainen case "$type" in
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen unsigned-int)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen unsigned-long)
94d8e51119003d2bc5a100c663f90141f297385dTimo Sirainen unsigned-long-long)
94d8e51119003d2bc5a100c663f90141f297385dTimo Sirainen if test "$fmt" != ""; then
4a514fb20e04df397842cde11cc9ea92abfe9728Timo Sirainen AC_TRY_COMPILE([
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen printf("$fmt", ($1)0);
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen if test "$result" != ""; then
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen dnl * warning check isn't working
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen visible="unknown"
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen result="`echo $type|sed 's/-/ /g'`"
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen visible="$result"
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen CFLAGS="$old_CFLAGS"
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen if test "$result" = ""; then
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen for type in $order; do
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen type="`echo $type|sed 's/-/ /g'`"
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen AC_TRY_COMPILE([
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen typedef $type $1;
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen if test "$result" != ""; then
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen dnl * compiler allows redefining to anything
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen visible="unknown"
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen result="$type"
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen visible="$type"
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen if test "$result" = ""; then
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen dnl * check with sizes
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen dnl * older autoconfs don't include sys/types.h, so do it manually
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen FILE *f=fopen("conftestval", "w");
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen if (!f) exit(1);
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen fprintf(f, "%d\n", sizeof($1));
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen size=`cat conftestval`
636f017be100bce67d66fd3ae1544a47681efd33Timo Sirainen rm -f conftestval
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen for type in $order; do
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen actype="ac_cv_sizeof_`echo $type|sed 's/-/_/g'`"
636f017be100bce67d66fd3ae1544a47681efd33Timo Sirainen if test "$size" = "`eval \"echo \\$$actype\"`"; then
636f017be100bce67d66fd3ae1544a47681efd33Timo Sirainen result="`echo $type|sed 's/-/ /g'`"
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen visible="`expr $size \* 8`bit (using $result)"
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen if test "$result" = ""; then
636f017be100bce67d66fd3ae1544a47681efd33Timo Sirainen visible="`expr $size \* 8`bit (unknown type)"
636f017be100bce67d66fd3ae1544a47681efd33Timo Sirainen typeof_$1=$result
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen AC_MSG_RESULT($visible)
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainendnl * off_t checks, try to make it 64bit
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo SirainenAC_DEFINE_UNQUOTED(_FILE_OFFSET_BITS, $preferred_off_t_bits,
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen [If set to 64, enables 64bit off_t for some systems (eg. Linux, Solaris)])
1c1cecd3dfaf71b0c9499b044023e631841e88aaTimo SirainenAC_TYPEOF(off_t, long int long-long)
1c1cecd3dfaf71b0c9499b044023e631841e88aaTimo Sirainencase "$typeof_off_t" in
1c1cecd3dfaf71b0c9499b044023e631841e88aaTimo Sirainen offt_max=INT_MAX
1c1cecd3dfaf71b0c9499b044023e631841e88aaTimo Sirainen uofft_fmt="u"
1c1cecd3dfaf71b0c9499b044023e631841e88aaTimo Sirainen AC_DEFINE(UOFF_T_INT,, Define if off_t is int)
636f017be100bce67d66fd3ae1544a47681efd33Timo Sirainen offt_bits=`expr 8 \* $ac_cv_sizeof_int`
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen offt_max=LONG_MAX
e4cb3bfcd42f1f2c9e676ece6f7f53803f5c6a16Timo Sirainen uofft_fmt="lu"
0bd259973f98837cf0e41fdee3e2a578e51ad09eTimo Sirainen AC_DEFINE(UOFF_T_LONG,, Define if off_t is long)
0bd259973f98837cf0e41fdee3e2a578e51ad09eTimo Sirainen offt_bits=`expr 8 \* $ac_cv_sizeof_long`
e4cb3bfcd42f1f2c9e676ece6f7f53803f5c6a16Timo Sirainen offt_max=LLONG_MAX
e4cb3bfcd42f1f2c9e676ece6f7f53803f5c6a16Timo Sirainen uofft_fmt="llu"
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen AC_DEFINE(UOFF_T_LONG_LONG,, Define if off_t is long long)
636f017be100bce67d66fd3ae1544a47681efd33Timo Sirainen offt_bits=`expr 8 \* $ac_cv_sizeof_long_long`
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen AC_ERROR([Unsupported off_t type])
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainendnl * Do we have struct dirent->d_type
636f017be100bce67d66fd3ae1544a47681efd33Timo SirainenAC_TRY_COMPILE([
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen struct dirent d;
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen AC_DEFINE(HAVE_DIRENT_D_TYPE,, Define if you have struct dirent->d_type)
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainendnl * Do we have OFF_T_MAX?
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo SirainenAC_TRY_COMPILE([
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen off_t i = OFF_T_MAX;
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen AC_DEFINE_UNQUOTED(OFF_T_MAX, $offt_max, Maximum value of off_t)
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo SirainenAC_DEFINE_UNQUOTED(PRIuUOFF_T, "$uofft_fmt", printf() format for uoff_t)
8f70c97f7ab7b7e1683ed5cfcd96721a899c2520Timo Sirainendnl * make sure size_t isn't signed. we'd probably work fine with it, but
8f70c97f7ab7b7e1683ed5cfcd96721a899c2520Timo Sirainendnl * it's more likely vulnerable to buffer overflows. Anyway, C99 specifies
8f70c97f7ab7b7e1683ed5cfcd96721a899c2520Timo Sirainendnl * that it's unsigned and only some old systems define it as signed.
8f70c97f7ab7b7e1683ed5cfcd96721a899c2520Timo SirainenAC_MSG_CHECKING([whether size_t is signed])
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen /* return 0 if we're signed */
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen exit((size_t)(int)-1 <= 0 ? 0 : 1);
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen AC_MSG_RESULT(yes)
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen echo "Your system's size_t is a signed integer, Dovecot isn't designed to"
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen echo "support it. It probably works just fine, but it's less resistant to"
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen echo "buffer overflows. If you're not worried about this and still want to"
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen echo "compile Dovecot, set ignore_signed_size=1 environment."
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen if test "$ignore_signed_size" = ""; then
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen AC_ERROR([aborting])
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen echo "..ignoring as requested.."
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen AC_MSG_RESULT(no)
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainendnl Note: we check size_t rather than ssize_t here, because on OSX 10.2
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainendnl ssize_t = int and size_t = unsigned long. We're mostly concerned about
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainendnl printf format here, so check the size_t one.
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo SirainenAC_TYPEOF(size_t, unsigned-int unsigned-long unsigned-long-long)
636f017be100bce67d66fd3ae1544a47681efd33Timo Sirainencase "$typeof_size_t" in
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen "unsigned long")
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen ssizet_max=LONG_MAX
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen sizet_fmt="lu"
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen "unsigned long long")
9b00ecffbe74fd864d0d72e6112ec53b86f619baTimo Sirainen ssizet_max=LLONG_MAX
9b00ecffbe74fd864d0d72e6112ec53b86f619baTimo Sirainen sizet_fmt="llu"
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen dnl older systems didn't have ssize_t, default to int
21c7e5bc983075544d8df414edf4cfb2e3c1b91aTimo Sirainen ssizet_max=INT_MAX
0bd259973f98837cf0e41fdee3e2a578e51ad09eTimo Sirainen sizet_fmt="u"
e4cb3bfcd42f1f2c9e676ece6f7f53803f5c6a16Timo Sirainen if test "$typeof_size_t" = ""; then
e4cb3bfcd42f1f2c9e676ece6f7f53803f5c6a16Timo Sirainen AC_DEFINE(size_t, unsigned int, Define to 'unsigned int' if you don't have it)
e4cb3bfcd42f1f2c9e676ece6f7f53803f5c6a16Timo Sirainen AC_DEFINE(ssize_t, int, Define to 'int' if you don't have it)
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo SirainenAC_DEFINE_UNQUOTED(SSIZE_T_MAX, $ssizet_max, Maximum value of ssize_t)
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo SirainenAC_DEFINE_UNQUOTED(PRIuSIZE_T, "$sizet_fmt", printf() format for size_t)
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo SirainenAC_DEFUN([AC_CHECKTYPE2], [
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen AC_MSG_CHECKING([for $1])
1c1cecd3dfaf71b0c9499b044023e631841e88aaTimo Sirainen AC_CACHE_VAL(i_cv_type_$1,
636f017be100bce67d66fd3ae1544a47681efd33Timo Sirainen [AC_TRY_COMPILE([
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen i_cv_type_$1=yes,
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen i_cv_type_$1=no,
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen AC_MSG_RESULT($i_cv_type_$1)
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainendnl some systems don't have stdint.h, but still have some of the types
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainendnl defined elsewhere
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo SirainenAC_CHECK_HEADER(stdint.h, [
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen stdint_include="#include <stdint.h>"
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo SirainenAC_CHECKTYPE2(uintmax_t, [$stdint_include])
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainenif test $i_cv_type_uintmax_t = yes; then
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen AC_DEFINE(HAVE_UINTMAX_T,, Define if you have uintmax_t (C99 type))
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainendnl use separate check, eg. Solaris 8 has uintmax_t but not uint_fast32_t
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo SirainenAC_CHECKTYPE2(uint_fast32_t, [$stdint_include])
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainenif test $i_cv_type_uint_fast32_t = yes; then
dc5606fb66d30a659459446b6ca1a8b4f1146052Timo Sirainen AC_DEFINE(HAVE_UINT_FAST32_T,, Define if you have uint_fast32_t (C99 type))
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo SirainenAC_CHECKTYPE2(socklen_t, [#include <sys/socket.h>])
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainenif test $i_cv_type_socklen_t = yes; then
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen AC_DEFINE(HAVE_SOCKLEN_T,, Define to 'int' if you don't have socklen_t)
2615df45a8027948a474abe5e817b34b0499c171Timo SirainenAC_DEFINE_UNQUOTED(MEM_ALIGN_SIZE, $mem_align, Required memory alignment)
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainendnl * find random source
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_MSG_CHECKING([for /dev/urandom])
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainenif test -c /dev/urandom || test -s /dev/urandom; then
ff7056842f14fd3b30a2d327dfab165b9d15dd30Timo Sirainen AC_MSG_RESULT(yes)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen AC_DEFINE(HAVE_DEV_URANDOM,, Define if you have /dev/urandom)
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainen have_random_source=yes
bd4e36a8cd7257cca7d1434c49a1e343ed7c5100Timo Sirainen AC_MSG_RESULT(no)
bd4e36a8cd7257cca7d1434c49a1e343ed7c5100Timo Sirainen AC_CHECK_HEADER(openssl/rand.h, [
cb933f0a570a9cef5c975eadb818aa6b1002a269Timo Sirainen AC_DEFINE(HAVE_OPENSSL_RAND_H,, Define if you have openssl/rand.h)
cb933f0a570a9cef5c975eadb818aa6b1002a269Timo Sirainen RAND_LIBS=-lcrypto
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_SUBST(RAND_LIBS)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo SirainenAC_CHECK_LIB(crypto, SHA1_Init, [
68a4946b12583b88fa802e52ebee45cd96056772Timo Sirainen AC_CHECK_HEADER(openssl/sha.h, [
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen AC_DEFINE(HAVE_OPENSSL_SHA1,, Define if you have SHA1 in OpenSSL)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen AUTH_LIBS=-lcrypto
c58906589cafc32df4c04ffbef933baadd3f2276Timo Sirainendnl * do we have tm_gmtoff
c58906589cafc32df4c04ffbef933baadd3f2276Timo SirainenAC_MSG_CHECKING([for tm_gmtoff])
c58906589cafc32df4c04ffbef933baadd3f2276Timo SirainenAC_CACHE_VAL(i_cv_field_tm_gmtoff,
c58906589cafc32df4c04ffbef933baadd3f2276Timo Sirainen[AC_TRY_COMPILE([
68a4946b12583b88fa802e52ebee45cd96056772Timo Sirainen[struct tm *tm; return tm->tm_gmtoff;],
c58906589cafc32df4c04ffbef933baadd3f2276Timo Siraineni_cv_field_tm_gmtoff=yes,
c58906589cafc32df4c04ffbef933baadd3f2276Timo Siraineni_cv_field_tm_gmtoff=no,
c58906589cafc32df4c04ffbef933baadd3f2276Timo Sirainenif test $i_cv_field_tm_gmtoff = yes; then
6dd77763f5451269ace733579cf58f2f3b18bca4Timo Sirainen AC_DEFINE(HAVE_TM_GMTOFF,, Define if you have struct tm->tm_gmtoff)
6dd77763f5451269ace733579cf58f2f3b18bca4Timo SirainenAC_MSG_RESULT($i_cv_field_tm_gmtoff)
6dd77763f5451269ace733579cf58f2f3b18bca4Timo Sirainendnl * how large time_t values does gmtime() accept?
6dd77763f5451269ace733579cf58f2f3b18bca4Timo SirainenAC_MSG_CHECKING([how large time_t values gmtime() accepts])
0df9428baed48afaff90b4d4f03792d2fd756a43Timo Sirainen for (bits = 1, t = 1; t > 0; ++bits, t <<= 1) {
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen if (gmtime(&t) == NULL) {
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen f = fopen("conftest.temp", "w");
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen if (f == NULL) {
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen perror("fopen()");
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen fprintf(f, "%d", bits);
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen AC_MSG_RESULT($max_bits)
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen AC_MSG_RESULT([check failed, assuming 31])
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo SirainenAC_DEFINE_UNQUOTED(TIME_T_MAX_BITS, $max_bits, max. time_t bits gmtime() can handle)
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainendnl * do we have struct iovec
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo SirainenAC_MSG_CHECKING([for struct iovec])
d02d34e138e32b4266f5a403d6c51d7803bf322fTimo SirainenAC_CACHE_VAL(i_cv_struct_iovec,
d06c46087e9e6e66bbbbb9df1d5b33154349515cTimo Sirainen[AC_TRY_COMPILE([
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen[struct iovec *iovec;],
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Siraineni_cv_struct_iovec=yes,
47d5cc09738defd0020c797866e2a25a344aa65aTimo Siraineni_cv_struct_iovec=no)])
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainenif test $i_cv_struct_iovec = yes; then
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen AC_DEFINE(HAVE_STRUCT_IOVEC,, Define if you have struct iovec)
47d5cc09738defd0020c797866e2a25a344aa65aTimo SirainenAC_MSG_RESULT($i_cv_struct_iovec)
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainendnl * is dev_t an integer or something else?
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo SirainenAC_TRY_COMPILE([
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Sirainen struct test { dev_t a; };
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Sirainen static struct test t = { 0 };
d02d34e138e32b4266f5a403d6c51d7803bf322fTimo Sirainen AC_DEFINE(DEV_T_STRUCT,, Define if your dev_t is a structure instead of integer type)
d02d34e138e32b4266f5a403d6c51d7803bf322fTimo Sirainen dnl we can't initialize structures, so don't warn about them either
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen if test "x$ac_cv_prog_gcc" = "xyes"; then
e200d1ba38eeebfb0b9e60150d93753ec6d823c8Timo Sirainen CFLAGS=`echo $CFLAGS|sed 's/ -W\b//'`
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainendnl * Do we have RLIMIT_AS?
d06c46087e9e6e66bbbbb9df1d5b33154349515cTimo SirainenAC_TRY_COMPILE([
d06c46087e9e6e66bbbbb9df1d5b33154349515cTimo Sirainen struct rlimit r;
d06c46087e9e6e66bbbbb9df1d5b33154349515cTimo Sirainen getrlimit(RLIMIT_AS, &r);
d06c46087e9e6e66bbbbb9df1d5b33154349515cTimo Sirainen AC_DEFINE(HAVE_RLIMIT_AS,, Define if you have RLIMIT_AS for setrlimit())
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainendnl * Do we have RLIMIT_NPROC?
47d5cc09738defd0020c797866e2a25a344aa65aTimo SirainenAC_TRY_COMPILE([
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen struct rlimit r;
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen getrlimit(RLIMIT_NPROC, &r);
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen AC_DEFINE(HAVE_RLIMIT_NPROC,, Define if you have RLIMIT_NPROC for setrlimit())
490f66d6476d51cc02333d6eb398a5cd94b67f48Timo Sirainendnl * Linux compatible mremap()
490f66d6476d51cc02333d6eb398a5cd94b67f48Timo SirainenAC_MSG_CHECKING([Linux compatible mremap()])
490f66d6476d51cc02333d6eb398a5cd94b67f48Timo SirainenAC_TRY_COMPILE([
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen #define __USE_GNU
490f66d6476d51cc02333d6eb398a5cd94b67f48Timo Sirainen mremap(0, 0, 0, MREMAP_MAYMOVE);
490f66d6476d51cc02333d6eb398a5cd94b67f48Timo Sirainen AC_DEFINE(HAVE_LINUX_MREMAP,, Define if you have Linux-compatible mremap())
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen AC_MSG_RESULT(yes)
93688bfedcfb2b9c02750b8d4d409123a386de5cTimo Sirainen AC_MSG_RESULT(no)
490f66d6476d51cc02333d6eb398a5cd94b67f48Timo Sirainendnl * If mmap() plays nicely with write()
490f66d6476d51cc02333d6eb398a5cd94b67f48Timo SirainenAC_MSG_CHECKING([whether shared mmaps get updated by write()s])
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen /* return 0 if we're signed */
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen int f = open("conftest.mmap", O_RDWR|O_CREAT|O_TRUNC);
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen if (f == -1) {
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen perror("open()");
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Sirainen write(f, "1", 2);
a24519c36d5f8fa22f58b2c693ba547e8d175a54Timo Sirainen mem = mmap(NULL, 2, PROT_READ|PROT_WRITE, MAP_SHARED, f, 0);
e5acc283bf030b0b5c79ca4e52d315c516a299faPascal Volk if (mem == MAP_FAILED) {
e5acc283bf030b0b5c79ca4e52d315c516a299faPascal Volk perror("mmap()");
490f66d6476d51cc02333d6eb398a5cd94b67f48Timo Sirainen strcpy(mem, "2");
490f66d6476d51cc02333d6eb398a5cd94b67f48Timo Sirainen msync(mem, 2, MS_SYNC);
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen lseek(f, 0, SEEK_SET);
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen write(f, "3", 2);
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen return strcmp(mem, "3") == 0 ? 0 : 1;
17cf149e5f47183bfcc1503649dfb92a14f9dcd9Timo Sirainen AC_MSG_RESULT(yes)
e5aa8d4c9bdda79c2db03391ec45b37bf774df14Timo Sirainen AC_MSG_RESULT(no)
17cf149e5f47183bfcc1503649dfb92a14f9dcd9Timo Sirainen AC_DEFINE(MMAP_CONFLICTS_WRITE,, [Define if shared mmaps don't get updated by write()s])
e5aa8d4c9bdda79c2db03391ec45b37bf774df14Timo Sirainendnl * Solaris compatible sendfile()
e5aa8d4c9bdda79c2db03391ec45b37bf774df14Timo SirainenAC_CHECK_LIB(sendfile, sendfile, [
490f66d6476d51cc02333d6eb398a5cd94b67f48Timo Sirainen LIBS="$LIBS -lsendfile"
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen AC_DEFINE(HAVE_SOLARIS_SENDFILE,, Define if you have Solaris-compatible sendfile())
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen dnl * Linux compatible sendfile() - don't check if Solaris one was found.
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen dnl * This seems to pass with Solaris for some reason..
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen AC_MSG_CHECKING([Linux compatible sendfile()])
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen AC_TRY_COMPILE([
47d5cc09738defd0020c797866e2a25a344aa65aTimo Sirainen #undef _FILE_OFFSET_BITS
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen sendfile(0, 0, (void *) 0, 0);
4b8a6aec5fe2daa564799867f31e39e7ea46b9c3Timo Sirainen AC_DEFINE(HAVE_LINUX_SENDFILE,, Define if you have Linux-compatible sendfile())
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_MSG_RESULT(yes)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_MSG_RESULT(no)
4b8a6aec5fe2daa564799867f31e39e7ea46b9c3Timo Sirainen dnl * FreeBSD compatible sendfile()
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_MSG_CHECKING([FreeBSD compatible sendfile()])
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_TRY_COMPILE([
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen struct sf_hdtr hdtr;
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen sendfile(0, 0, 0, 0, &hdtr, (void *) 0, 0);
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_DEFINE(HAVE_FREEBSD_SENDFILE,, Define if you have FreeBSD-compatible sendfile())
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_MSG_RESULT(yes)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_MSG_RESULT(no)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainendnl *** va_copy checks (from GLIB)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo SirainenAC_CACHE_CHECK([for an implementation of va_copy()],lib_cv_va_copy,[
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen void f (int i, ...) {
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen va_list args1, args2;
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen va_start (args1, i);
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen va_copy (args2, args1);
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen va_end (args1); va_end (args2);
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen [lib_cv_va_copy=yes],
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen [lib_cv_va_copy=no],
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo SirainenAC_CACHE_CHECK([for an implementation of __va_copy()],lib_cv___va_copy,[
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen void f (int i, ...) {
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen va_list args1, args2;
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen va_start (args1, i);
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen __va_copy (args2, args1);
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen va_end (args1); va_end (args2);
be110f0a3888a24282f06820ec0b5068d2b8f906Timo Sirainen [lib_cv___va_copy=yes],
4b8a6aec5fe2daa564799867f31e39e7ea46b9c3Timo Sirainen [lib_cv___va_copy=no],
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainenif test "x$lib_cv_va_copy" = "xyes"; then
e5aa8d4c9bdda79c2db03391ec45b37bf774df14Timo Sirainen va_copy_func=va_copy
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainenelse if test "x$lib_cv___va_copy" = "xyes"; then
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen va_copy_func=__va_copy
318ef3683d67683173f1b552cf5f9af4375b3017Timo Sirainenif test -n "$va_copy_func"; then
318ef3683d67683173f1b552cf5f9af4375b3017Timo Sirainen AC_DEFINE_UNQUOTED(VA_COPY,$va_copy_func,[A 'va_copy' style function])
318ef3683d67683173f1b552cf5f9af4375b3017Timo SirainenAC_CACHE_CHECK([whether va_lists can be copied by value],lib_cv_va_val_copy,[
318ef3683d67683173f1b552cf5f9af4375b3017Timo Sirainen void f (int i, ...) {
318ef3683d67683173f1b552cf5f9af4375b3017Timo Sirainen va_list args1, args2;
e5aa8d4c9bdda79c2db03391ec45b37bf774df14Timo Sirainen va_start (args1, i);
e5aa8d4c9bdda79c2db03391ec45b37bf774df14Timo Sirainen args2 = args1;
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen va_end (args1); va_end (args2);
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen [lib_cv_va_val_copy=yes],
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen [lib_cv_va_val_copy=no],
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainenif test "x$lib_cv_va_val_copy" = "xno"; then
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_DEFINE(VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
4b8a6aec5fe2daa564799867f31e39e7ea46b9c3Timo Sirainenif test "$want_openssl" = "yes" && test "$have_ssl" = "no"; then
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen if pkg-config --exists openssl; then
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen PKG_CHECK_MODULES(SSL, openssl)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen CFLAGS="$CFLAGS $SSL_CFLAGS"
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen have_openssl=yes
4b8a6aec5fe2daa564799867f31e39e7ea46b9c3Timo Sirainen AC_CHECK_LIB(ssl, SSL_read, [
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h, [
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen SSL_LIBS="-lssl -lcrypto"
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_SUBST(SSL_LIBS)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen have_openssl=yes
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen ],, -lcrypto)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen if test "$have_openssl" = "yes"; then
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_DEFINE(HAVE_OPENSSL,, Build with OpenSSL support)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen have_ssl="yes (OpenSSL)"
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainenif test $want_gnutls = yes && test "$have_ssl" = no; then
4b8a6aec5fe2daa564799867f31e39e7ea46b9c3Timo Sirainen AC_CHECK_LIB(gnutls, gnutls_global_init, [
4b8a6aec5fe2daa564799867f31e39e7ea46b9c3Timo Sirainen AC_CHECK_HEADERS(gnutls/gnutls.h, [
4b8a6aec5fe2daa564799867f31e39e7ea46b9c3Timo Sirainen AC_DEFINE(HAVE_GNUTLS,, Build with GNUTLS support)
4b8a6aec5fe2daa564799867f31e39e7ea46b9c3Timo Sirainen SSL_LIBS="-lgnutls -lgcrypt"
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen AC_SUBST(SSL_LIBS)
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen have_ssl="yes (GNUTLS)"
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen have_gnutls=yes
0b4e1043e596bfb36d999dacbf1d4d63ee96d75fTimo Sirainen ],, -lgcrypt)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainenif test "$have_ssl" != "no"; then
6d931bbce16786df431e9ae8201a78a95084316dTimo Sirainen AC_DEFINE(HAVE_SSL,, Build with SSL/TLS support)
6d931bbce16786df431e9ae8201a78a95084316dTimo Sirainendnl ** Garbage Collector
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainenif test "$want_gc" = "yes"; then
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen AC_CHECK_LIB(gc, GC_malloc, [
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen AC_DEFINE(USE_GC,, Define if you want to use Boehm GC)
6d931bbce16786df431e9ae8201a78a95084316dTimo Sirainen LIBS="$LIBS -lgc"
1c885b304f060e3ac4fe04195a2f53457d0ac99eTimo Sirainendnl ** userdb and passdb checks
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainenif test $want_static_userdb = yes; then
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen need_crypt=yes
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen AC_DEFINE(USERDB_STATIC,, Build with static userdb support)
6b067886457724ca13d81e869240500c5bd5d7e2Timo Sirainen userdb="$userdb static"
6b067886457724ca13d81e869240500c5bd5d7e2Timo Sirainenif test $want_passwd = yes; then
6b067886457724ca13d81e869240500c5bd5d7e2Timo Sirainen need_crypt=yes
1c1cecd3dfaf71b0c9499b044023e631841e88aaTimo Sirainen AC_DEFINE(USERDB_PASSWD,, Build with passwd support)
6b067886457724ca13d81e869240500c5bd5d7e2Timo Sirainen AC_DEFINE(PASSDB_PASSWD,, Build with passwd support)
6b067886457724ca13d81e869240500c5bd5d7e2Timo Sirainen userdb="$userdb passwd"
6b067886457724ca13d81e869240500c5bd5d7e2Timo Sirainen passdb="$passdb passwd"
1c1cecd3dfaf71b0c9499b044023e631841e88aaTimo Sirainenif test $want_passwd_file = yes; then
e28fa207d1a097fa6e4a867f74ee0761472ef1ceTimo Sirainen need_crypt=yes
e28fa207d1a097fa6e4a867f74ee0761472ef1ceTimo Sirainen AC_DEFINE(USERDB_PASSWD_FILE,, Build with passwd-file support)
e28fa207d1a097fa6e4a867f74ee0761472ef1ceTimo Sirainen AC_DEFINE(PASSDB_PASSWD_FILE,, Build with passwd-file support)
e28fa207d1a097fa6e4a867f74ee0761472ef1ceTimo Sirainen userdb="$userdb passwd-file"
e28fa207d1a097fa6e4a867f74ee0761472ef1ceTimo Sirainen passdb="$passdb passwd-file"
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainenif test $want_shadow = yes; then
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen AC_CHECK_FUNC(getspnam, [
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen AC_CHECK_HEADER(shadow.h, [
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen need_crypt=yes
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen AC_DEFINE(PASSDB_SHADOW,, Build with shadow support)
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen passdb="$passdb shadow"
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainenif test $want_pam = yes; then
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen AC_CHECK_LIB(pam, pam_start, [
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen AC_CHECK_HEADER(security/pam_appl.h, [
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen AC_DEFINE(HAVE_SECURITY_PAM_APPL_H,,
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen Define if you have security/pam_appl.h)
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen AC_CHECK_HEADER(pam/pam_appl.h, [
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen AC_DEFINE(HAVE_PAM_PAM_APPL_H,,
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen Define if you have pam/pam_appl.h)
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen if test "$have_pam" = "yes"; then
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen AUTH_LIBS="$AUTH_LIBS -lpam"
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen AC_DEFINE(PASSDB_PAM,, Build with PAM support)
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen passdb="$passdb pam"
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen AC_CHECK_LIB(pam, pam_setcred, [
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen AC_DEFINE(HAVE_PAM_SETCRED,,
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen Define if you have pam_setcred())
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainenif test $want_bsdauth = yes; then
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen AC_CHECK_FUNC(auth_userokay, [
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen AC_DEFINE(PASSDB_BSDAUTH,, Build with BSD authentication support)
5da1aa5197a43d83f0fb3eeb83125c7cd73d1b62Timo Sirainen passdb="$passdb bsdauth"
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainenif test $want_ldap = yes; then
e0ca8f2484847b57e20798a9f9c7040708696a90Timo Sirainen AC_CHECK_LIB(ldap, ldap_init, [
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen AC_CHECK_HEADER(ldap.h, [
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen AUTH_LIBS="$AUTH_LIBS -lldap"
c040ee67d0ac0fb7375bb543965bf67dcae6affaTimo Sirainen AC_DEFINE(USERDB_LDAP,, Build with LDAP support)
c040ee67d0ac0fb7375bb543965bf67dcae6affaTimo Sirainen AC_DEFINE(PASSDB_LDAP,, Build with LDAP support)
c040ee67d0ac0fb7375bb543965bf67dcae6affaTimo Sirainen userdb="$userdb ldap"
c040ee67d0ac0fb7375bb543965bf67dcae6affaTimo Sirainen passdb="$passdb ldap"
533bfba437e4120aa29dd45bca2aa87e30ee28a2Timo Sirainenif test $want_pgsql = yes; then
5fb3bff645380804c9db2510940c41db6b8fdb01Timo Sirainen # based on code from PHP
533bfba437e4120aa29dd45bca2aa87e30ee28a2Timo Sirainen for j in include include/pgsql include/postgres include/postgresql ""; do
5160580b0ec3f3288a320987abdf12a990f09df5Timo Sirainen if test -r "$i/$j/libpq-fe.h"; then
5160580b0ec3f3288a320987abdf12a990f09df5Timo Sirainen PGSQL_INCLUDE=$i/$j
533bfba437e4120aa29dd45bca2aa87e30ee28a2Timo Sirainen for j in lib lib/pgsql lib/postgres lib/postgresql ""; do
5160580b0ec3f3288a320987abdf12a990f09df5Timo Sirainen if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then
533bfba437e4120aa29dd45bca2aa87e30ee28a2Timo Sirainen PGSQL_LIBDIR=$i/$j
9b2bbd89073e5b78f3f39a19f3f8d7c6d03bbd4cTimo Sirainen old_LIBS=$LIBS
9b2bbd89073e5b78f3f39a19f3f8d7c6d03bbd4cTimo Sirainen if test "$PGSQL_LIBDIR" != ""; then
9b2bbd89073e5b78f3f39a19f3f8d7c6d03bbd4cTimo Sirainen LIBS="$LIBS -L$PGSQL_LIBDIR"
9b2bbd89073e5b78f3f39a19f3f8d7c6d03bbd4cTimo Sirainen AC_CHECK_LIB(pq, PQconnectdb, [
9b2bbd89073e5b78f3f39a19f3f8d7c6d03bbd4cTimo Sirainen old_CPPFLAGS=$CPPFLAGS
9b2bbd89073e5b78f3f39a19f3f8d7c6d03bbd4cTimo Sirainen if test "$PGSQL_INCLUDE" != ""; then
9b2bbd89073e5b78f3f39a19f3f8d7c6d03bbd4cTimo Sirainen CPPFLAGS="$CPPFLAGS -I $PGSQL_INCLUDE"
9b2bbd89073e5b78f3f39a19f3f8d7c6d03bbd4cTimo Sirainen AC_CHECK_HEADER(libpq-fe.h, [
9b2bbd89073e5b78f3f39a19f3f8d7c6d03bbd4cTimo Sirainen if test "$PGSQL_INCLUDE" != ""; then
9b2bbd89073e5b78f3f39a19f3f8d7c6d03bbd4cTimo Sirainen AUTH_CFLAGS="$AUTH_CFLAGS -I$PGSQL_INCLUDE"
1c885b304f060e3ac4fe04195a2f53457d0ac99eTimo Sirainen if test "$PGSQL_LIBDIR" != ""; then
1c885b304f060e3ac4fe04195a2f53457d0ac99eTimo Sirainen AUTH_LIBS="$AUTH_LIBS -L$PGSQL_LIBDIR"
f7ee94201b23b4bd5764cb85cb51d5c995e475ecTimo Sirainen AUTH_LIBS="$AUTH_LIBS -lpq"
b6eced3d628ad0c50a3cbc9f966da0edc20108abTimo Sirainen AC_DEFINE(USERDB_PGSQL,, Build with PostgreSQL support)
1c885b304f060e3ac4fe04195a2f53457d0ac99eTimo Sirainen AC_DEFINE(PASSDB_PGSQL,, Build with PostgreSQL support)
688d869f3449827ac9b5a0a02dbc1b27177b6d20Timo Sirainen userdb="$userdb pgsql"
688d869f3449827ac9b5a0a02dbc1b27177b6d20Timo Sirainen passdb="$passdb pgsql"
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen CPPFLAGS=$old_CPPFLAGS
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen LIBS=$old_LIBS
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainenif test $want_mysql = yes; then
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen AC_CHECK_LIB(mysqlclient, mysql_init, [
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen AC_CHECK_HEADER(mysql.h,, [
7cf1c7dd3dfd989cba1ed32a8e17c1b031c4629bTimo Sirainen AC_CHECK_HEADER(mysql/mysql.h, [
7cf1c7dd3dfd989cba1ed32a8e17c1b031c4629bTimo Sirainen AUTH_CFLAGS="$AUTH_CFLAGS -DHAVE_MYSQL_MYSQL_H"
7cf1c7dd3dfd989cba1ed32a8e17c1b031c4629bTimo Sirainen ], want_mysql = no)
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen ], want_mysql = no)
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen if test $want_mysql = yes; then
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen AUTH_LIBS="$AUTH_LIBS -lmysqlclient"
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen AC_DEFINE(USERDB_MYSQL,, Build with MySQL support)
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen AC_DEFINE(PASSDB_MYSQL,, Build with MySQL support)
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen userdb="$userdb mysql"
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen passdb="$passdb mysql"
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainenif test $want_vpopmail = yes; then
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen vpopmail_home="`echo ~vpopmail`"
9ba91492d2eb29199674b669c673332ae2b01438Timo Sirainen AC_MSG_CHECKING([for vpopmail configuration at $vpop_libdeps])
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen if test -f $vpop_libdeps; then
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen need_crypt=yes
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen AUTH_CFLAGS="$AUTH_CFLAGS `cat $vpopmail_home/etc/inc_deps` $CFLAGS"
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen AUTH_LIBS="$AUTH_LIBS `cat $vpop_libdeps`"
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen AC_DEFINE(USERDB_VPOPMAIL,, Build with vpopmail support)
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen AC_DEFINE(PASSDB_VPOPMAIL,, Build with vpopmail support)
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen userdb="$userdb vpopmail"
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen passdb="$passdb vpopmail"
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen AC_MSG_RESULT(found)
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen want_vpopmail=no
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen AC_MSG_RESULT(not found)
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainenif test $want_cyrus_sasl2 = yes; then
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen AC_CHECK_LIB(sasl2, sasl_server_start, [
ba36444cdf332c75ecdd2696e34c391eea75597cTimo Sirainen AC_CHECK_HEADER(sasl/sasl.h, [
1c885b304f060e3ac4fe04195a2f53457d0ac99eTimo Sirainen AC_DEFINE(USE_CYRUS_SASL2,,
b6eced3d628ad0c50a3cbc9f966da0edc20108abTimo Sirainen Define if you want to use Cyrus SASL library)
f7ee94201b23b4bd5764cb85cb51d5c995e475ecTimo Sirainen AUTH_LIBS="$AUTH_LIBS -lsasl2"
f7ee94201b23b4bd5764cb85cb51d5c995e475ecTimo Sirainenif test $need_crypt = yes; then
f7ee94201b23b4bd5764cb85cb51d5c995e475ecTimo Sirainen AC_CHECK_LIB(crypt, crypt, [
f7ee94201b23b4bd5764cb85cb51d5c995e475ecTimo Sirainen AUTH_LIBS="-lcrypt $AUTH_LIBS"
b6eced3d628ad0c50a3cbc9f966da0edc20108abTimo Sirainen AC_CHECK_FUNC(crypt,, [
b6eced3d628ad0c50a3cbc9f966da0edc20108abTimo Sirainen AC_ERROR([crypt() wasn't found])
dca6d617a23e3f93af3b8df59acb46478179fe55Timo Sirainendnl * dynamic modules?
f7ee94201b23b4bd5764cb85cb51d5c995e475ecTimo Sirainenhave_modules=no
f7ee94201b23b4bd5764cb85cb51d5c995e475ecTimo SirainenAC_CHECK_FUNC(dlopen, [
b6eced3d628ad0c50a3cbc9f966da0edc20108abTimo Sirainen have_modules=yes
dca6d617a23e3f93af3b8df59acb46478179fe55Timo Sirainen MODULE_LIBS="-export-dynamic"
eb64c3586d854cddd693f0b811d897399076a441Timo Sirainen AC_CHECK_LIB(dl, dlopen, [
e22efc90e109ade2936eea0b062a99480310fd41Timo Sirainen have_modules=yes
e22efc90e109ade2936eea0b062a99480310fd41Timo Sirainen MODULE_LIBS="-export-dynamic -ldl"
e22efc90e109ade2936eea0b062a99480310fd41Timo Sirainenif test $have_modules = yes; then
e22efc90e109ade2936eea0b062a99480310fd41Timo Sirainen AC_DEFINE(HAVE_MODULES,, Define if you have dynamic module support)
e22efc90e109ade2936eea0b062a99480310fd41Timo Sirainen userdb="$userdb (modules)"
e22efc90e109ade2936eea0b062a99480310fd41Timo Sirainen passdb="$passdb (modules)"
dca6d617a23e3f93af3b8df59acb46478179fe55Timo Sirainen AC_SUBST(MODULE_LIBS)
1c885b304f060e3ac4fe04195a2f53457d0ac99eTimo SirainenAC_SUBST(AUTH_CFLAGS)
78bb4a443b4ca97ce27976916953e4898aa8a125Timo SirainenAC_SUBST(AUTH_LIBS)
e5aa8d4c9bdda79c2db03391ec45b37bf774df14Timo Sirainendnl ** Index file compatibility flags
78bb4a443b4ca97ce27976916953e4898aa8a125Timo Sirainendnl * currently just checking for endianess
78bb4a443b4ca97ce27976916953e4898aa8a125Timo SirainenAC_C_BIGENDIAN
78bb4a443b4ca97ce27976916953e4898aa8a125Timo Sirainenif test $ac_cv_c_bigendian = yes; then
32f4b9ab23148bec295196a8029a43ff89ce124dTimo SirainenAC_DEFINE_UNQUOTED(MAIL_INDEX_COMPAT_FLAGS, $flags, Index file compatibility flags)
e5aa8d4c9bdda79c2db03391ec45b37bf774df14Timo Sirainendnl ** IPv6 support
78bb4a443b4ca97ce27976916953e4898aa8a125Timo Sirainenif test "x$want_ipv6" = "xyes"; then
78bb4a443b4ca97ce27976916953e4898aa8a125Timo Sirainen AC_MSG_CHECKING([for IPv6])
37847ec8eaec9ad55c9df10ae109efe7b37ac573Timo Sirainen AC_CACHE_VAL(i_cv_type_in6_addr,
37847ec8eaec9ad55c9df10ae109efe7b37ac573Timo Sirainen [AC_TRY_COMPILE([
3fe67ec75ccae1230bb9eb9f16affc48377f6441Timo Sirainen [struct in6_addr i;],
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainen i_cv_type_in6_addr=yes,
37847ec8eaec9ad55c9df10ae109efe7b37ac573Timo Sirainen i_cv_type_in6_addr=no,
4d84348ffcbb60de566108562c95ad64629e7a53Timo Sirainen if test $i_cv_type_in6_addr = yes; then
4d84348ffcbb60de566108562c95ad64629e7a53Timo Sirainen AC_DEFINE(HAVE_IPV6,, Build with IPv6 support)
4d84348ffcbb60de566108562c95ad64629e7a53Timo Sirainen AC_MSG_RESULT($i_cv_type_in6_addr)
3fe67ec75ccae1230bb9eb9f16affc48377f6441Timo Sirainendnl ** storage classes
37847ec8eaec9ad55c9df10ae109efe7b37ac573Timo Sirainenmaildir_libs="../lib-storage/index/maildir/libstorage_maildir.a"
3fe67ec75ccae1230bb9eb9f16affc48377f6441Timo Sirainenmbox_libs="../lib-storage/index/mbox/libstorage_mbox.a"
37847ec8eaec9ad55c9df10ae109efe7b37ac573Timo Sirainenindex_libs="../lib-storage/index/libstorage_index.a ../lib-index/libindex.a"
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainenfor storage in $mail_storages; do
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainen STORAGE_LIBS="$STORAGE_LIBS `eval \"echo \\$${storage}_libs\"`"
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo SirainenSTORAGE_LIBS="$STORAGE_LIBS $index_libs"
5a0fc34c5cc525334c5a10531713017ae321c573Timo SirainenAC_SUBST(STORAGE_LIBS)
b13f738e8eb3f24dc2abf2c804f954b4d864ac6fTimo Sirainendnl ** capabilities
37847ec8eaec9ad55c9df10ae109efe7b37ac573Timo Sirainencapability="IMAP4rev1 SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN LISTEXT NAMESPACE"
37847ec8eaec9ad55c9df10ae109efe7b37ac573Timo SirainenAC_DEFINE_UNQUOTED(CAPABILITY_STRING, "$capability", IMAP capabilities)
37847ec8eaec9ad55c9df10ae109efe7b37ac573Timo SirainenCFLAGS="$CFLAGS $EXTRA_CFLAGS"
0b25846ba794ce19536a24d4065beaf2a0bd9464Timo Sirainendnl ** register the storage classes
0b25846ba794ce19536a24d4065beaf2a0bd9464Timo Sirainendnl * do it after AC_OUTPUT(), so we know that the directory exists.
0b25846ba794ce19536a24d4065beaf2a0bd9464Timo Sirainendnl * it doesn't when building in different directory
0b25846ba794ce19536a24d4065beaf2a0bd9464Timo Sirainenfile="src/lib-storage/register/mail-storage-register.c"
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainenecho "/* this file is generated by configure */" > $file
0185427dd52fddec6fc76d6e99c7659620d4366eTimo Sirainenecho '#include "lib.h"' >> $file
9c66dd5c3e2ba484a5c7cdb98a139bda31fdfaa4Timo Sirainenecho '#include "mail-storage.h"' >> $file
6bc5fed79741503437c6d46d9f282b66bd029c6bTimo Sirainenfor storage in $mail_storages; do
9c66dd5c3e2ba484a5c7cdb98a139bda31fdfaa4Timo Sirainen echo "extern struct mail_storage ${storage}_storage;" >> $file
6bc5fed79741503437c6d46d9f282b66bd029c6bTimo Sirainenecho "void mail_storage_register_all(void) {" >> $file
6bc5fed79741503437c6d46d9f282b66bd029c6bTimo Sirainenfor storage in $mail_storages; do
37847ec8eaec9ad55c9df10ae109efe7b37ac573Timo Sirainen echo "mail_storage_class_register(&${storage}_storage);" >> $file
78bb4a443b4ca97ce27976916953e4898aa8a125Timo Sirainenecho "}" >> $file
3fe67ec75ccae1230bb9eb9f16affc48377f6441Timo Sirainenecho "Install prefix ...................... : $prefix"
3fe67ec75ccae1230bb9eb9f16affc48377f6441Timo Sirainenecho "File offsets ........................ : ${offt_bits}bit"
5a0b68eeaf48cd1655057f36f19357146bf08e1dTimo Sirainenecho "Building with SSL support ........... : $have_ssl"
3fe67ec75ccae1230bb9eb9f16affc48377f6441Timo Sirainenecho "Building with IPv6 support .......... : $want_ipv6"
5a0b68eeaf48cd1655057f36f19357146bf08e1dTimo Sirainenecho "Building with pop3 server ........... : $want_pop3d"
5a0b68eeaf48cd1655057f36f19357146bf08e1dTimo Sirainenecho "Building with user database modules . :$userdb"
a27e065f1a1f91c7fbdf7c2ea1c387441af0cbb3Timo Sirainenecho "Building with password lookup modules :$passdb"