configure.in revision 67950e1843bd879bab73d8752ee54f60bbd21987
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo SirainenAC_INIT(src)
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo Sirainen
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo SirainenAM_CONFIG_HEADER(config.h)
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo SirainenAM_INIT_AUTOMAKE(dovecot, 0.98.4)
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo SirainenAM_MAINTAINER_MODE
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo SirainenAC_ISC_POSIX
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo SirainenAC_PROG_CC
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo SirainenAC_PROG_CPP
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo SirainenAC_STDC_HEADERS
86bdb644d147a73df85abce4325254d694217a5fTimo SirainenAC_C_INLINE
86bdb644d147a73df85abce4325254d694217a5fTimo SirainenAC_ARG_PROGRAM
86bdb644d147a73df85abce4325254d694217a5fTimo SirainenAM_PROG_LIBTOOL
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo Sirainen
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo SirainenAC_CHECK_HEADERS(string.h stdlib.h unistd.h dirent.h)
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo SirainenAC_CHECK_HEADERS(sys/uio.h linux/mman.h)
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo Sirainen
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo Sirainen# check posix headers
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo SirainenAC_CHECK_HEADERS(sys/time.h)
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo Sirainen
f6ae9ae80a1fcf6c8f45ab759f0074caaa66c9c8Timo SirainenAC_ARG_ENABLE(ipv6,
f6ae9ae80a1fcf6c8f45ab759f0074caaa66c9c8Timo Sirainen[ --enable-ipv6 Enable IPv6 support (default)],
f6ae9ae80a1fcf6c8f45ab759f0074caaa66c9c8Timo Sirainen if test x$enableval = xno; then
f6ae9ae80a1fcf6c8f45ab759f0074caaa66c9c8Timo Sirainen want_ipv6=no
f6ae9ae80a1fcf6c8f45ab759f0074caaa66c9c8Timo Sirainen else
f6ae9ae80a1fcf6c8f45ab759f0074caaa66c9c8Timo Sirainen want_ipv6=yes
f6ae9ae80a1fcf6c8f45ab759f0074caaa66c9c8Timo Sirainen fi,
86bdb644d147a73df85abce4325254d694217a5fTimo Sirainen want_ipv6=yes)
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen
f6ae9ae80a1fcf6c8f45ab759f0074caaa66c9c8Timo SirainenAC_ARG_ENABLE(debug,
f6ae9ae80a1fcf6c8f45ab759f0074caaa66c9c8Timo Sirainen[ --enable-debug Enable some extra checks for debugging],
f6ae9ae80a1fcf6c8f45ab759f0074caaa66c9c8Timo Sirainen if test x$enableval = xyes; then
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo Sirainen AC_DEFINE(DEBUG)
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo Sirainen fi)
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo SirainenAC_ARG_WITH(file-offset-size,
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen[ --with-file-offset-size=BITS Set size of file offsets. Usually 32 or 64.
ae9691f7ef36d5272d72c90fa51393dfea5dd126Timo Sirainen (default: 64 if available)],
2eccb2637d0153bb7f9ad39a70f254cece74342cTimo Sirainen preferred_off_t_bits=$withval,
2eccb2637d0153bb7f9ad39a70f254cece74342cTimo Sirainen preferred_off_t_bits=64)
2eccb2637d0153bb7f9ad39a70f254cece74342cTimo Sirainen
7877db7b5daad125b6cb3e015574f33871c9a51bTimo SirainenAC_ARG_WITH(mem-align,
7877db7b5daad125b6cb3e015574f33871c9a51bTimo Sirainen[ --with-mem-align=BYTES Set the memory alignment (default: 8)],
7877db7b5daad125b6cb3e015574f33871c9a51bTimo Sirainen mem_align=$withval,
7877db7b5daad125b6cb3e015574f33871c9a51bTimo Sirainen mem_align=8)
7877db7b5daad125b6cb3e015574f33871c9a51bTimo Sirainen
7877db7b5daad125b6cb3e015574f33871c9a51bTimo SirainenAC_ARG_WITH(passwd,
10972f2a15f5538860fcc1d4adda227d59d2d757Timo Sirainen[ --with-passwd Build with /etc/passwd support (default)],
4ca2ccd50ad25260865f561e4ebf36899d7fe966Timo Sirainen if test x$withval = xno; then
bb869cc24b24a8df84a43154c628785d6aee784cTimo Sirainen want_passwd=no
bb869cc24b24a8df84a43154c628785d6aee784cTimo Sirainen else
662bb64be818407c6719a69780411f7ca8d6c96fAki Tuomi want_passwd=yes
4ca2ccd50ad25260865f561e4ebf36899d7fe966Timo Sirainen fi,
e0ba54c7f985fc403b41c6e36d6a7f44908b23f0Timo Sirainen want_passwd=yes)
AC_ARG_WITH(passwd-file,
[ --with-passwd-file Build with passwd-like file support (default)],
if test x$withval = xno; then
want_passwd_file=no
else
want_passwd_file=yes
fi,
want_passwd_file=yes)
AC_ARG_WITH(shadow,
[ --with-shadow Build with shadow password support (default)],
if test x$withval = xno; then
want_shadow=no
else
want_shadow=yes
fi,
want_shadow=yes)
AC_ARG_WITH(pam,
[ --with-pam Build with PAM support (default)],
if test x$withval = xno; then
want_pam=no
else
want_pam=yes
fi,
want_pam=yes)
AC_ARG_WITH(vpopmail,
[ --with-vpopmail Build with vpopmail support (default)],
if test x$withval = xno; then
want_vpopmail=no
else
want_vpopmail=yes
fi,
want_vpopmail=yes)
AC_ARG_WITH(gnutls,
[ --with-gnutls Build with GNUTLS (default)],
if test x$withval = xno; then
want_gnutls=no
else
want_gnutls=yes
fi,
want_gnutls=yes)
dnl **
dnl ** just some generic stuff...
dnl **
AC_CHECK_FUNC(socket, [], [
AC_CHECK_LIB(socket, socket, [
LIBS="$LIBS -lsocket"
])
])
AC_CHECK_FUNC(inet_addr, [], [
AC_CHECK_LIB(nsl, inet_addr, [
LIBS="$LIBS -lnsl"
])
])
AC_CHECK_FUNC(fdatasync, [
AC_DEFINE([HAVE_FDATASYNC])
], [
AC_CHECK_LIB(rt, fdatasync, [
AC_DEFINE([HAVE_FDATASYNC])
LIBS="$LIBS -lrt"
])
])
dnl * after -lsocket and -lnsl tests, inet_aton() may be in them
AC_CHECK_FUNCS(fcntl flock inet_aton sigaction getpagesize madvise setreuid)
AC_CHECK_FUNCS(strcasecmp stricmp vsnprintf memmove vsyslog writev)
dnl * poll/select?
AC_CHECK_FUNC(poll, [
have_poll=yes
], [
have_poll=no
])
AM_CONDITIONAL(IOLOOP_POLL, test "$have_poll" = "yes")
dnl * gcc specific options
if test "x$ac_cv_prog_gcc" = "xyes"; then
# -Wchar-subscripts -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
CFLAGS="$CFLAGS -Wall -W"
fi
dnl * OS specific options
case "$host_os" in
hpux*)
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
;;
*)
;;
esac
dnl * off_t checks, try to make it 64bit
AC_DEFINE_UNQUOTED(_FILE_OFFSET_BITS, $preferred_off_t_bits)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long long)
dnl * older autoconfs don't include sys/types.h, so do it manually
AC_MSG_CHECKING([size of ssize_t])
AC_TRY_RUN([
#include <stdio.h>
#include <sys/types.h>
int main() {
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%d\n", sizeof(ssize_t));
exit(0);
}
], [
sizeof_ssize_t=`cat conftestval`
rm -f conftestval
], [
sizeof_ssize_t=0
AC_ERROR([Unsupported ssize_t size])
])
AC_MSG_RESULT($sizeof_ssize_t)
AC_MSG_CHECKING([size of off_t])
AC_TRY_RUN([
#include <stdio.h>
#include <sys/types.h>
int main() {
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%d\n", sizeof(off_t));
exit(0);
}
], [
sizeof_off_t=`cat conftestval`
rm -f conftestval
], [
sizeof_off_t=0
AC_ERROR([Unsupported off_t size])
])
AC_MSG_RESULT($sizeof_off_t)
if test x$sizeof_off_t = x$ac_cv_sizeof_long; then
# try to use unsigned long always first
AC_DEFINE_UNQUOTED(OFF_T_MAX, LONG_MAX)
AC_DEFINE_UNQUOTED(PRIuUOFF_T, "lu")
AC_DEFINE(UOFF_T_LONG)
elif test x$sizeof_off_t = x$ac_cv_sizeof_int; then
# next try int
AC_DEFINE_UNQUOTED(OFF_T_MAX, INT_MAX)
AC_DEFINE_UNQUOTED(PRIuUOFF_T, "u")
AC_DEFINE(UOFF_T_INT)
elif test x$sizeof_off_t = x$ac_cv_sizeof_long_long; then
# and finally long long
AC_DEFINE_UNQUOTED(OFF_T_MAX, LLONG_MAX)
AC_DEFINE_UNQUOTED(PRIuUOFF_T, "llu")
AC_DEFINE(UOFF_T_LONG_LONG)
else
AC_ERROR([Couldn't find integer type for off_t])
fi
if test x$sizeof_ssize_t = x$ac_cv_sizeof_int; then
AC_DEFINE_UNQUOTED(SSIZE_T_MAX, INT_MAX)
AC_DEFINE_UNQUOTED(PRIuSIZE_T, "u")
elif test x$sizeof_ssize_t = x$ac_cv_sizeof_long; then
AC_DEFINE_UNQUOTED(SSIZE_T_MAX, LONG_MAX)
AC_DEFINE_UNQUOTED(PRIuSIZE_T, "lu")
elif test x$sizeof_ssize_t = x$ac_cv_sizeof_long_long; then
AC_DEFINE_UNQUOTED(SSIZE_T_MAX, LLONG_MAX)
AC_DEFINE_UNQUOTED(PRIuSIZE_T, "llu")
else
AC_ERROR([Couldn't find integer type for ssize_t])
fi
if test x$ac_cv_sizeof_long_long != x0; then
AC_DEFINE(LARGEST_T_LONG_LONG)
else
AC_DEFINE(LARGEST_T_LONG)
fi
dnl * memory alignment
AC_DEFINE_UNQUOTED(MEM_ALIGN_SIZE, $mem_align)
dnl * socklen_t - AC_CHECK_TYPE() would be _really_ useful if it only would
dnl * accept header files where to find the typedef..
AC_MSG_CHECKING([for socklen_t])
AC_CACHE_VAL(i_cv_type_socklen_t,
[AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>],
[socklen_t t;],
i_cv_type_socklen_t=yes,
i_cv_type_socklen_t=no,
)])
if test $i_cv_type_socklen_t = no; then
AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
fi
AC_MSG_RESULT($i_cv_type_socklen_t)
dnl * do we have tm_gmtoff
AC_MSG_CHECKING([for tm_gmtoff])
AC_CACHE_VAL(i_cv_field_tm_gmtoff,
[AC_TRY_COMPILE([
#include <time.h>],
[struct tm *tm; return tm->tm_gmtoff;],
i_cv_field_tm_gmtoff=yes,
i_cv_field_tm_gmtoff=no,
)])
if test $i_cv_field_tm_gmtoff = yes; then
AC_DEFINE(HAVE_TM_GMTOFF)
fi
AC_MSG_RESULT($i_cv_field_tm_gmtoff)
dnl * do we have struct iovec
AC_MSG_CHECKING([for struct iovec])
AC_CACHE_VAL(i_cv_struct_iovec,
[AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>],
[struct iovec *iovec;],
i_cv_struct_iovec=yes,
i_cv_struct_iovec=no)])
if test $i_cv_struct_iovec = yes; then
AC_DEFINE(HAVE_STRUCT_IOVEC)
fi
AC_MSG_RESULT($i_cv_struct_iovec)
dnl * Linux compatible mremap()
AC_MSG_CHECKING([Linux compatible mremap()])
AC_TRY_COMPILE([
#include <unistd.h>
#define __USE_GNU
#include <sys/mman.h>
], [
mremap(0, 0, 0, MREMAP_MAYMOVE);
], [
AC_DEFINE(HAVE_LINUX_MREMAP)
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
])
dnl * Linux compatible sendfile()
AC_MSG_CHECKING([Linux compatible sendfile()])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/sendfile.h>
], [
sendfile(0, 0, (void *) 0, 0);
], [
AC_DEFINE(HAVE_LINUX_SENDFILE)
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
])
dnl * FreeBSD compatible sendfile()
AC_MSG_CHECKING([FreeBSD compatible sendfile()])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
], [
struct sf_hdtr hdtr;
sendfile(0, 0, 0, 0, &hdtr, (void *) 0, 0);
], [
AC_DEFINE(HAVE_FREEBSD_SENDFILE)
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
])
dnl **
dnl ** SSL (gnutls)
dnl **
if test $want_gnutls = yes; then
AC_CHECK_LIB(gnutls, gnutls_global_init, [
AC_DEFINE(HAVE_SSL)
SSL_LIBS="-lgnutls -lgcrypt"
AC_SUBST(SSL_LIBS)
have_ssl=yes
], [
have_ssl=no
], -lgcrypt)
else
have_ssl=no
fi
dnl **
dnl ** shadow/pam support
dnl **
need_crypt=no
auths=""
if test $want_passwd = yes; then
need_crypt=yes
AC_DEFINE(USERINFO_PASSWD)
auths="$auths passwd"
fi
if test $want_passwd_file = yes; then
need_crypt=yes
AC_DEFINE(USERINFO_PASSWD_FILE)
auths="$auths passwd-file"
fi
if test $want_shadow = yes; then
AC_CHECK_FUNC(getspnam, [
need_crypt=yes
AC_DEFINE(USERINFO_SHADOW)
auths="$auths shadow"
])
fi
if test $want_pam = yes; then
AC_CHECK_LIB(pam, pam_start, [
AC_CHECK_HEADER(security/pam_appl.h, [
USERINFO_LIBS="$USERINFO_LIBS -lpam"
AC_DEFINE(USERINFO_PAM)
auths="$auths pam"
])
])
fi
if test $want_vpopmail = yes; then
vpopmail_home="`echo ~vpopmail`"
vpop_libdeps="$vpopmail_home/etc/lib_deps"
AC_MSG_CHECKING([for vpopmail configuration at $vpop_libdeps])
if test -f $vpop_libdeps; then
need_crypt=yes
VPOPMAIL_CFLAGS="`cat $vpopmail_home/etc/inc_deps` $CFLAGS"
VPOPMAIL_LIBS="`cat $vpop_libdeps`"
AC_DEFINE(USERINFO_VPOPMAIL)
auths="$auths vpopmail"
AC_MSG_RESULT(found)
else
want_vpopmail=no
AC_MSG_RESULT(not found)
fi
fi
AC_SUBST(VPOPMAIL_CFLAGS)
AC_SUBST(VPOPMAIL_LIBS)
if test $need_crypt = yes; then
AC_CHECK_LIB(crypt, crypt, [
USERINFO_LIBS="$USERINFO_LIBS -lcrypt"
], [
AC_CHECK_FUNC(crypt,, [
AC_ERROR([crypt() wasn't found])
])
])
fi
AC_SUBST(USERINFO_LIBS)
dnl **
dnl ** Index file compatibility flags
dnl **
dnl * currently just checking for endianess
AC_C_BIGENDIAN
if test $ac_cv_c_bigendian = yes; then
flags=0
else
flags=1
fi
AC_DEFINE_UNQUOTED(MAIL_INDEX_COMPAT_FLAGS, $flags)
dnl **
dnl ** IPv6 support
dnl **
if test "x$want_ipv6" = "xyes"; then
AC_MSG_CHECKING([for IPv6])
AC_CACHE_VAL(i_cv_type_in6_addr,
[AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>],
[struct in6_addr i;],
i_cv_type_in6_addr=yes,
i_cv_type_in6_addr=no,
)])
if test $i_cv_type_in6_addr = yes; then
AC_DEFINE(HAVE_IPV6)
fi
AC_MSG_RESULT($i_cv_type_in6_addr)
fi
dnl **
dnl ** capabilities
dnl **
capability="IMAP4rev1"
if test "$have_ssl" = "yes"; then
capability="$capability STARTTLS"
fi
AC_DEFINE_UNQUOTED(CAPABILITY_STRING, "$capability")
dnl **
dnl ** register the storage classes
dnl **
STORAGE="maildir mbox"
file="src/lib-storage/mail-storage-register.c"
echo "/* this file is generated by configure */" > $file
echo '#include "lib.h"' >> $file
echo '#include "mail-storage.h"' >> $file
for storage in $STORAGE; do
echo "extern MailStorage ${storage}_storage;" >> $file
done
echo "void mail_storage_register_all(void) {" >> $file
for storage in $STORAGE; do
echo "mail_storage_class_register(&${storage}_storage);" >> $file
done
echo "}" >> $file
AC_OUTPUT(
Makefile
doc/Makefile
src/Makefile
src/lib/Makefile
src/lib-imap/Makefile
src/lib-index/Makefile
src/lib-index/maildir/Makefile
src/lib-index/mbox/Makefile
src/lib-mail/Makefile
src/lib-storage/Makefile
src/lib-storage/index/Makefile
src/lib-storage/index/maildir/Makefile
src/lib-storage/index/mbox/Makefile
src/lib-storage/subscription-file/Makefile
src/auth/Makefile
src/imap/Makefile
src/login/Makefile
src/master/Makefile
stamp.h)
echo
echo "Install prefix ............. : $prefix"
echo "Building with auth modules . :$auths"
echo "Building with SSL support .. : $have_ssl"
echo "Building with IPv6 support . : $want_ipv6"