annotate configure.ac @ 22664:fea53c2725c0

director: Fix director_max_parallel_moves/kicks type Should be uint, not time.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 09 Nov 2017 12:24:16 +0200
parents fc335480acb3
children b50c55023f08
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3784
beeae4f17615 Cleanups and some more kqueue stuff
Timo Sirainen <tss@iki.fi>
parents: 3783
diff changeset
1 AC_PREREQ([2.59])
15357
f5941f3ac762 Released v2.2.alpha1.
Timo Sirainen <tss@iki.fi>
parents: 15355
diff changeset
2
f5941f3ac762 Released v2.2.alpha1.
Timo Sirainen <tss@iki.fi>
parents: 15355
diff changeset
3 # Be sure to update ABI version also if anything changes that might require
f5941f3ac762 Released v2.2.alpha1.
Timo Sirainen <tss@iki.fi>
parents: 15355
diff changeset
4 # recompiling plugins. Most importantly that means if any structs are changed.
19518
f1ec963e9436 configure: Changed version number to v2.2.devel.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 19509
diff changeset
5 AC_INIT([Dovecot],[2.2.devel],[dovecot@dovecot.org])
19452
c35e62a9e710 Released v2.2.20.rc1.
Timo Sirainen <tss@iki.fi>
parents: 19378
diff changeset
6 AC_DEFINE_UNQUOTED([DOVECOT_ABI_VERSION], "2.2.ABIv20($PACKAGE_VERSION)", [Dovecot ABI version])
20493
4c77eadf2e9f configure: Add m4 and aux dir to configure
Aki Tuomi <aki.tuomi@dovecot.fi>
parents: 20492
diff changeset
7 AC_CONFIG_AUX_DIR([.])
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
8 AC_CONFIG_SRCDIR([src])
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9
8523
426b356a0708 Use "foreign" automake option so it doesn't complain about missing ChangeLog.
Timo Sirainen <tss@iki.fi>
parents: 8517
diff changeset
10 AM_INIT_AUTOMAKE([foreign])
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12 AM_MAINTAINER_MODE
12438
c1d8fb31c1ad configure: Use PKG_PROG_PKG_CONFIG to find pkg-config binary.
Timo Sirainen <tss@iki.fi>
parents: 12400
diff changeset
13 PKG_PROG_PKG_CONFIG
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
14
10754
c5cbc99f4627 configure: Set ACLOCAL_AMFLAGS so make finds dovecot.m4.
Timo Sirainen <tss@iki.fi>
parents: 10753
diff changeset
15 ACLOCAL_AMFLAGS='-I $(top_srcdir)'
c5cbc99f4627 configure: Set ACLOCAL_AMFLAGS so make finds dovecot.m4.
Timo Sirainen <tss@iki.fi>
parents: 10753
diff changeset
16 AC_SUBST(ACLOCAL_AMFLAGS)
c5cbc99f4627 configure: Set ACLOCAL_AMFLAGS so make finds dovecot.m4.
Timo Sirainen <tss@iki.fi>
parents: 10753
diff changeset
17
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
18 dnl TEST_WITH(name, value, [plugin])
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
19 AC_DEFUN([TEST_WITH], [
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
20 want=want_`echo $1|sed s/-/_/g`
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
21 if test $2 = yes || test $2 = no || test $2 = auto; then
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
22 eval $want=$2
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
23 elif test $2 = plugin; then
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
24 if test "$3" = plugin; then
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
25 eval $want=plugin
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
26 else
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
27 AC_ERROR([--with-$1=plugin not supported])
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
28 fi
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
29 elif `echo $2|grep '^/' >/dev/null`; then
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
30 AC_ERROR([--with-$1=path not supported. You may want to use instead:
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
31 CPPFLAGS=-I$2/include LDFLAGS=-L$2/lib ./configure --with-$1])
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
32 else
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
33 AC_ERROR([--with-$1: Unknown value: $2])
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
34 fi
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
35 ])
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
36
7929
55d1a2bf4573 Renamed --enable-debug to --enable-devel-checks, which describes it better.
Timo Sirainen <tss@iki.fi>
parents: 7924
diff changeset
37 AC_ARG_ENABLE(devel-checks,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
38 AS_HELP_STRING([--enable-devel-checks], [Enable some extra expensive checks for developers]),
544
42e65c2ba49d Added --enable-debug. Currently it just forces file locks so that index
Timo Sirainen <tss@iki.fi>
parents: 530
diff changeset
39 if test x$enableval = xyes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
40 AC_DEFINE(DEBUG,, [Build with extra debugging checks])
13866
c682a5bf3de7 --enable-devel-checks: Use -fcatch-undefined-behavior -ftrapv with clang.
Timo Sirainen <tss@iki.fi>
parents: 13794
diff changeset
41 want_devel_checks=yes
544
42e65c2ba49d Added --enable-debug. Currently it just forces file locks so that index
Timo Sirainen <tss@iki.fi>
parents: 530
diff changeset
42 fi)
42e65c2ba49d Added --enable-debug. Currently it just forces file locks so that index
Timo Sirainen <tss@iki.fi>
parents: 530
diff changeset
43
546
e1254b838e0b Added --enable-asserts (default) and fixed some warnings when building
Timo Sirainen <tss@iki.fi>
parents: 544
diff changeset
44 AC_ARG_ENABLE(asserts,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
45 AS_HELP_STRING([--enable-asserts], [Enable asserts (default)]),
4057
f4807accc1d5 Unbreak last accidental change..
Timo Sirainen <tss@iki.fi>
parents: 4055
diff changeset
46 if test x$enableval = xno; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
47 AC_DEFINE(DISABLE_ASSERTS,, [Disable asserts])
546
e1254b838e0b Added --enable-asserts (default) and fixed some warnings when building
Timo Sirainen <tss@iki.fi>
parents: 544
diff changeset
48 fi)
e1254b838e0b Added --enable-asserts (default) and fixed some warnings when building
Timo Sirainen <tss@iki.fi>
parents: 544
diff changeset
49
9104
c6d306772f4e Added configure --without-shared-libs to link built binaries against static libraries.
Timo Sirainen <tss@iki.fi>
parents: 9092
diff changeset
50 AC_ARG_WITH(shared-libs,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
51 AS_HELP_STRING([--with-shared-libs], [Link binaries using shared Dovecot libraries (default)]),
9104
c6d306772f4e Added configure --without-shared-libs to link built binaries against static libraries.
Timo Sirainen <tss@iki.fi>
parents: 9092
diff changeset
52 want_shared_libs=$withval,
c6d306772f4e Added configure --without-shared-libs to link built binaries against static libraries.
Timo Sirainen <tss@iki.fi>
parents: 9092
diff changeset
53 want_shared_libs=yes)
c6d306772f4e Added configure --without-shared-libs to link built binaries against static libraries.
Timo Sirainen <tss@iki.fi>
parents: 9092
diff changeset
54 AM_CONDITIONAL(BUILD_SHARED_LIBS, test "$want_shared_libs" = "yes")
c6d306772f4e Added configure --without-shared-libs to link built binaries against static libraries.
Timo Sirainen <tss@iki.fi>
parents: 9092
diff changeset
55
439
b66ccecbc8a6 Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents: 426
diff changeset
56 AC_ARG_WITH(mem-align,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
57 AS_HELP_STRING([--with-mem-align=BYTES], [Set the memory alignment (default: 8)]),
439
b66ccecbc8a6 Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents: 426
diff changeset
58 mem_align=$withval,
b66ccecbc8a6 Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents: 426
diff changeset
59 mem_align=8)
b66ccecbc8a6 Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents: 426
diff changeset
60
2569
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
61 AC_ARG_WITH(ioloop,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
62 AS_HELP_STRING([--with-ioloop=IOLOOP], [Specify the I/O loop method to use (epoll, kqueue, poll; best for the fastest available; default is best)]),
2569
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
63 ioloop=$withval,
7268
80cd999d5623 Changed the default ioloop to "best".
Timo Sirainen <tss@iki.fi>
parents: 7264
diff changeset
64 ioloop=best)
2569
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
65
3482
465c465c66be Added inotify patch by Johannes Berg and did some restructuring to
Timo Sirainen <tss@iki.fi>
parents: 3452
diff changeset
66 AC_ARG_WITH(notify,
18980
39255150d521 Removed support for dnotify.
Timo Sirainen <tss@iki.fi>
parents: 18702
diff changeset
67 AS_HELP_STRING([--with-notify=NOTIFY], [Specify the file system notification method to use (inotify, kqueue, none; default is detected in the above order)]),
3482
465c465c66be Added inotify patch by Johannes Berg and did some restructuring to
Timo Sirainen <tss@iki.fi>
parents: 3452
diff changeset
68 notify=$withval,
465c465c66be Added inotify patch by Johannes Berg and did some restructuring to
Timo Sirainen <tss@iki.fi>
parents: 3452
diff changeset
69 notify=)
465c465c66be Added inotify patch by Johannes Berg and did some restructuring to
Timo Sirainen <tss@iki.fi>
parents: 3452
diff changeset
70
6111
c83546491bad --with-passwd was used also for --with-nss
Timo Sirainen <tss@iki.fi>
parents: 6106
diff changeset
71 AC_ARG_WITH(nss,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
72 AS_HELP_STRING([--with-nss], [Build with NSS module support (auto)]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
73 TEST_WITH(nss, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
74 want_nss=auto)
5870
c9b49ed99d28 Added userdb nss which currently supports glibc-compatible NSS modules.
Timo Sirainen <tss@iki.fi>
parents: 5859
diff changeset
75
328
a0abed892d11 s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents: 313
diff changeset
76 AC_ARG_WITH(shadow,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
77 AS_HELP_STRING([--with-shadow], [Build with shadow password support (auto)]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
78 TEST_WITH(shadow, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
79 want_shadow=auto)
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
80
328
a0abed892d11 s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents: 313
diff changeset
81 AC_ARG_WITH(pam,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
82 AS_HELP_STRING([--with-pam], [Build with PAM support (auto)]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
83 TEST_WITH(pam, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
84 want_pam=auto)
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
85
1851
d66d53f57e43 Added bsdauth support, patch by Dan Cross
Timo Sirainen <tss@iki.fi>
parents: 1849
diff changeset
86 AC_ARG_WITH(bsdauth,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
87 AS_HELP_STRING([--with-bsdauth], [Build with BSD authentication support (auto)]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
88 TEST_WITH(bsdauth, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
89 want_bsdauth=auto)
1851
d66d53f57e43 Added bsdauth support, patch by Dan Cross
Timo Sirainen <tss@iki.fi>
parents: 1849
diff changeset
90
3683
28cca6317829 Added GSSAPI support. Patch by Jelmer Vernooij and some fixes by
Timo Sirainen <tss@iki.fi>
parents: 3671
diff changeset
91 AC_ARG_WITH(gssapi,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
92 AS_HELP_STRING([--with-gssapi=yes|plugin Build with GSSAPI authentication support]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
93 TEST_WITH(gssapi, $withval, plugin),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
94 want_gssapi=no)
3683
28cca6317829 Added GSSAPI support. Patch by Jelmer Vernooij and some fixes by
Timo Sirainen <tss@iki.fi>
parents: 3671
diff changeset
95
4638
689a02ca02d3 Tru64 SIA authentication support. Patch by Simon L Jackson
Timo Sirainen <tss@iki.fi>
parents: 4621
diff changeset
96 AC_ARG_WITH(sia,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
97 AS_HELP_STRING([--with-sia], [Build with Tru64 SIA support]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
98 TEST_WITH(sia, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
99 want_sia=no)
4638
689a02ca02d3 Tru64 SIA authentication support. Patch by Simon L Jackson
Timo Sirainen <tss@iki.fi>
parents: 4621
diff changeset
100
1057
c5ab972db48c libldap checks, --without-pop3 disables pop3 server
Timo Sirainen <tss@iki.fi>
parents: 1049
diff changeset
101 AC_ARG_WITH(ldap,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
102 AS_HELP_STRING([--with-ldap=yes|plugin], [Build with LDAP support]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
103 TEST_WITH(ldap, $withval, plugin),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
104 want_ldap=no)
1057
c5ab972db48c libldap checks, --without-pop3 disables pop3 server
Timo Sirainen <tss@iki.fi>
parents: 1049
diff changeset
105
280
fa2d1a1d025e vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents: 247
diff changeset
106 AC_ARG_WITH(vpopmail,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
107 AS_HELP_STRING([--with-vpopmail], [Build with vpopmail support (auto)]),
280
fa2d1a1d025e vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents: 247
diff changeset
108 if test x$withval = xno; then
fa2d1a1d025e vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents: 247
diff changeset
109 want_vpopmail=no
fa2d1a1d025e vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents: 247
diff changeset
110 else
6974
ec6cc297dd82 --with-package=yes now fails if package can't be used. --with-package=auto
Timo Sirainen <tss@iki.fi>
parents: 6919
diff changeset
111 if test x$withval = xyes || test x$withval = xauto; then
5035
80f0ee36e905 Allow --with-vpopmail=path specify the vpopmail_home path.
Timo Sirainen <tss@iki.fi>
parents: 5034
diff changeset
112 vpopmail_home="`echo ~vpopmail`"
6974
ec6cc297dd82 --with-package=yes now fails if package can't be used. --with-package=auto
Timo Sirainen <tss@iki.fi>
parents: 6919
diff changeset
113 want_vpopmail=$withval
5035
80f0ee36e905 Allow --with-vpopmail=path specify the vpopmail_home path.
Timo Sirainen <tss@iki.fi>
parents: 5034
diff changeset
114 else
80f0ee36e905 Allow --with-vpopmail=path specify the vpopmail_home path.
Timo Sirainen <tss@iki.fi>
parents: 5034
diff changeset
115 vpopmail_home="$withval"
6974
ec6cc297dd82 --with-package=yes now fails if package can't be used. --with-package=auto
Timo Sirainen <tss@iki.fi>
parents: 6919
diff changeset
116 want_vpopmail=yes
5035
80f0ee36e905 Allow --with-vpopmail=path specify the vpopmail_home path.
Timo Sirainen <tss@iki.fi>
parents: 5034
diff changeset
117 fi
80f0ee36e905 Allow --with-vpopmail=path specify the vpopmail_home path.
Timo Sirainen <tss@iki.fi>
parents: 5034
diff changeset
118 fi, [
12049
f90590836165 configure: vpopmail is broken, fail configure if --with-vpopmail is used.
Timo Sirainen <tss@iki.fi>
parents: 12044
diff changeset
119 want_vpopmail=no
5035
80f0ee36e905 Allow --with-vpopmail=path specify the vpopmail_home path.
Timo Sirainen <tss@iki.fi>
parents: 5034
diff changeset
120 ])
280
fa2d1a1d025e vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents: 247
diff changeset
121
10581
6ecb1b7528c9 Disabled Berkeley DB support until someone fixes it.
Timo Sirainen <tss@iki.fi>
parents: 10567
diff changeset
122 # Berkeley DB support is more or less broken. Disabled for now.
6ecb1b7528c9 Disabled Berkeley DB support until someone fixes it.
Timo Sirainen <tss@iki.fi>
parents: 10567
diff changeset
123 #AC_ARG_WITH(db,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
124 #AS_HELP_STRING([--with-db], [Build with Berkeley DB support]),
10581
6ecb1b7528c9 Disabled Berkeley DB support until someone fixes it.
Timo Sirainen <tss@iki.fi>
parents: 10567
diff changeset
125 # TEST_WITH(db, $withval),
6ecb1b7528c9 Disabled Berkeley DB support until someone fixes it.
Timo Sirainen <tss@iki.fi>
parents: 10567
diff changeset
126 # want_db=no)
10600
20963e8ec560 configure: Another try at fixing Berkeley DB check to not give an error.
Timo Sirainen <tss@iki.fi>
parents: 10598
diff changeset
127 want_db=no
4517
e661182eab75 Berkeley DB dict support is now enabled only when using --with-db configure option.
Timo Sirainen <timo.sirainen@movial.fi>
parents: 4482
diff changeset
128
15665
2c249941f9c2 dict: Added support for cdb backend.
Timo Sirainen <tss@iki.fi>
parents: 15646
diff changeset
129 AC_ARG_WITH(cdb,
2c249941f9c2 dict: Added support for cdb backend.
Timo Sirainen <tss@iki.fi>
parents: 15646
diff changeset
130 AS_HELP_STRING([--with-cdb], [Build with CDB support]),
2c249941f9c2 dict: Added support for cdb backend.
Timo Sirainen <tss@iki.fi>
parents: 15646
diff changeset
131 TEST_WITH(cdb, $withval),
2c249941f9c2 dict: Added support for cdb backend.
Timo Sirainen <tss@iki.fi>
parents: 15646
diff changeset
132 want_cdb=no)
2c249941f9c2 dict: Added support for cdb backend.
Timo Sirainen <tss@iki.fi>
parents: 15646
diff changeset
133
4013
bf0357107349 Added --with-sql option to build with SQL userdb/passdb but without any
Timo Sirainen <tss@iki.fi>
parents: 4012
diff changeset
134 dnl The --with-sql is useful only if Dovecot is being built with all the SQL
bf0357107349 Added --with-sql option to build with SQL userdb/passdb but without any
Timo Sirainen <tss@iki.fi>
parents: 4012
diff changeset
135 dnl drivers as modules. If any SQL driver is built-in, this option is ignored.
bf0357107349 Added --with-sql option to build with SQL userdb/passdb but without any
Timo Sirainen <tss@iki.fi>
parents: 4012
diff changeset
136 AC_ARG_WITH(sql,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
137 AS_HELP_STRING([--with-sql=yes|plugin], [Build with generic SQL support]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
138 TEST_WITH(sql, $withval, plugin),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
139 want_sql=no)
4013
bf0357107349 Added --with-sql option to build with SQL userdb/passdb but without any
Timo Sirainen <tss@iki.fi>
parents: 4012
diff changeset
140
1283
2d8af547a8b4 Added PostgreSQL support, patch by Alex Howansky
Timo Sirainen <tss@iki.fi>
parents: 1256
diff changeset
141 AC_ARG_WITH(pgsql,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
142 AS_HELP_STRING([--with-pgsql], [Build with PostgreSQL driver support]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
143 TEST_WITH(pgsql, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
144 want_pgsql=no)
1283
2d8af547a8b4 Added PostgreSQL support, patch by Alex Howansky
Timo Sirainen <tss@iki.fi>
parents: 1256
diff changeset
145
1995
cc64f8bb4716 MySQL authentication patch by Matther Reimer
Timo Sirainen <tss@iki.fi>
parents: 1990
diff changeset
146 AC_ARG_WITH(mysql,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
147 AS_HELP_STRING([--with-mysql], [Build with MySQL driver support]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
148 TEST_WITH(mysql, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
149 want_mysql=no)
1995
cc64f8bb4716 MySQL authentication patch by Matther Reimer
Timo Sirainen <tss@iki.fi>
parents: 1990
diff changeset
150
3919
b967ffb7e3a6 SQLite support. Patch by Jakob Hirsch.
Timo Sirainen <tss@iki.fi>
parents: 3904
diff changeset
151 AC_ARG_WITH(sqlite,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
152 AS_HELP_STRING([--with-sqlite], [Build with SQLite3 driver support]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
153 TEST_WITH(sqlite, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
154 want_sqlite=no)
3919
b967ffb7e3a6 SQLite support. Patch by Jakob Hirsch.
Timo Sirainen <tss@iki.fi>
parents: 3904
diff changeset
155
18640
3725c601dbaf lib-sql: Added support for Cassandra CQL as lib-sql backend.
Timo Sirainen <tss@iki.fi>
parents: 18621
diff changeset
156 AC_ARG_WITH(cassandra,
3725c601dbaf lib-sql: Added support for Cassandra CQL as lib-sql backend.
Timo Sirainen <tss@iki.fi>
parents: 18621
diff changeset
157 AS_HELP_STRING([--with-cassandra], [Build with Cassandra driver support]),
3725c601dbaf lib-sql: Added support for Cassandra CQL as lib-sql backend.
Timo Sirainen <tss@iki.fi>
parents: 18621
diff changeset
158 TEST_WITH(cassandra, $withval),
3725c601dbaf lib-sql: Added support for Cassandra CQL as lib-sql backend.
Timo Sirainen <tss@iki.fi>
parents: 18621
diff changeset
159 want_cassandra=no)
3725c601dbaf lib-sql: Added support for Cassandra CQL as lib-sql backend.
Timo Sirainen <tss@iki.fi>
parents: 18621
diff changeset
160
4621
446646de0c4a --with-lucene now enables lucene full text search indexing. Note that using
Timo Sirainen <tss@iki.fi>
parents: 4609
diff changeset
161 AC_ARG_WITH(lucene,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
162 AS_HELP_STRING([--with-lucene], [Build with CLucene full text search support]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
163 TEST_WITH(lucene, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
164 want_lucene=no)
4621
446646de0c4a --with-lucene now enables lucene full text search indexing. Note that using
Timo Sirainen <tss@iki.fi>
parents: 4609
diff changeset
165 AM_CONDITIONAL(BUILD_LUCENE, test "$want_lucene" = "yes")
446646de0c4a --with-lucene now enables lucene full text search indexing. Note that using
Timo Sirainen <tss@iki.fi>
parents: 4609
diff changeset
166
13305
57aeda3d94ad configure: Added --with-stemmer and output which fts backends are compiled.
Timo Sirainen <tss@iki.fi>
parents: 13294
diff changeset
167 AC_ARG_WITH(stemmer,
18412
1c516f905152 configure: Stemmer and textcat checks are now done even if CLucene isn't used.
Timo Sirainen <tss@iki.fi>
parents: 18396
diff changeset
168 AS_HELP_STRING([--with-stemmer], [Build with libstemmer support (for FTS) (auto)]),
13305
57aeda3d94ad configure: Added --with-stemmer and output which fts backends are compiled.
Timo Sirainen <tss@iki.fi>
parents: 13294
diff changeset
169 TEST_WITH(stemmer, $withval),
57aeda3d94ad configure: Added --with-stemmer and output which fts backends are compiled.
Timo Sirainen <tss@iki.fi>
parents: 13294
diff changeset
170 want_stemmer=auto)
57aeda3d94ad configure: Added --with-stemmer and output which fts backends are compiled.
Timo Sirainen <tss@iki.fi>
parents: 13294
diff changeset
171
18396
33685b996cf2 configure: Added --with-textcat parameter
Timo Sirainen <tss@iki.fi>
parents: 18391
diff changeset
172 AC_ARG_WITH(textcat,
18412
1c516f905152 configure: Stemmer and textcat checks are now done even if CLucene isn't used.
Timo Sirainen <tss@iki.fi>
parents: 18396
diff changeset
173 AS_HELP_STRING([--with-textcat], [Build with libtextcat support (for FTS) (auto)]),
18396
33685b996cf2 configure: Added --with-textcat parameter
Timo Sirainen <tss@iki.fi>
parents: 18391
diff changeset
174 TEST_WITH(textcat, $withval),
33685b996cf2 configure: Added --with-textcat parameter
Timo Sirainen <tss@iki.fi>
parents: 18391
diff changeset
175 want_textcat=auto)
33685b996cf2 configure: Added --with-textcat parameter
Timo Sirainen <tss@iki.fi>
parents: 18391
diff changeset
176
18439
b179bbd226e5 configure: s/normalizer/libicu/ since we it could be used for something else as well.
Timo Sirainen <tss@iki.fi>
parents: 18426
diff changeset
177 AC_ARG_WITH(icu,
b179bbd226e5 configure: s/normalizer/libicu/ since we it could be used for something else as well.
Timo Sirainen <tss@iki.fi>
parents: 18426
diff changeset
178 AS_HELP_STRING([--with-icu], [Build with libicu support (for FTS normalization) (auto)]),
b179bbd226e5 configure: s/normalizer/libicu/ since we it could be used for something else as well.
Timo Sirainen <tss@iki.fi>
parents: 18426
diff changeset
179 want_icu=$withval,
b179bbd226e5 configure: s/normalizer/libicu/ since we it could be used for something else as well.
Timo Sirainen <tss@iki.fi>
parents: 18426
diff changeset
180 want_icu=auto)
18414
81e5b977e5c5 Initial import for lib-fts.
Timo Sirainen <tss@iki.fi>
parents: 18413
diff changeset
181
7990
662172573fe1 Initial code to support Apache Solr (Lucene indexing server).
Timo Sirainen <tss@iki.fi>
parents: 7983
diff changeset
182 AC_ARG_WITH(solr,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
183 AS_HELP_STRING([--with-solr], [Build with Solr full text search support]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
184 TEST_WITH(solr, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
185 want_solr=no)
7990
662172573fe1 Initial code to support Apache Solr (Lucene indexing server).
Timo Sirainen <tss@iki.fi>
parents: 7983
diff changeset
186
8090
75b1f16cba72 Added --with-zlib and --with-bzlib configure options.
Timo Sirainen <tss@iki.fi>
parents: 8076
diff changeset
187 AC_ARG_WITH(zlib,
18391
11f7bbed333e configure: Add missing (auto) to autodetected options.
Teemu Huovila <teemu.huovila@dovecot.fi>
parents: 18340
diff changeset
188 AS_HELP_STRING([--with-zlib], [Build with zlib compression support (auto)]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
189 TEST_WITH(zlib, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
190 want_zlib=auto)
8090
75b1f16cba72 Added --with-zlib and --with-bzlib configure options.
Timo Sirainen <tss@iki.fi>
parents: 8076
diff changeset
191
75b1f16cba72 Added --with-zlib and --with-bzlib configure options.
Timo Sirainen <tss@iki.fi>
parents: 8076
diff changeset
192 AC_ARG_WITH(bzlib,
18391
11f7bbed333e configure: Add missing (auto) to autodetected options.
Teemu Huovila <teemu.huovila@dovecot.fi>
parents: 18340
diff changeset
193 AS_HELP_STRING([--with-bzlib], [Build with bzlib compression support (auto)]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
194 TEST_WITH(bzlib, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
195 want_bzlib=auto)
8090
75b1f16cba72 Added --with-zlib and --with-bzlib configure options.
Timo Sirainen <tss@iki.fi>
parents: 8076
diff changeset
196
17028
81e486aacbc7 lib-compression: Added support for liblzma (xz)
Timo Sirainen <tss@iki.fi>
parents: 17000
diff changeset
197 AC_ARG_WITH(lzma,
18391
11f7bbed333e configure: Add missing (auto) to autodetected options.
Teemu Huovila <teemu.huovila@dovecot.fi>
parents: 18340
diff changeset
198 AS_HELP_STRING([--with-lzma], [Build with LZMA compression support (auto)]),
17028
81e486aacbc7 lib-compression: Added support for liblzma (xz)
Timo Sirainen <tss@iki.fi>
parents: 17000
diff changeset
199 TEST_WITH(lzma, $withval),
81e486aacbc7 lib-compression: Added support for liblzma (xz)
Timo Sirainen <tss@iki.fi>
parents: 17000
diff changeset
200 want_lzma=auto)
81e486aacbc7 lib-compression: Added support for liblzma (xz)
Timo Sirainen <tss@iki.fi>
parents: 17000
diff changeset
201
17104
fb4a0a84da50 lib-compression: Added initial support for LZ4
Timo Sirainen <tss@iki.fi>
parents: 17084
diff changeset
202 AC_ARG_WITH(lz4,
18391
11f7bbed333e configure: Add missing (auto) to autodetected options.
Teemu Huovila <teemu.huovila@dovecot.fi>
parents: 18340
diff changeset
203 AS_HELP_STRING([--with-lz4], [Build with LZ4 compression support (auto)]),
17104
fb4a0a84da50 lib-compression: Added initial support for LZ4
Timo Sirainen <tss@iki.fi>
parents: 17084
diff changeset
204 TEST_WITH(lz4, $withval),
fb4a0a84da50 lib-compression: Added initial support for LZ4
Timo Sirainen <tss@iki.fi>
parents: 17084
diff changeset
205 want_lz4=auto)
fb4a0a84da50 lib-compression: Added initial support for LZ4
Timo Sirainen <tss@iki.fi>
parents: 17084
diff changeset
206
9538
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
207 AC_ARG_WITH(libcap,
18391
11f7bbed333e configure: Add missing (auto) to autodetected options.
Teemu Huovila <teemu.huovila@dovecot.fi>
parents: 18340
diff changeset
208 AS_HELP_STRING([--with-libcap], [Build with libcap support (Dropping capabilities) (auto)]),
9538
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
209 TEST_WITH(libcap, $withval),
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
210 want_libcap=auto)
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
211
10647
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
212 AC_ARG_WITH(libwrap,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
213 AS_HELP_STRING([--with-libwrap], [Build with libwrap, ie. TCP-wrappers]),
10647
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
214 TEST_WITH(libwrap, $withval),
11005
51150f2b3be8 configure: Disabled tcp-wrappers by default.
Timo Sirainen <tss@iki.fi>
parents: 10994
diff changeset
215 want_libwrap=no)
10647
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
216
622
235188ee7a05 Support for OpenSSL.
Timo Sirainen <tss@iki.fi>
parents: 576
diff changeset
217 AC_ARG_WITH(ssl,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
218 AS_HELP_STRING([--with-ssl=gnutls|openssl], [Build with GNUTLS or OpenSSL (default)]),
245
Timo Sirainen <tss@iki.fi>
parents: 244
diff changeset
219 if test x$withval = xno; then
244
bf1e284fece2 added --without-gnutls option
Timo Sirainen <tss@iki.fi>
parents: 224
diff changeset
220 want_gnutls=no
622
235188ee7a05 Support for OpenSSL.
Timo Sirainen <tss@iki.fi>
parents: 576
diff changeset
221 want_openssl=no
235188ee7a05 Support for OpenSSL.
Timo Sirainen <tss@iki.fi>
parents: 576
diff changeset
222 elif test x$withval = xgnutls; then
12026
ab75eff633aa configure: --with-ssl=gnutls gives error now immediately
Timo Sirainen <tss@iki.fi>
parents: 12002
diff changeset
223 AC_ERROR([GNUTLS support is broken currently])
622
235188ee7a05 Support for OpenSSL.
Timo Sirainen <tss@iki.fi>
parents: 576
diff changeset
224 want_gnutls=yes
235188ee7a05 Support for OpenSSL.
Timo Sirainen <tss@iki.fi>
parents: 576
diff changeset
225 want_openssl=no
235188ee7a05 Support for OpenSSL.
Timo Sirainen <tss@iki.fi>
parents: 576
diff changeset
226 elif test x$withval = xopenssl; then
235188ee7a05 Support for OpenSSL.
Timo Sirainen <tss@iki.fi>
parents: 576
diff changeset
227 want_gnutls=no
235188ee7a05 Support for OpenSSL.
Timo Sirainen <tss@iki.fi>
parents: 576
diff changeset
228 want_openssl=yes
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
229 elif test x$withval = xyes; then
3004
60a172e62d11 Don't use GNUTLS unless explicitly specified. It's not working currently
Timo Sirainen <tss@iki.fi>
parents: 3002
diff changeset
230 want_gnutls=no
622
235188ee7a05 Support for OpenSSL.
Timo Sirainen <tss@iki.fi>
parents: 576
diff changeset
231 want_openssl=yes
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
232 else
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
233 AC_ERROR([--with-ssl: Invalid value: $withval])
622
235188ee7a05 Support for OpenSSL.
Timo Sirainen <tss@iki.fi>
parents: 576
diff changeset
234 fi, [
3004
60a172e62d11 Don't use GNUTLS unless explicitly specified. It's not working currently
Timo Sirainen <tss@iki.fi>
parents: 3002
diff changeset
235 want_gnutls=no
6974
ec6cc297dd82 --with-package=yes now fails if package can't be used. --with-package=auto
Timo Sirainen <tss@iki.fi>
parents: 6919
diff changeset
236 want_openssl=auto
622
235188ee7a05 Support for OpenSSL.
Timo Sirainen <tss@iki.fi>
parents: 576
diff changeset
237 ])
244
bf1e284fece2 added --without-gnutls option
Timo Sirainen <tss@iki.fi>
parents: 224
diff changeset
238
657
85a888d2766e Added script to easily generate self-signed certificate.
Timo Sirainen <tss@iki.fi>
parents: 654
diff changeset
239 AC_ARG_WITH(ssldir,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
240 AS_HELP_STRING([--with-ssldir=DIR], [SSL base directory for certificates (/etc/ssl)]),
657
85a888d2766e Added script to easily generate self-signed certificate.
Timo Sirainen <tss@iki.fi>
parents: 654
diff changeset
241 ssldir="$withval",
85a888d2766e Added script to easily generate self-signed certificate.
Timo Sirainen <tss@iki.fi>
parents: 654
diff changeset
242 ssldir=/etc/ssl
85a888d2766e Added script to easily generate self-signed certificate.
Timo Sirainen <tss@iki.fi>
parents: 654
diff changeset
243 )
712
385f862a4005 --with-ssldir actually didn't do anything, and the default directory for
Timo Sirainen <tss@iki.fi>
parents: 711
diff changeset
244 AC_SUBST(ssldir)
657
85a888d2766e Added script to easily generate self-signed certificate.
Timo Sirainen <tss@iki.fi>
parents: 654
diff changeset
245
3327
ce0733b39311 Added --with-rundir configure option.
Timo Sirainen <tss@iki.fi>
parents: 3284
diff changeset
246 AC_ARG_WITH(rundir,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
247 AS_HELP_STRING([--with-rundir=DIR], [Runtime data directory (LOCALSTATEDIR/run/dovecot)]),
3327
ce0733b39311 Added --with-rundir configure option.
Timo Sirainen <tss@iki.fi>
parents: 3284
diff changeset
248 rundir="$withval",
7914
5061533382be Uppercased PACKAGE_NAME macro and started using it in some places.
Timo Sirainen <tss@iki.fi>
parents: 7902
diff changeset
249 rundir=$localstatedir/run/$PACKAGE
3327
ce0733b39311 Added --with-rundir configure option.
Timo Sirainen <tss@iki.fi>
parents: 3284
diff changeset
250 )
ce0733b39311 Added --with-rundir configure option.
Timo Sirainen <tss@iki.fi>
parents: 3284
diff changeset
251 AC_SUBST(rundir)
ce0733b39311 Added --with-rundir configure option.
Timo Sirainen <tss@iki.fi>
parents: 3284
diff changeset
252
4407
2e4857a2b858 Added --with-statedir configure option which defaults to
Timo Sirainen <tss@iki.fi>
parents: 4387
diff changeset
253 AC_ARG_WITH(statedir,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
254 AS_HELP_STRING([--with-statedir=DIR], [Permanent data directory (LOCALSTATEDIR/lib/dovecot)]),
4407
2e4857a2b858 Added --with-statedir configure option which defaults to
Timo Sirainen <tss@iki.fi>
parents: 4387
diff changeset
255 statedir="$withval",
7914
5061533382be Uppercased PACKAGE_NAME macro and started using it in some places.
Timo Sirainen <tss@iki.fi>
parents: 7902
diff changeset
256 statedir=$localstatedir/lib/$PACKAGE
4407
2e4857a2b858 Added --with-statedir configure option which defaults to
Timo Sirainen <tss@iki.fi>
parents: 4387
diff changeset
257 )
2e4857a2b858 Added --with-statedir configure option which defaults to
Timo Sirainen <tss@iki.fi>
parents: 4387
diff changeset
258 AC_SUBST(statedir)
2e4857a2b858 Added --with-statedir configure option which defaults to
Timo Sirainen <tss@iki.fi>
parents: 4387
diff changeset
259
12442
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
260 AC_ARG_WITH([systemdsystemunitdir],
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
261 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files (auto=detect)]), [
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
262 if test "$withval" = "auto"; then
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
263 systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
264 elif test "$withval" != "no"; then
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
265 systemdsystemunitdir=$withval
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
266 fi
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
267 ], [])
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
268 if test "$systemdsystemunitdir" != ""; then
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
269 AC_SUBST(systemdsystemunitdir)
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
270 AC_DEFINE(HAVE_SYSTEMD,, [Define if you want to use systemd socket activation])
12442
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
271 fi
12443
94c5d2189006 configure: And small fix to previous --with-systemdsystemunitdir fix.
Timo Sirainen <tss@iki.fi>
parents: 12442
diff changeset
272 AM_CONDITIONAL(HAVE_SYSTEMD, test "$systemdsystemunitdir" != "")
12442
e0b42fcf31a1 configure: --with-systemdsystemunitdir wasn't working right.
Timo Sirainen <tss@iki.fi>
parents: 12441
diff changeset
273
1786
49b6103dd2e0 Added support for Boehm GC. However it seems to be crashing for some reason
Timo Sirainen <tss@iki.fi>
parents: 1729
diff changeset
274 AC_ARG_WITH(gc,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
275 AS_HELP_STRING([--with-gc], [Use Boehm garbage collector]),
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
276 TEST_WITH(gc, $withval),
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
277 want_gc=no)
1786
49b6103dd2e0 Added support for Boehm GC. However it seems to be crashing for some reason
Timo Sirainen <tss@iki.fi>
parents: 1729
diff changeset
278
1404
54015ae11177 --with-storage=maildir,mbox can now be used to compile in only the wanted
Timo Sirainen <tss@iki.fi>
parents: 1403
diff changeset
279 AC_ARG_WITH(storages,
15380
7c75559cd8f6 Reverted 269104a0821b (Build imapc and pop3c always as plugins.)
Timo Sirainen <tss@iki.fi>
parents: 15379
diff changeset
280 AS_HELP_STRING([--with-storages], [Build with specified mail storage formats (mdbox sdbox maildir mbox cydir imapc pop3c)]), [
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
281 if test "$withval" = "yes" || test "$withval" = "no"; then
4005
450ee12c2e26 Give error if --with-storages or --without-storages is used without
Timo Sirainen <tss@iki.fi>
parents: 3997
diff changeset
282 AC_MSG_ERROR([--with-storages needs storage list as parameter])
450ee12c2e26 Give error if --with-storages or --without-storages is used without
Timo Sirainen <tss@iki.fi>
parents: 3997
diff changeset
283 fi
8398
d331b8fc8ba8 configure: Previous change broke shared storage completely.
Timo Sirainen <tss@iki.fi>
parents: 8392
diff changeset
284 mail_storages="shared `echo "$withval"|sed 's/,/ /g'`" ],
15380
7c75559cd8f6 Reverted 269104a0821b (Build imapc and pop3c always as plugins.)
Timo Sirainen <tss@iki.fi>
parents: 15379
diff changeset
285 mail_storages="shared mdbox sdbox maildir mbox cydir imapc pop3c")
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
286 AC_SUBST(mail_storages)
15380
7c75559cd8f6 Reverted 269104a0821b (Build imapc and pop3c always as plugins.)
Timo Sirainen <tss@iki.fi>
parents: 15379
diff changeset
287 mail_storages="$mail_storages raw fail"
13699
500bf1444ad6 configure: Don't reorder --with-storages values.
Timo Sirainen <tss@iki.fi>
parents: 13679
diff changeset
288 # drop duplicates
500bf1444ad6 configure: Don't reorder --with-storages values.
Timo Sirainen <tss@iki.fi>
parents: 13679
diff changeset
289 duplicates=`(for i in $mail_storages; do echo $i; done)|sort|uniq -d|xargs echo`
500bf1444ad6 configure: Don't reorder --with-storages values.
Timo Sirainen <tss@iki.fi>
parents: 13679
diff changeset
290 if test "$duplicates" != ""; then
500bf1444ad6 configure: Don't reorder --with-storages values.
Timo Sirainen <tss@iki.fi>
parents: 13679
diff changeset
291 AC_ERROR([Duplicate --with-storages: $duplicates])
500bf1444ad6 configure: Don't reorder --with-storages values.
Timo Sirainen <tss@iki.fi>
parents: 13679
diff changeset
292 fi
1404
54015ae11177 --with-storage=maildir,mbox can now be used to compile in only the wanted
Timo Sirainen <tss@iki.fi>
parents: 1403
diff changeset
293
12092
711b5f193f04 dovecot.m4: Added --with-moduledir and export dovecotdir
Timo Sirainen <tss@iki.fi>
parents: 12049
diff changeset
294 DC_DOVECOT_MODULEDIR
2070
0c8f884d1648 Added --with-moduledir configure option
Timo Sirainen <tss@iki.fi>
parents: 2036
diff changeset
295
3779
e87a8db60d25 Added --with-docs parameter to specify if documentation should be installed.
Timo Sirainen <tss@iki.fi>
parents: 3762
diff changeset
296 AC_ARG_WITH(docs,
12441
ae5b5961a6a7 configure: Use AS_HELP_STRING() macro.
Timo Sirainen <tss@iki.fi>
parents: 12439
diff changeset
297 AS_HELP_STRING([--with-docs], [Install documentation (default)]),
3779
e87a8db60d25 Added --with-docs parameter to specify if documentation should be installed.
Timo Sirainen <tss@iki.fi>
parents: 3762
diff changeset
298 if test x$withval = xno; then
e87a8db60d25 Added --with-docs parameter to specify if documentation should be installed.
Timo Sirainen <tss@iki.fi>
parents: 3762
diff changeset
299 want_docs=no
e87a8db60d25 Added --with-docs parameter to specify if documentation should be installed.
Timo Sirainen <tss@iki.fi>
parents: 3762
diff changeset
300 else
e87a8db60d25 Added --with-docs parameter to specify if documentation should be installed.
Timo Sirainen <tss@iki.fi>
parents: 3762
diff changeset
301 want_docs=yes
e87a8db60d25 Added --with-docs parameter to specify if documentation should be installed.
Timo Sirainen <tss@iki.fi>
parents: 3762
diff changeset
302 fi,
e87a8db60d25 Added --with-docs parameter to specify if documentation should be installed.
Timo Sirainen <tss@iki.fi>
parents: 3762
diff changeset
303 want_docs=yes)
e87a8db60d25 Added --with-docs parameter to specify if documentation should be installed.
Timo Sirainen <tss@iki.fi>
parents: 3762
diff changeset
304 AM_CONDITIONAL(BUILD_DOCS, test "$want_docs" = "yes")
e87a8db60d25 Added --with-docs parameter to specify if documentation should be installed.
Timo Sirainen <tss@iki.fi>
parents: 3762
diff changeset
305
9158
69aa6e878a59 configure: Removed --with-* parameters for passdbs/userdbs that don't require external libraries.
Timo Sirainen <tss@iki.fi>
parents: 9157
diff changeset
306 dnl always enable all of the passbs and userdbs that don't require extra libs
69aa6e878a59 configure: Removed --with-* parameters for passdbs/userdbs that don't require external libraries.
Timo Sirainen <tss@iki.fi>
parents: 9157
diff changeset
307 want_passwd=yes
69aa6e878a59 configure: Removed --with-* parameters for passdbs/userdbs that don't require external libraries.
Timo Sirainen <tss@iki.fi>
parents: 9157
diff changeset
308 want_passwd_file=yes
69aa6e878a59 configure: Removed --with-* parameters for passdbs/userdbs that don't require external libraries.
Timo Sirainen <tss@iki.fi>
parents: 9157
diff changeset
309 want_checkpassword=yes
69aa6e878a59 configure: Removed --with-* parameters for passdbs/userdbs that don't require external libraries.
Timo Sirainen <tss@iki.fi>
parents: 9157
diff changeset
310 want_prefetch_userdb=yes
69aa6e878a59 configure: Removed --with-* parameters for passdbs/userdbs that don't require external libraries.
Timo Sirainen <tss@iki.fi>
parents: 9157
diff changeset
311
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
312 AC_ISC_POSIX
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
313 AC_PROG_CC
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
314 AC_PROG_CPP
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
315 AC_PROG_CXX # lucene plugin needs this
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
316 AC_HEADER_STDC
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
317 AC_C_INLINE
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
318 AC_PROG_LIBTOOL
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
319 AM_ICONV
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
320
21343
003d74d026f3 configure: Define __STDC_LIMIT_MACROS for CXXFLAGS
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 21283
diff changeset
321 # SIZE_MAX is missing without this
003d74d026f3 configure: Define __STDC_LIMIT_MACROS for CXXFLAGS
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 21283
diff changeset
322 CXXFLAGS="$CXXFLAGS -D__STDC_LIMIT_MACROS"
003d74d026f3 configure: Define __STDC_LIMIT_MACROS for CXXFLAGS
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 21283
diff changeset
323
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
324 AC_DEFINE_UNQUOTED(DOVECOT_NAME, "$PACKAGE_NAME", [Dovecot name])
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
325 AC_DEFINE_UNQUOTED(DOVECOT_STRING, "$PACKAGE_STRING", [Dovecot string])
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
326 AC_DEFINE_UNQUOTED(DOVECOT_VERSION, "$PACKAGE_VERSION", [Dovecot version])
10645
928312d6017c config.h: Added DOVECOT_* macros for PACKAGE_* macros.
Timo Sirainen <tss@iki.fi>
parents: 10619
diff changeset
327
16180
e294e416f5ba Add macros DOVECOT_VERSION_{MAJOR,MINOR} to config.h to allow version checks in the preprocessor
Dennis Schridde <devurandom@gmx.net>
parents: 15809
diff changeset
328 AC_DEFINE([DOVECOT_VERSION_MAJOR], regexp(AC_PACKAGE_VERSION, [^\([0-9]+\)\.\([0-9]+\)], [\1]), [Dovecot major version])
e294e416f5ba Add macros DOVECOT_VERSION_{MAJOR,MINOR} to config.h to allow version checks in the preprocessor
Dennis Schridde <devurandom@gmx.net>
parents: 15809
diff changeset
329 AC_DEFINE([DOVECOT_VERSION_MINOR], regexp(AC_PACKAGE_VERSION, [^\([0-9]+\)\.\([0-9]+\)], [\2]), [Dovecot minor version])
e294e416f5ba Add macros DOVECOT_VERSION_{MAJOR,MINOR} to config.h to allow version checks in the preprocessor
Dennis Schridde <devurandom@gmx.net>
parents: 15809
diff changeset
330
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
331 AC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h malloc.h inttypes.h \
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
332 sys/uio.h sys/sysmacros.h sys/resource.h sys/select.h libgen.h \
15894
b3f890c4a41c quota-fs: Support NetBSD 6.0 libquota.
Timo Sirainen <tss@iki.fi>
parents: 15880
diff changeset
333 sys/quota.h sys/fs/ufs_quota.h ufs/ufs/quota.h jfs/quota.h \
b3f890c4a41c quota-fs: Support NetBSD 6.0 libquota.
Timo Sirainen <tss@iki.fi>
parents: 15880
diff changeset
334 quota.h sys/fs/quota_common.h \
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
335 mntent.h sys/mnttab.h sys/event.h sys/time.h sys/mkdev.h linux/dqblk_xfs.h \
9656
dc6d35b51b68 configure: Check sasl.h existence only when using --with-ldap.
Timo Sirainen <tss@iki.fi>
parents: 9655
diff changeset
336 xfs/xqm.h execinfo.h ucontext.h malloc_np.h sys/utsname.h sys/vmount.h \
14233
80688ab1ea3d Extends struct net_unix_cred with pid field and modifies net_getunixcred() to fill it in if possible.
Timo Sirainen <tss@iki.fi>
parents: 14217
diff changeset
337 sys/utsname.h glob.h linux/falloc.h ucred.h sys/ucred.h)
8517
451e3cf38290 configure: Handle --with-*=* consistently and give better error messages.
Timo Sirainen <tss@iki.fi>
parents: 8489
diff changeset
338
14101
671b637e20db configure: Avoid some unnecessary warnings with clang.
Timo Sirainen <tss@iki.fi>
parents: 14038
diff changeset
339 dnl * clang check
671b637e20db configure: Avoid some unnecessary warnings with clang.
Timo Sirainen <tss@iki.fi>
parents: 14038
diff changeset
340 have_clang=no
671b637e20db configure: Avoid some unnecessary warnings with clang.
Timo Sirainen <tss@iki.fi>
parents: 14038
diff changeset
341 if $CC -dM -E -x c /dev/null | grep __clang__ > /dev/null 2>&1; then
671b637e20db configure: Avoid some unnecessary warnings with clang.
Timo Sirainen <tss@iki.fi>
parents: 14038
diff changeset
342 have_clang=yes
671b637e20db configure: Avoid some unnecessary warnings with clang.
Timo Sirainen <tss@iki.fi>
parents: 14038
diff changeset
343 fi
671b637e20db configure: Avoid some unnecessary warnings with clang.
Timo Sirainen <tss@iki.fi>
parents: 14038
diff changeset
344
691
567f5e66c7b8 We compile now if dev_t is a structure (eg. glibc+tcc).
Timo Sirainen <tss@iki.fi>
parents: 679
diff changeset
345 dnl * gcc specific options
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
346 if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
4826
53ff1a59cdd5 Enable -Wstrict-aliasing=2 with gcc 4.
Timo Sirainen <tss@iki.fi>
parents: 4808
diff changeset
347 # -Wcast-qual -Wcast-align -Wconversion -Wunreachable-code # too many warnings
850
a6f53dbe803f Enable more warnings with gcc
Timo Sirainen <tss@iki.fi>
parents: 843
diff changeset
348 # -Wstrict-prototypes -Wredundant-decls # may give warnings in some systems
1043
cacabd33c68a Initial code for POP3 server. RETR isn't working right yet, there's some
Timo Sirainen <tss@iki.fi>
parents: 1022
diff changeset
349 # -Wmissing-format-attribute -Wmissing-noreturn -Wwrite-strings # a couple of warnings
4022
2f26567685ff Removed -Wstrict-aliasing=2 since it gives errors with older gccs
Timo Sirainen <tss@iki.fi>
parents: 4018
diff changeset
350 CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast"
3091
0704b595c873 Give -std=gnu99 option to gcc.
Timo Sirainen <tss@iki.fi>
parents: 3062
diff changeset
351
15935
4baf0183f13d Reverted the recent hash.h changes. Instead use -Wno-duplicate-decl-specifier with clang.
Timo Sirainen <tss@iki.fi>
parents: 15928
diff changeset
352 if test "$have_clang" = "yes"; then
4baf0183f13d Reverted the recent hash.h changes. Instead use -Wno-duplicate-decl-specifier with clang.
Timo Sirainen <tss@iki.fi>
parents: 15928
diff changeset
353 AC_TRY_COMPILE([
4baf0183f13d Reverted the recent hash.h changes. Instead use -Wno-duplicate-decl-specifier with clang.
Timo Sirainen <tss@iki.fi>
parents: 15928
diff changeset
354 #if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 3)
4baf0183f13d Reverted the recent hash.h changes. Instead use -Wno-duplicate-decl-specifier with clang.
Timo Sirainen <tss@iki.fi>
parents: 15928
diff changeset
355 # error new clang
4baf0183f13d Reverted the recent hash.h changes. Instead use -Wno-duplicate-decl-specifier with clang.
Timo Sirainen <tss@iki.fi>
parents: 15928
diff changeset
356 #endif
4baf0183f13d Reverted the recent hash.h changes. Instead use -Wno-duplicate-decl-specifier with clang.
Timo Sirainen <tss@iki.fi>
parents: 15928
diff changeset
357 ],,,[
4baf0183f13d Reverted the recent hash.h changes. Instead use -Wno-duplicate-decl-specifier with clang.
Timo Sirainen <tss@iki.fi>
parents: 15928
diff changeset
358 # clang 3.3+ unfortunately this gives warnings with hash.h
4baf0183f13d Reverted the recent hash.h changes. Instead use -Wno-duplicate-decl-specifier with clang.
Timo Sirainen <tss@iki.fi>
parents: 15928
diff changeset
359 CFLAGS="$CFLAGS -Wno-duplicate-decl-specifier"
4baf0183f13d Reverted the recent hash.h changes. Instead use -Wno-duplicate-decl-specifier with clang.
Timo Sirainen <tss@iki.fi>
parents: 15928
diff changeset
360 ])
4baf0183f13d Reverted the recent hash.h changes. Instead use -Wno-duplicate-decl-specifier with clang.
Timo Sirainen <tss@iki.fi>
parents: 15928
diff changeset
361 else
14101
671b637e20db configure: Avoid some unnecessary warnings with clang.
Timo Sirainen <tss@iki.fi>
parents: 14038
diff changeset
362 # This is simply to avoid warning when building strftime() wrappers..
671b637e20db configure: Avoid some unnecessary warnings with clang.
Timo Sirainen <tss@iki.fi>
parents: 14038
diff changeset
363 CFLAGS="$CFLAGS -fno-builtin-strftime"
671b637e20db configure: Avoid some unnecessary warnings with clang.
Timo Sirainen <tss@iki.fi>
parents: 14038
diff changeset
364 fi
13930
e0ff21d73630 configure: Add -fno-builtin-strftime flag with gcc to avoid warning.
Timo Sirainen <tss@iki.fi>
parents: 13907
diff changeset
365
4826
53ff1a59cdd5 Enable -Wstrict-aliasing=2 with gcc 4.
Timo Sirainen <tss@iki.fi>
parents: 4808
diff changeset
366 AC_TRY_COMPILE([
53ff1a59cdd5 Enable -Wstrict-aliasing=2 with gcc 4.
Timo Sirainen <tss@iki.fi>
parents: 4808
diff changeset
367 #if __GNUC__ < 4
53ff1a59cdd5 Enable -Wstrict-aliasing=2 with gcc 4.
Timo Sirainen <tss@iki.fi>
parents: 4808
diff changeset
368 # error old gcc
53ff1a59cdd5 Enable -Wstrict-aliasing=2 with gcc 4.
Timo Sirainen <tss@iki.fi>
parents: 4808
diff changeset
369 #endif
53ff1a59cdd5 Enable -Wstrict-aliasing=2 with gcc 4.
Timo Sirainen <tss@iki.fi>
parents: 4808
diff changeset
370 ],,[
53ff1a59cdd5 Enable -Wstrict-aliasing=2 with gcc 4.
Timo Sirainen <tss@iki.fi>
parents: 4808
diff changeset
371 # gcc4
53ff1a59cdd5 Enable -Wstrict-aliasing=2 with gcc 4.
Timo Sirainen <tss@iki.fi>
parents: 4808
diff changeset
372 CFLAGS="$CFLAGS -Wstrict-aliasing=2"
53ff1a59cdd5 Enable -Wstrict-aliasing=2 with gcc 4.
Timo Sirainen <tss@iki.fi>
parents: 4808
diff changeset
373 ])
53ff1a59cdd5 Enable -Wstrict-aliasing=2 with gcc 4.
Timo Sirainen <tss@iki.fi>
parents: 4808
diff changeset
374
3097
3ba362513202 Don't use -std=gnu99 if gcc doesn't support it.
Timo Sirainen <tss@iki.fi>
parents: 3091
diff changeset
375 # Use std=gnu99 if we have new enough gcc
3ba362513202 Don't use -std=gnu99 if gcc doesn't support it.
Timo Sirainen <tss@iki.fi>
parents: 3091
diff changeset
376 old_cflags=$CFLAGS
3ba362513202 Don't use -std=gnu99 if gcc doesn't support it.
Timo Sirainen <tss@iki.fi>
parents: 3091
diff changeset
377 CFLAGS="-std=gnu99"
3ba362513202 Don't use -std=gnu99 if gcc doesn't support it.
Timo Sirainen <tss@iki.fi>
parents: 3091
diff changeset
378 AC_TRY_COMPILE([
3ba362513202 Don't use -std=gnu99 if gcc doesn't support it.
Timo Sirainen <tss@iki.fi>
parents: 3091
diff changeset
379 ],, [
3ba362513202 Don't use -std=gnu99 if gcc doesn't support it.
Timo Sirainen <tss@iki.fi>
parents: 3091
diff changeset
380 CFLAGS="$CFLAGS $old_cflags"
3ba362513202 Don't use -std=gnu99 if gcc doesn't support it.
Timo Sirainen <tss@iki.fi>
parents: 3091
diff changeset
381 ], [
3ba362513202 Don't use -std=gnu99 if gcc doesn't support it.
Timo Sirainen <tss@iki.fi>
parents: 3091
diff changeset
382 CFLAGS="$old_cflags"
3ba362513202 Don't use -std=gnu99 if gcc doesn't support it.
Timo Sirainen <tss@iki.fi>
parents: 3091
diff changeset
383 ])
691
567f5e66c7b8 We compile now if dev_t is a structure (eg. glibc+tcc).
Timo Sirainen <tss@iki.fi>
parents: 679
diff changeset
384 fi
14101
671b637e20db configure: Avoid some unnecessary warnings with clang.
Timo Sirainen <tss@iki.fi>
parents: 14038
diff changeset
385 if test "$have_clang" = "yes"; then
13866
c682a5bf3de7 --enable-devel-checks: Use -fcatch-undefined-behavior -ftrapv with clang.
Timo Sirainen <tss@iki.fi>
parents: 13794
diff changeset
386 # clang specific options
c682a5bf3de7 --enable-devel-checks: Use -fcatch-undefined-behavior -ftrapv with clang.
Timo Sirainen <tss@iki.fi>
parents: 13794
diff changeset
387 if test "$want_devel_checks" = "yes"; then
15926
5be9659a2738 configure: Removed accidentally enabled clang -fsanitize options for now.
Timo Sirainen <tss@iki.fi>
parents: 15904
diff changeset
388 # FIXME: enable once md[45], sha[12] can be compiled without
5be9659a2738 configure: Removed accidentally enabled clang -fsanitize options for now.
Timo Sirainen <tss@iki.fi>
parents: 15904
diff changeset
389 #CFLAGS="$CFLAGS -fsanitize=integer,undefined -ftrapv"
15927
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
390 :
13866
c682a5bf3de7 --enable-devel-checks: Use -fcatch-undefined-behavior -ftrapv with clang.
Timo Sirainen <tss@iki.fi>
parents: 13794
diff changeset
391 fi
c682a5bf3de7 --enable-devel-checks: Use -fcatch-undefined-behavior -ftrapv with clang.
Timo Sirainen <tss@iki.fi>
parents: 13794
diff changeset
392 fi
691
567f5e66c7b8 We compile now if dev_t is a structure (eg. glibc+tcc).
Timo Sirainen <tss@iki.fi>
parents: 679
diff changeset
393
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
394 dnl **
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
395 dnl ** just some generic stuff...
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
396 dnl **
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
397
5690
c1f51c3510ca Simplify some checks with AC_SEARCH_LIBS()
Timo Sirainen <tss@iki.fi>
parents: 5681
diff changeset
398 AC_SEARCH_LIBS(socket, socket)
c1f51c3510ca Simplify some checks with AC_SEARCH_LIBS()
Timo Sirainen <tss@iki.fi>
parents: 5681
diff changeset
399 AC_SEARCH_LIBS(inet_addr, nsl)
c1f51c3510ca Simplify some checks with AC_SEARCH_LIBS()
Timo Sirainen <tss@iki.fi>
parents: 5681
diff changeset
400 AC_SEARCH_LIBS(fdatasync, rt, [
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
401 AC_DEFINE(HAVE_FDATASYNC,, [Define if you have fdatasync()])
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
402 ])
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
403
9538
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
404 if test $want_libcap != no; then
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
405 AC_CHECK_LIB(cap, cap_init, [
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
406 AC_DEFINE(HAVE_LIBCAP,, [libcap is installed for cap_init()])
9538
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
407 LIBCAP="-lcap"
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
408 AC_SUBST(LIBCAP)
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
409 ], [
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
410 if test "$want_libcap" = "yes"; then
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
411 AC_ERROR([Can't build with libcap support: libcap not found])
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
412 fi
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
413 ])
b20513ab8f5a Added --without-libcap configure option.
Daniel Mierswa <impulze@impulze.org>
parents: 9410
diff changeset
414 fi
5201
8920e744dac4 Drop privileges if libcap is found. Patch by David (lists edeca.net).
Timo Sirainen <tss@iki.fi>
parents: 5197
diff changeset
415
10647
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
416 have_libwrap=no
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
417 if test $want_libwrap != no; then
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
418 AC_CHECK_HEADER(tcpd.h, [
10700
b14e694fc8b4 configure: libwrap detection cleared $LIBS
Timo Sirainen <tss@iki.fi>
parents: 10699
diff changeset
419 old_LIBS=$LIBS
10980
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
420
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
421 AC_CACHE_CHECK([whether we have libwrap],i_cv_have_libwrap,[
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
422 AC_TRY_COMPILE([
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
423 #include <tcpd.h>
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
424 int allow_severity = 0;
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
425 int deny_severity = 0;
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
426 ], [
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
427 request_init((void *)0);
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
428 ], [
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
429 i_cv_have_libwrap=yes
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
430 ], [
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
431 i_cv_have_libwrap=no
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
432 ])
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
433 ])
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
434 if test $i_cv_have_libwrap = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
435 AC_DEFINE(HAVE_LIBWRAP,, [Define if you have libwrap])
10647
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
436 LIBWRAP_LIBS=-lwrap
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
437 AC_SUBST(LIBWRAP_LIBS)
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
438 have_libwrap=yes
10980
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
439 else
10647
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
440 if test "$want_libwrap" = "yes"; then
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
441 AC_ERROR([Can't build with libwrap support: libwrap not found])
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
442 fi
10980
5b0a88cb9a12 configure: Fixed libwrap checking in some systems.
Timo Sirainen <tss@iki.fi>
parents: 10968
diff changeset
443 fi
10647
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
444 LIBS=$old_LIBS
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
445 ], [
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
446 if test "$want_libwrap" = "yes"; then
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
447 AC_ERROR([Can't build with libwrap support: tcpd.h not found])
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
448 fi
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
449 ])
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
450 fi
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
451 AM_CONDITIONAL(TCPWRAPPERS, test "$have_libwrap" = "yes")
51a978045f47 Added support for tcpwrappers and potentially other login access checks.
Timo Sirainen <tss@iki.fi>
parents: 10645
diff changeset
452
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
453 AC_DEFINE(PACKAGE_WEBPAGE, "http://www.dovecot.org/", [Support URL])
7917
ca2ff54ee9b4 Added support for IMAP ID extension.
Timo Sirainen <tss@iki.fi>
parents: 7914
diff changeset
454
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
455 dnl * after -lsocket and -lnsl tests, inet_aton() may be in them
2103
879b0b9ed5d4 Separate mbox_locks/mbox_read_dotlock to mbox_read_locks and
Timo Sirainen <tss@iki.fi>
parents: 2080
diff changeset
456 AC_CHECK_FUNCS(fcntl flock lockf inet_aton sigaction getpagesize madvise \
8600
7c12e20f1eee env_remove(): Implement a fallback method if unsetenv() doesn't exist.
Timo Sirainen <tss@iki.fi>
parents: 8578
diff changeset
457 strcasecmp stricmp vsyslog writev pread uname unsetenv \
3237
2f57438d9542 Added setegid() emulation for HP-UX.
Timo Sirainen <tss@iki.fi>
parents: 3236
diff changeset
458 setrlimit setproctitle seteuid setreuid setegid setresgid \
19038
f8ab4f979e92 Removed all invocations of strtoll() and friends.
Stephan Bosch <stephan@rename-it.nl>
parents: 18996
diff changeset
459 getmntinfo setpriority quotactl getmntent kqueue kevent \
f8ab4f979e92 Removed all invocations of strtoll() and friends.
Stephan Bosch <stephan@rename-it.nl>
parents: 18996
diff changeset
460 backtrace_symbols walkcontext dirfd clearenv \
f8ab4f979e92 Removed all invocations of strtoll() and friends.
Stephan Bosch <stephan@rename-it.nl>
parents: 18996
diff changeset
461 malloc_usable_size glob fallocate posix_fadvise \
20037
c27f1eac85b7 lib: Implement utc_mktime() with timegm() if it exists.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20031
diff changeset
462 getpeereid getpeerucred inotify_init timegm)
9655
cef143e8719d configure: Use -lrt for clock_gettime() if necessary.
Timo Sirainen <tss@iki.fi>
parents: 9654
diff changeset
463
16346
139ab37f69df configure: Fixed checking for struct sockpeercred with OpenBSD <5.3
Timo Sirainen <tss@iki.fi>
parents: 16309
diff changeset
464 AC_CHECK_TYPES([struct sockpeercred],,,[
139ab37f69df configure: Fixed checking for struct sockpeercred with OpenBSD <5.3
Timo Sirainen <tss@iki.fi>
parents: 16309
diff changeset
465 #include <sys/types.h>
139ab37f69df configure: Fixed checking for struct sockpeercred with OpenBSD <5.3
Timo Sirainen <tss@iki.fi>
parents: 16309
diff changeset
466 #include <sys/socket.h>
139ab37f69df configure: Fixed checking for struct sockpeercred with OpenBSD <5.3
Timo Sirainen <tss@iki.fi>
parents: 16309
diff changeset
467 ])
14233
80688ab1ea3d Extends struct net_unix_cred with pid field and modifies net_getunixcred() to fill it in if possible.
Timo Sirainen <tss@iki.fi>
parents: 14217
diff changeset
468
15493
ac63858cbe5f configure: Use -lrt for check_gettime() only if needed.
Timo Sirainen <tss@iki.fi>
parents: 15406
diff changeset
469 AC_SEARCH_LIBS(clock_gettime, rt, [
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
470 AC_DEFINE(HAVE_CLOCK_GETTIME,, [Define if you have the clock_gettime function])
9655
cef143e8719d configure: Use -lrt for clock_gettime() if necessary.
Timo Sirainen <tss@iki.fi>
parents: 9654
diff changeset
471 ])
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
472
15927
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
473 AC_CACHE_CHECK([for typeof],i_cv_have_typeof,[
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
474 AC_TRY_COMPILE([
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
475 ], [
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
476 int foo;
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
477 typeof(foo) bar;
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
478 ], [
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
479 i_cv_have_typeof=yes
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
480 ], [
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
481 i_cv_have_typeof=no
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
482 ])
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
483 ])
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
484 if test $i_cv_have_typeof = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
485 AC_DEFINE(HAVE_TYPEOF,, [Define if you have typeof()])
15927
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
486 fi
61508a42a44b configure: Fix previous commit & implement AC_C_TYPEOF ourself.
Timo Sirainen <tss@iki.fi>
parents: 15926
diff changeset
487
2569
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
488 dnl * I/O loop function
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
489 have_ioloop=no
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
490
4482
f60b07bd5fa7 --with-ioloop=auto changed to --with-ioloop=best
Timo Sirainen <tss@iki.fi>
parents: 4478
diff changeset
491 if test "$ioloop" = "best" || test "$ioloop" = "epoll"; then
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
492 AC_CACHE_CHECK([whether we can use epoll],i_cv_epoll_works,[
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
493 AC_TRY_RUN([
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
494 #include <sys/epoll.h>
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
495
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
496 int main()
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
497 {
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
498 return epoll_create(5) < 1;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
499 }
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
500 ], [
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
501 i_cv_epoll_works=yes
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
502 ], [
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
503 i_cv_epoll_works=no
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
504 ])
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
505 ])
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
506 if test $i_cv_epoll_works = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
507 AC_DEFINE(IOLOOP_EPOLL,, [Implement I/O loop with Linux 2.6 epoll()])
2569
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
508 have_ioloop=yes
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
509 ioloop=epoll
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
510 else
4478
4b01707d6cbe Don't use epoll/kqueue by default unless --with-ioloop=auto is given.
Timo Sirainen <tss@iki.fi>
parents: 4443
diff changeset
511 if test "$ioloop" = "epoll" ; then
4b01707d6cbe Don't use epoll/kqueue by default unless --with-ioloop=auto is given.
Timo Sirainen <tss@iki.fi>
parents: 4443
diff changeset
512 AC_MSG_ERROR([epoll ioloop requested but epoll_create() is not available])
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
513 fi
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
514 fi
2569
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
515 fi
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
516
4482
f60b07bd5fa7 --with-ioloop=auto changed to --with-ioloop=best
Timo Sirainen <tss@iki.fi>
parents: 4478
diff changeset
517 if test "$ioloop" = "best" || test "$ioloop" = "kqueue"; then
4433
Timo Sirainen <tss@iki.fi>
parents: 4426
diff changeset
518 if test "$ac_cv_func_kqueue" = yes && test "$ac_cv_func_kevent" = yes; then
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
519 AC_DEFINE(IOLOOP_KQUEUE,, [Implement I/O loop with BSD kqueue()])
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
520 ioloop=kqueue
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
521 have_ioloop=yes
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
522 elif test "$ioloop" = "kqueue"; then
4478
4b01707d6cbe Don't use epoll/kqueue by default unless --with-ioloop=auto is given.
Timo Sirainen <tss@iki.fi>
parents: 4443
diff changeset
523 AC_MSG_ERROR([kqueue ioloop requested but kqueue() is not available])
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
524 fi
3749
194295062e5e Added kqueue support. Patch by Vaclav Haisman.
Timo Sirainen <tss@iki.fi>
parents: 3745
diff changeset
525 fi
194295062e5e Added kqueue support. Patch by Vaclav Haisman.
Timo Sirainen <tss@iki.fi>
parents: 3745
diff changeset
526
4482
f60b07bd5fa7 --with-ioloop=auto changed to --with-ioloop=best
Timo Sirainen <tss@iki.fi>
parents: 4478
diff changeset
527 if test "$ioloop" = "best" || test "$ioloop" = "poll"; then
2569
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
528 AC_CHECK_FUNC(poll, [
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
529 AC_DEFINE(IOLOOP_POLL,, [Implement I/O loop with poll()])
2569
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
530 ioloop=poll
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
531 have_ioloop=yes
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
532 ])
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
533 fi
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
534
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
535 if test "$have_ioloop" = "no"; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
536 AC_DEFINE(IOLOOP_SELECT,, [Implement I/O loop with select()])
2569
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
537 ioloop="select"
554f1324a435 Added epoll support if --with-ioloop=epoll is given. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2538
diff changeset
538 fi
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
539
3745
840cc63e439b Don't allow giving invalid notify methods in --with-notify
Timo Sirainen <tss@iki.fi>
parents: 3744
diff changeset
540 have_notify=none
3482
465c465c66be Added inotify patch by Johannes Berg and did some restructuring to
Timo Sirainen <tss@iki.fi>
parents: 3452
diff changeset
541
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
542 if test "$notify" = "" || test "$notify" = "inotify" ; then
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
543 dnl * inotify?
17455
0d2824d5088d configure: Don't actually run the test to see if inotify works.
Timo Sirainen <tss@iki.fi>
parents: 17454
diff changeset
544 AC_MSG_CHECKING([whether we can use inotify])
0d2824d5088d configure: Don't actually run the test to see if inotify works.
Timo Sirainen <tss@iki.fi>
parents: 17454
diff changeset
545 if test "$ac_cv_func_inotify_init" = yes; then
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
546 have_notify=inotify
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
547 notify=inotify
17455
0d2824d5088d configure: Don't actually run the test to see if inotify works.
Timo Sirainen <tss@iki.fi>
parents: 17454
diff changeset
548 AC_MSG_RESULT("yes")
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
549 AC_DEFINE(IOLOOP_NOTIFY_INOTIFY,, [Use Linux inotify])
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
550 else
17455
0d2824d5088d configure: Don't actually run the test to see if inotify works.
Timo Sirainen <tss@iki.fi>
parents: 17454
diff changeset
551 AC_MSG_RESULT("no")
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
552 if test "$notify" = "inotify"; then
4478
4b01707d6cbe Don't use epoll/kqueue by default unless --with-ioloop=auto is given.
Timo Sirainen <tss@iki.fi>
parents: 4443
diff changeset
553 AC_MSG_ERROR([inotify requested but not available])
4423
26d18749f718 Fixes to io notify detection. Patch by Marcus Rueckert
Timo Sirainen <tss@iki.fi>
parents: 4422
diff changeset
554 notify=""
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
555 fi
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
556 fi
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
557 fi
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
558
4572
046b985ed767 Use notify=kqueue automatically only if ioloop=kqueue.
Timo Sirainen <tss@iki.fi>
parents: 4571
diff changeset
559 if (test "$notify" = "" && test "$ioloop" = kqueue) || test "$notify" = "kqueue"; then
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
560 dnl * BSD kqueue() notify
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
561 AC_MSG_CHECKING([whether we can use BSD kqueue() notify])
4442
9eee24bf2960 Fix kqueue notify checking.
Timo Sirainen <tss@iki.fi>
parents: 4433
diff changeset
562 if test "$ac_cv_func_kqueue" = yes && test "$ac_cv_func_kevent" = yes ; then
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
563 have_notify=kqueue
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
564 notify=kqueue
4423
26d18749f718 Fixes to io notify detection. Patch by Marcus Rueckert
Timo Sirainen <tss@iki.fi>
parents: 4422
diff changeset
565 AC_MSG_RESULT("yes")
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
566 AC_DEFINE(IOLOOP_NOTIFY_KQUEUE,, [Use BSD kqueue directory changes notificaton])
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
567 else
4423
26d18749f718 Fixes to io notify detection. Patch by Marcus Rueckert
Timo Sirainen <tss@iki.fi>
parents: 4422
diff changeset
568 AC_MSG_RESULT("no")
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
569 if test "$notify" = "kqueue" ; then
4478
4b01707d6cbe Don't use epoll/kqueue by default unless --with-ioloop=auto is given.
Timo Sirainen <tss@iki.fi>
parents: 4443
diff changeset
570 AC_MSG_ERROR([kqueue notify requested but kqueue() is not available])
4423
26d18749f718 Fixes to io notify detection. Patch by Marcus Rueckert
Timo Sirainen <tss@iki.fi>
parents: 4422
diff changeset
571 notify=""
4386
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
572 fi
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
573 fi
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
574 fi
e23469650c85 Better detection for ioloop and notify methods. Patch by Roy Marples
Timo Sirainen <tss@iki.fi>
parents: 4349
diff changeset
575
3745
840cc63e439b Don't allow giving invalid notify methods in --with-notify
Timo Sirainen <tss@iki.fi>
parents: 3744
diff changeset
576 if test "$have_notify" = "none"; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
577 AC_DEFINE(IOLOOP_NOTIFY_NONE,, [No special notify support])
3482
465c465c66be Added inotify patch by Johannes Berg and did some restructuring to
Timo Sirainen <tss@iki.fi>
parents: 3452
diff changeset
578 fi
1729
5bf22d6bb65e Added IO_DIR_NOTIFY and IO_FILE_NOTIFY conditions to io_add(). IO_DIR_NOTIFY
Timo Sirainen <tss@iki.fi>
parents: 1720
diff changeset
579
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
580 AC_CACHE_CHECK([whether we have glibc],i_cv_have_glibc,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
581 AC_TRY_COMPILE([
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
582 #include <stdlib.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
583 #ifdef __GLIBC__
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
584 we have glibc
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
585 #endif
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
586 ],, [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
587 i_cv_have_glibc=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
588 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
589 i_cv_have_glibc=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
590 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
591 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
592 if test "$i_cv_have_glibc" = "yes"; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
593 AC_DEFINE(PREAD_WRAPPERS,, [Define if pread/pwrite needs _XOPEN_SOURCE 500])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
594 fi
1989
a2b009c65e02 Define PREAD_WRAPPERS if we're using GLIBC, not if we're using Linux.
Timo Sirainen <tss@iki.fi>
parents: 1978
diff changeset
595
7164
d349cdeddc7d Don't use posix_fallocate() with GLIBC versions older than 2.7. It probably
Timo Sirainen <tss@iki.fi>
parents: 7094
diff changeset
596 dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it.
8227
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
597 dnl * It may also be broken in AIX.
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
598 AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
599 AC_TRY_RUN([
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
600 #define _XOPEN_SOURCE 600
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
601 #include <stdio.h>
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
602 #include <stdlib.h>
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
603 #include <fcntl.h>
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
604 #include <unistd.h>
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
605 #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7)
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
606 possibly broken posix_fallocate
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
607 #endif
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
608 int main() {
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
609 int fd = creat("conftest.temp", 0600);
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
610 int ret;
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
611 if (fd == -1) {
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
612 perror("creat()");
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
613 return 2;
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
614 }
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
615 ret = posix_fallocate(fd, 1024, 1024) < 0 ? 1 : 0;
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
616 unlink("conftest.temp");
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
617 return ret;
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
618 }
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
619 ], [
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
620 i_cv_posix_fallocate_works=yes
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
621 ], [
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
622 i_cv_posix_fallocate_works=no
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
623 ])
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
624 ])
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
625 if test $i_cv_posix_fallocate_works = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
626 AC_DEFINE(HAVE_POSIX_FALLOCATE,, [Define if you have a working posix_fallocate()])
8227
9886bf0a4c40 Test if posix_fallocate() works already in configure.
Timo Sirainen <tss@iki.fi>
parents: 8226
diff changeset
627 fi
7164
d349cdeddc7d Don't use posix_fallocate() with GLIBC versions older than 2.7. It probably
Timo Sirainen <tss@iki.fi>
parents: 7094
diff changeset
628
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
629 dnl * OS specific options
10753
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents: 10702
diff changeset
630 DC_PLUGIN_DEPS
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
631 case "$host_os" in
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
632 hpux*)
7823
b13dca205eaa HP-UX: Fixed fd passing.
Timo Sirainen <tss@iki.fi>
parents: 7822
diff changeset
633 CFLAGS="$CFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED"
b13dca205eaa HP-UX: Fixed fd passing.
Timo Sirainen <tss@iki.fi>
parents: 7822
diff changeset
634 # for getting fd_send/fd_recv working:
b13dca205eaa HP-UX: Fixed fd passing.
Timo Sirainen <tss@iki.fi>
parents: 7822
diff changeset
635 LDFLAGS="$LDFLAGS -Wl,+b,:"
b13dca205eaa HP-UX: Fixed fd passing.
Timo Sirainen <tss@iki.fi>
parents: 7822
diff changeset
636 LIBS="-lxnet $LIBS"
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
637 AC_DEFINE(PREAD_BROKEN,, [Define if pread/pwrite implementation is broken])
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
638 ;;
11356
348eb4754085 Added process title hack support for OS X.
Timo Sirainen <tss@iki.fi>
parents: 11321
diff changeset
639 linux*|darwin*)
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
640 AC_DEFINE(PROCTITLE_HACK,, [Define if process title can be changed by modifying argv])
10188
affb52c62add Fixed Linux proctitle hack and enabled it by default now.
Timo Sirainen <tss@iki.fi>
parents: 10163
diff changeset
641 ;;
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
642 *)
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
643 ;;
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
644 esac
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
645
55
db8ea2c11ab7 whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents: 50
diff changeset
646 AC_CHECK_SIZEOF(int)
db8ea2c11ab7 whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents: 50
diff changeset
647 AC_CHECK_SIZEOF(long)
464
c634b705f24b Removed several useless handers of printf_string_upper_bound(), and added a
Timo Sirainen <tss@iki.fi>
parents: 439
diff changeset
648 AC_CHECK_SIZEOF(void *)
55
db8ea2c11ab7 whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents: 50
diff changeset
649 AC_CHECK_SIZEOF(long long)
185
60925d3e2c4d fixed ssize_t and off_t checks.
Timo Sirainen <tss@iki.fi>
parents: 183
diff changeset
650
2036
b3a56463c812 AC_DEFUN warning fixes for aclocal 1.8..
Timo Sirainen <tss@iki.fi>
parents: 2035
diff changeset
651 AC_DEFUN([AC_TYPEOF], [
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
652 dnl * first check if we can get the size with redefining typedefs
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
653
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
654 order="$2"
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
655 if test "$2" = ""; then
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
656 order="int long long-long"
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
657 fi
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
658
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
659 result=""
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
660 visible="unknown"
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
661 AC_MSG_CHECKING([type of $1])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
662 AC_CACHE_VAL(i_cv_typeof_$1,[
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
663 if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
664 dnl * try with printf() + -Werror
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
665 old_CFLAGS="$CFLAGS"
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
666 CFLAGS="$CFLAGS -Werror"
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
667
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
668 for type in $order; do
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
669 case "$type" in
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
670 int)
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
671 fmt="%d"
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
672 ;;
1630
e9e533b323fb size_t checking fixes
Timo Sirainen <tss@iki.fi>
parents: 1626
diff changeset
673 unsigned-int)
e9e533b323fb size_t checking fixes
Timo Sirainen <tss@iki.fi>
parents: 1626
diff changeset
674 fmt="%u"
e9e533b323fb size_t checking fixes
Timo Sirainen <tss@iki.fi>
parents: 1626
diff changeset
675 ;;
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
676 long)
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
677 fmt="%ld"
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
678 ;;
1630
e9e533b323fb size_t checking fixes
Timo Sirainen <tss@iki.fi>
parents: 1626
diff changeset
679 unsigned-long)
e9e533b323fb size_t checking fixes
Timo Sirainen <tss@iki.fi>
parents: 1626
diff changeset
680 fmt="%lu"
e9e533b323fb size_t checking fixes
Timo Sirainen <tss@iki.fi>
parents: 1626
diff changeset
681 ;;
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
682 long-long)
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
683 fmt="%lld"
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
684 ;;
1630
e9e533b323fb size_t checking fixes
Timo Sirainen <tss@iki.fi>
parents: 1626
diff changeset
685 unsigned-long-long)
e9e533b323fb size_t checking fixes
Timo Sirainen <tss@iki.fi>
parents: 1626
diff changeset
686 fmt="%llu"
e9e533b323fb size_t checking fixes
Timo Sirainen <tss@iki.fi>
parents: 1626
diff changeset
687 ;;
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
688 *)
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
689 fmt=""
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
690 ;;
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
691 esac
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
692
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
693 if test "$fmt" != ""; then
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
694 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
695 #include <sys/types.h>
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
696 #include <stdio.h>
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
697 ]], [[
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
698 printf("$fmt", ($1)0);
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
699 ]])],[
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
700 if test "$result" != ""; then
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
701 dnl * warning check isn't working
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
702 result=""
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
703 visible="unknown"
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
704 break
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
705 fi
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
706 result="`echo $type|sed 's/-/ /g'`"
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
707 visible="$result"
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
708 ],[])
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
709 fi
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
710 done
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
711 CFLAGS="$old_CFLAGS"
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
712 fi
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
713
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
714 if test "$result" = ""; then
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
715 for type in $order; do
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
716 type="`echo $type|sed 's/-/ /g'`"
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
717 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
718 #include <sys/types.h>
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
719 typedef $type $1;
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
720 ]], [[]])],[
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
721 if test "$result" != ""; then
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
722 dnl * compiler allows redefining to anything
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
723 result=""
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
724 visible="unknown"
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
725 break
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
726 fi
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
727 result="$type"
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
728 visible="$type"
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
729 ],[])
733
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
730 done
280c0952fa90 AC_TYPEOF macro: with gcc we can check the type with printf() + -Werror
Timo Sirainen <tss@iki.fi>
parents: 732
diff changeset
731 fi
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
732
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
733 if test "$result" = ""; then
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
734 dnl * check with sizes
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
735
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
736 dnl * older autoconfs don't include sys/types.h, so do it manually
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
737 AC_RUN_IFELSE([AC_LANG_SOURCE([[
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
738 #include <stdio.h>
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
739 #include <sys/types.h>
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
740 int main() {
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
741 FILE *f=fopen("conftestval", "w");
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
742 if (!f) exit(1);
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
743 fprintf(f, "%d\n", sizeof($1));
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
744 exit(0);
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
745 }
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
746 ]])],[
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
747 size=`cat conftestval`
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
748 rm -f conftestval
55
db8ea2c11ab7 whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents: 50
diff changeset
749
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
750 for type in $order; do
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
751 actype="ac_cv_sizeof_`echo $type|sed 's/-/_/g'`"
4567
32f5df3de2d1 eval doesn't need to have its parameters quoted. The previous \" quoting was
Timo Sirainen <tss@iki.fi>
parents: 4565
diff changeset
752 if test "$size" = "`eval echo \\$$actype`"; then
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
753 result="`echo $type|sed 's/-/ /g'`"
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
754 visible="`expr $size \* 8`bit (using $result)"
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
755 break
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
756 fi
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
757 done
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
758 if test "$result" = ""; then
4055
f7ff79c3189b If size_t and ssize_t exist but we can't figure out their type, don't
Timo Sirainen <tss@iki.fi>
parents: 4050
diff changeset
759 result=unknown
f7ff79c3189b If size_t and ssize_t exist but we can't figure out their type, don't
Timo Sirainen <tss@iki.fi>
parents: 4050
diff changeset
760 visible="`expr $size \* 8`bit (unknown type)"
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
761 fi
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
762 ],[],[])
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
763 fi
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
764 i_cv_typeof_$1=$result/$visible
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
765 ])
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
766
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
767 typeof_$1=`echo $i_cv_typeof_$1 | sed s,/.*$,,`
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
768 visible=`echo $i_cv_typeof_$1 | sed s,^.*/,,`
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
769 AC_MSG_RESULT($visible)
185
60925d3e2c4d fixed ssize_t and off_t checks.
Timo Sirainen <tss@iki.fi>
parents: 183
diff changeset
770 ])
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
771
6616
be366eda336e Use AC_SYS_LARGEFILE instead of our own checks. Also removes
Timo Sirainen <tss@iki.fi>
parents: 6610
diff changeset
772 AC_SYS_LARGEFILE
3929
49a1a979959e If uoff_t type already exists, use it (UnixWare has it).
Timo Sirainen <tss@iki.fi>
parents: 3919
diff changeset
773 AC_CHECK_TYPES(_Bool)
49a1a979959e If uoff_t type already exists, use it (UnixWare has it).
Timo Sirainen <tss@iki.fi>
parents: 3919
diff changeset
774
49a1a979959e If uoff_t type already exists, use it (UnixWare has it).
Timo Sirainen <tss@iki.fi>
parents: 3919
diff changeset
775 AC_CHECK_TYPE(uoff_t, [
3931
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
776 have_uoff_t=yes
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
777 AC_DEFINE(HAVE_UOFF_T,, [Define if you have a native uoff_t type])
3929
49a1a979959e If uoff_t type already exists, use it (UnixWare has it).
Timo Sirainen <tss@iki.fi>
parents: 3919
diff changeset
778 ], [
3931
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
779 have_uoff_t=no
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
780 ])
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
781
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
782 AC_TYPEOF(off_t, long int long-long)
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
783 case "$typeof_off_t" in
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
784 int)
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
785 offt_max=INT_MAX
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
786 uofft_fmt="u"
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
787 if test "$have_uoff_t" != "yes"; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
788 AC_DEFINE(UOFF_T_INT,, [Define if off_t is int])
3931
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
789 fi
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
790 offt_bits=`expr 8 \* $ac_cv_sizeof_int`
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
791 ;;
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
792 long)
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
793 offt_max=LONG_MAX
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
794 uofft_fmt="lu"
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
795 if test "$have_uoff_t" != "yes"; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
796 AC_DEFINE(UOFF_T_LONG,, [Define if off_t is long])
3931
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
797 fi
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
798 offt_bits=`expr 8 \* $ac_cv_sizeof_long`
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
799 ;;
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
800 "long long")
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
801 offt_max=LLONG_MAX
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
802 uofft_fmt="llu"
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
803 if test "$have_uoff_t" != "yes"; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
804 AC_DEFINE(UOFF_T_LONG_LONG,, [Define if off_t is long long])
3931
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
805 fi
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
806 offt_bits=`expr 8 \* $ac_cv_sizeof_long_long`
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
807 ;;
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
808 *)
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
809 AC_MSG_ERROR([Unsupported off_t type])
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
810 ;;
d37797a229c3 And fix for uoff_t checks..
Timo Sirainen <tss@iki.fi>
parents: 3929
diff changeset
811 esac
50
d493b9cc265e Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents: 5
diff changeset
812
2078
b3daf55df932 Added maildir_stat_dirs option.
Timo Sirainen <tss@iki.fi>
parents: 2070
diff changeset
813 dnl * Do we have struct dirent->d_type
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
814 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2078
b3daf55df932 Added maildir_stat_dirs option.
Timo Sirainen <tss@iki.fi>
parents: 2070
diff changeset
815 #include <dirent.h>
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
816 ]], [[
2078
b3daf55df932 Added maildir_stat_dirs option.
Timo Sirainen <tss@iki.fi>
parents: 2070
diff changeset
817 struct dirent d;
b3daf55df932 Added maildir_stat_dirs option.
Timo Sirainen <tss@iki.fi>
parents: 2070
diff changeset
818 d.d_type = DT_DIR;
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
819 ]])],[
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
820 AC_DEFINE(HAVE_DIRENT_D_TYPE,, [Define if you have struct dirent->d_type])
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
821 ],[])
2078
b3daf55df932 Added maildir_stat_dirs option.
Timo Sirainen <tss@iki.fi>
parents: 2070
diff changeset
822
1382
c4d519a6395d Don't define OFF_T_MAX if it's already defined
Timo Sirainen <tss@iki.fi>
parents: 1341
diff changeset
823 dnl * Do we have OFF_T_MAX?
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
824 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1382
c4d519a6395d Don't define OFF_T_MAX if it's already defined
Timo Sirainen <tss@iki.fi>
parents: 1341
diff changeset
825 #include <limits.h>
c4d519a6395d Don't define OFF_T_MAX if it's already defined
Timo Sirainen <tss@iki.fi>
parents: 1341
diff changeset
826 #include <sys/types.h>
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
827 ]], [[
1382
c4d519a6395d Don't define OFF_T_MAX if it's already defined
Timo Sirainen <tss@iki.fi>
parents: 1341
diff changeset
828 off_t i = OFF_T_MAX;
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
829 ]])],[
1403
Timo Sirainen <tss@iki.fi>
parents: 1394
diff changeset
830 :
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
831 ],[
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
832 AC_DEFINE_UNQUOTED(OFF_T_MAX, $offt_max, [Maximum value of off_t])
1382
c4d519a6395d Don't define OFF_T_MAX if it's already defined
Timo Sirainen <tss@iki.fi>
parents: 1341
diff changeset
833 ])
c4d519a6395d Don't define OFF_T_MAX if it's already defined
Timo Sirainen <tss@iki.fi>
parents: 1341
diff changeset
834
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
835 AC_DEFINE_UNQUOTED(PRIuUOFF_T, "$uofft_fmt", [printf() format for uoff_t])
742
b3dd87844fff acconfig.h is deprecated with autoconf 2.5, changed configure to contain
Timo Sirainen <tss@iki.fi>
parents: 739
diff changeset
836
750
b97c8964d7c1 Give a hard warning if size_t is signed.
Timo Sirainen <tss@iki.fi>
parents: 745
diff changeset
837 dnl * make sure size_t isn't signed. we'd probably work fine with it, but
b97c8964d7c1 Give a hard warning if size_t is signed.
Timo Sirainen <tss@iki.fi>
parents: 745
diff changeset
838 dnl * it's more likely vulnerable to buffer overflows. Anyway, C99 specifies
b97c8964d7c1 Give a hard warning if size_t is signed.
Timo Sirainen <tss@iki.fi>
parents: 745
diff changeset
839 dnl * that it's unsigned and only some old systems define it as signed.
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
840 AC_CACHE_CHECK([whether size_t is signed],i_cv_signed_size_t,[
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
841 AC_RUN_IFELSE([AC_LANG_SOURCE([[
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
842 #include <sys/types.h>
21283
16869cca53ce configure: Fix some implicit function declarations
Paul Howarth <paul@city-fan.org>
parents: 21271
diff changeset
843 #include <stdlib.h>
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
844 int main() {
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
845 /* return 0 if we're signed */
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
846 exit((size_t)(int)-1 <= 0 ? 0 : 1);
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
847 }
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
848 ]])],[
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
849 i_cv_signed_size_t=yes
750
b97c8964d7c1 Give a hard warning if size_t is signed.
Timo Sirainen <tss@iki.fi>
parents: 745
diff changeset
850
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
851 echo
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
852 echo "Your system's size_t is a signed integer, Dovecot isn't designed to"
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
853 echo "support it. It probably works just fine, but it's less resistant to"
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
854 echo "buffer overflows. If you're not worried about this and still want to"
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
855 echo "compile Dovecot, set ignore_signed_size=1 environment."
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
856
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
857 if test "$ignore_signed_size" = ""; then
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
858 AC_MSG_ERROR([aborting])
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
859 fi
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
860 echo "..ignoring as requested.."
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
861 ],[
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
862 i_cv_signed_size_t=no
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
863 ],[])
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
864 ])
1626
08b73ec005f8 Get the size_t type properly in OSX
Timo Sirainen <tss@iki.fi>
parents: 1625
diff changeset
865 dnl Note: we check size_t rather than ssize_t here, because on OSX 10.2
08b73ec005f8 Get the size_t type properly in OSX
Timo Sirainen <tss@iki.fi>
parents: 1625
diff changeset
866 dnl ssize_t = int and size_t = unsigned long. We're mostly concerned about
08b73ec005f8 Get the size_t type properly in OSX
Timo Sirainen <tss@iki.fi>
parents: 1625
diff changeset
867 dnl printf format here, so check the size_t one.
08b73ec005f8 Get the size_t type properly in OSX
Timo Sirainen <tss@iki.fi>
parents: 1625
diff changeset
868 AC_TYPEOF(size_t, unsigned-int unsigned-long unsigned-long-long)
08b73ec005f8 Get the size_t type properly in OSX
Timo Sirainen <tss@iki.fi>
parents: 1625
diff changeset
869 case "$typeof_size_t" in
08b73ec005f8 Get the size_t type properly in OSX
Timo Sirainen <tss@iki.fi>
parents: 1625
diff changeset
870 "unsigned long")
742
b3dd87844fff acconfig.h is deprecated with autoconf 2.5, changed configure to contain
Timo Sirainen <tss@iki.fi>
parents: 739
diff changeset
871 ssizet_max=LONG_MAX
b3dd87844fff acconfig.h is deprecated with autoconf 2.5, changed configure to contain
Timo Sirainen <tss@iki.fi>
parents: 739
diff changeset
872 sizet_fmt="lu"
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
873 ;;
1626
08b73ec005f8 Get the size_t type properly in OSX
Timo Sirainen <tss@iki.fi>
parents: 1625
diff changeset
874 "unsigned long long")
742
b3dd87844fff acconfig.h is deprecated with autoconf 2.5, changed configure to contain
Timo Sirainen <tss@iki.fi>
parents: 739
diff changeset
875 ssizet_max=LLONG_MAX
b3dd87844fff acconfig.h is deprecated with autoconf 2.5, changed configure to contain
Timo Sirainen <tss@iki.fi>
parents: 739
diff changeset
876 sizet_fmt="llu"
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
877 ;;
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
878 *)
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
879 dnl older systems didn't have ssize_t, default to int
742
b3dd87844fff acconfig.h is deprecated with autoconf 2.5, changed configure to contain
Timo Sirainen <tss@iki.fi>
parents: 739
diff changeset
880 ssizet_max=INT_MAX
b3dd87844fff acconfig.h is deprecated with autoconf 2.5, changed configure to contain
Timo Sirainen <tss@iki.fi>
parents: 739
diff changeset
881 sizet_fmt="u"
b3dd87844fff acconfig.h is deprecated with autoconf 2.5, changed configure to contain
Timo Sirainen <tss@iki.fi>
parents: 739
diff changeset
882
1626
08b73ec005f8 Get the size_t type properly in OSX
Timo Sirainen <tss@iki.fi>
parents: 1625
diff changeset
883 if test "$typeof_size_t" = ""; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
884 AC_DEFINE(size_t, unsigned int, [Define to 'unsigned int' if you don't have it])
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
885 AC_DEFINE(ssize_t, int, [Define to 'int' if you don't have it])
742
b3dd87844fff acconfig.h is deprecated with autoconf 2.5, changed configure to contain
Timo Sirainen <tss@iki.fi>
parents: 739
diff changeset
886 fi
677
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
887 ;;
3089685bbb7e Created AC_TYPEOF() which tells what base type (int/long/long long) the
Timo Sirainen <tss@iki.fi>
parents: 676
diff changeset
888 esac
183
4a7ab9e94f25 size_t fixes for lib/. Changed OFF_T_FORMAT to PRIuOFF_T which is more
Timo Sirainen <tss@iki.fi>
parents: 179
diff changeset
889
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
890 AC_DEFINE_UNQUOTED(SSIZE_T_MAX, $ssizet_max, [Maximum value of ssize_t])
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
891 AC_DEFINE_UNQUOTED(PRIuSIZE_T, "$sizet_fmt", [printf() format for size_t])
742
b3dd87844fff acconfig.h is deprecated with autoconf 2.5, changed configure to contain
Timo Sirainen <tss@iki.fi>
parents: 739
diff changeset
892
2036
b3a56463c812 AC_DEFUN warning fixes for aclocal 1.8..
Timo Sirainen <tss@iki.fi>
parents: 2035
diff changeset
893 AC_DEFUN([AC_CHECKTYPE2], [
678
1e5c655bad25 Renamed largest_t to uintmax_t which already exists in C99.
Timo Sirainen <tss@iki.fi>
parents: 677
diff changeset
894 AC_MSG_CHECKING([for $1])
1e5c655bad25 Renamed largest_t to uintmax_t which already exists in C99.
Timo Sirainen <tss@iki.fi>
parents: 677
diff changeset
895 AC_CACHE_VAL(i_cv_type_$1,
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
896 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
678
1e5c655bad25 Renamed largest_t to uintmax_t which already exists in C99.
Timo Sirainen <tss@iki.fi>
parents: 677
diff changeset
897 #include <sys/types.h>
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
898 $2]], [[$1 t;]])],[i_cv_type_$1=yes],[i_cv_type_$1=no])])
678
1e5c655bad25 Renamed largest_t to uintmax_t which already exists in C99.
Timo Sirainen <tss@iki.fi>
parents: 677
diff changeset
899 AC_MSG_RESULT($i_cv_type_$1)
1e5c655bad25 Renamed largest_t to uintmax_t which already exists in C99.
Timo Sirainen <tss@iki.fi>
parents: 677
diff changeset
900 ])
1e5c655bad25 Renamed largest_t to uintmax_t which already exists in C99.
Timo Sirainen <tss@iki.fi>
parents: 677
diff changeset
901
1660
4076387f7ccb We should be checking C99 types using stdint.h, not inttypes.h
Timo Sirainen <tss@iki.fi>
parents: 1658
diff changeset
902 dnl some systems don't have stdint.h, but still have some of the types
4076387f7ccb We should be checking C99 types using stdint.h, not inttypes.h
Timo Sirainen <tss@iki.fi>
parents: 1658
diff changeset
903 dnl defined elsewhere
4076387f7ccb We should be checking C99 types using stdint.h, not inttypes.h
Timo Sirainen <tss@iki.fi>
parents: 1658
diff changeset
904 AC_CHECK_HEADER(stdint.h, [
4076387f7ccb We should be checking C99 types using stdint.h, not inttypes.h
Timo Sirainen <tss@iki.fi>
parents: 1658
diff changeset
905 stdint_include="#include <stdint.h>"
4076387f7ccb We should be checking C99 types using stdint.h, not inttypes.h
Timo Sirainen <tss@iki.fi>
parents: 1658
diff changeset
906 ])
4076387f7ccb We should be checking C99 types using stdint.h, not inttypes.h
Timo Sirainen <tss@iki.fi>
parents: 1658
diff changeset
907
4076387f7ccb We should be checking C99 types using stdint.h, not inttypes.h
Timo Sirainen <tss@iki.fi>
parents: 1658
diff changeset
908 AC_CHECKTYPE2(uintmax_t, [$stdint_include])
678
1e5c655bad25 Renamed largest_t to uintmax_t which already exists in C99.
Timo Sirainen <tss@iki.fi>
parents: 677
diff changeset
909 if test $i_cv_type_uintmax_t = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
910 AC_DEFINE(HAVE_UINTMAX_T,, [Define if you have uintmax_t (C99 type)])
179
0ffecd4e7e1a added dec2str() function and largest_t type, removed itoa() and ltoa()
Timo Sirainen <tss@iki.fi>
parents: 175
diff changeset
911 fi
0ffecd4e7e1a added dec2str() function and largest_t type, removed itoa() and ltoa()
Timo Sirainen <tss@iki.fi>
parents: 175
diff changeset
912
908
bc55266563cd Use separate check for uint_fast32_t.
Timo Sirainen <tss@iki.fi>
parents: 907
diff changeset
913 dnl use separate check, eg. Solaris 8 has uintmax_t but not uint_fast32_t
1660
4076387f7ccb We should be checking C99 types using stdint.h, not inttypes.h
Timo Sirainen <tss@iki.fi>
parents: 1658
diff changeset
914 AC_CHECKTYPE2(uint_fast32_t, [$stdint_include])
908
bc55266563cd Use separate check for uint_fast32_t.
Timo Sirainen <tss@iki.fi>
parents: 907
diff changeset
915 if test $i_cv_type_uint_fast32_t = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
916 AC_DEFINE(HAVE_UINT_FAST32_T,, [Define if you have uint_fast32_t (C99 type)])
908
bc55266563cd Use separate check for uint_fast32_t.
Timo Sirainen <tss@iki.fi>
parents: 907
diff changeset
917 fi
bc55266563cd Use separate check for uint_fast32_t.
Timo Sirainen <tss@iki.fi>
parents: 907
diff changeset
918
678
1e5c655bad25 Renamed largest_t to uintmax_t which already exists in C99.
Timo Sirainen <tss@iki.fi>
parents: 677
diff changeset
919 AC_CHECKTYPE2(socklen_t, [#include <sys/socket.h>])
1e5c655bad25 Renamed largest_t to uintmax_t which already exists in C99.
Timo Sirainen <tss@iki.fi>
parents: 677
diff changeset
920 if test $i_cv_type_socklen_t = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
921 AC_DEFINE(HAVE_SOCKLEN_T,, [Define to 'int' if you don't have socklen_t])
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
922 fi
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
923
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
924 AC_DEFINE_UNQUOTED(MEM_ALIGN_SIZE, $mem_align, [Required memory alignment])
1394
059f13d577bb Use separate index alignment from memory alignment. We don't use pointers in
Timo Sirainen <tss@iki.fi>
parents: 1389
diff changeset
925
1335
5ad84c54eb7e Support using OpenSSL's pseudo-random generator instead of /dev/urandom. If
Timo Sirainen <tss@iki.fi>
parents: 1300
diff changeset
926 dnl * find random source
14989
3765e8948f1c configure: Removed OpenBSD /dev/arandom checking.
Timo Sirainen <tss@iki.fi>
parents: 14935
diff changeset
927 AC_MSG_CHECKING([for /dev/urandom])
3765e8948f1c configure: Removed OpenBSD /dev/arandom checking.
Timo Sirainen <tss@iki.fi>
parents: 14935
diff changeset
928 if test -c /dev/urandom || test -s /dev/urandom; then
1335
5ad84c54eb7e Support using OpenSSL's pseudo-random generator instead of /dev/urandom. If
Timo Sirainen <tss@iki.fi>
parents: 1300
diff changeset
929 AC_MSG_RESULT(yes)
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
930 AC_DEFINE(DEV_URANDOM_PATH, "/dev/urandom", [Path to /dev/urandom])
1335
5ad84c54eb7e Support using OpenSSL's pseudo-random generator instead of /dev/urandom. If
Timo Sirainen <tss@iki.fi>
parents: 1300
diff changeset
931 have_random_source=yes
5ad84c54eb7e Support using OpenSSL's pseudo-random generator instead of /dev/urandom. If
Timo Sirainen <tss@iki.fi>
parents: 1300
diff changeset
932 else
5ad84c54eb7e Support using OpenSSL's pseudo-random generator instead of /dev/urandom. If
Timo Sirainen <tss@iki.fi>
parents: 1300
diff changeset
933 AC_MSG_RESULT(no)
9204
1849c4269ad8 If /dev/arandom exists (OpenBSD), use it instead of /dev/urandom.
Timo Sirainen <tss@iki.fi>
parents: 9159
diff changeset
934 fi
1335
5ad84c54eb7e Support using OpenSSL's pseudo-random generator instead of /dev/urandom. If
Timo Sirainen <tss@iki.fi>
parents: 1300
diff changeset
935
9204
1849c4269ad8 If /dev/arandom exists (OpenBSD), use it instead of /dev/urandom.
Timo Sirainen <tss@iki.fi>
parents: 9159
diff changeset
936 if test "$have_random_source" != "yes"; then
1335
5ad84c54eb7e Support using OpenSSL's pseudo-random generator instead of /dev/urandom. If
Timo Sirainen <tss@iki.fi>
parents: 1300
diff changeset
937 AC_CHECK_HEADER(openssl/rand.h, [
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
938 AC_DEFINE(HAVE_OPENSSL_RAND_H,, [Define if you have openssl/rand.h])
7844
7b39370dae6b If we need -lcrypto for randomness, put it to $LIBS instead of $RAND_LIBS
Timo Sirainen <tss@iki.fi>
parents: 7826
diff changeset
939 LIBS="$LIBS -lcrypto"
1335
5ad84c54eb7e Support using OpenSSL's pseudo-random generator instead of /dev/urandom. If
Timo Sirainen <tss@iki.fi>
parents: 1300
diff changeset
940 ])
5ad84c54eb7e Support using OpenSSL's pseudo-random generator instead of /dev/urandom. If
Timo Sirainen <tss@iki.fi>
parents: 1300
diff changeset
941 fi
5ad84c54eb7e Support using OpenSSL's pseudo-random generator instead of /dev/urandom. If
Timo Sirainen <tss@iki.fi>
parents: 1300
diff changeset
942
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
943 dnl * do we have tm_gmtoff
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
944 AC_MSG_CHECKING([for tm_gmtoff])
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
945 AC_CACHE_VAL(i_cv_field_tm_gmtoff,
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
946 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
947 #include <time.h>]],
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
948 [[struct tm *tm; return tm->tm_gmtoff;]])],
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
949 [i_cv_field_tm_gmtoff=yes],
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
950 [i_cv_field_tm_gmtoff=no])])
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
951 if test $i_cv_field_tm_gmtoff = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
952 AC_DEFINE(HAVE_TM_GMTOFF,, [Define if you have struct tm->tm_gmtoff])
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
953 fi
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
954 AC_MSG_RESULT($i_cv_field_tm_gmtoff)
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
955
1658
20519e4bca48 utc_mktime() crashed with 64bit time_t if gmtime() didn't like >32bit values
Timo Sirainen <tss@iki.fi>
parents: 1656
diff changeset
956 dnl * how large time_t values does gmtime() accept?
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
957 AC_CACHE_CHECK([how large time_t values gmtime() accepts],i_cv_gmtime_max_time_t,[
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
958 AC_RUN_IFELSE([AC_LANG_SOURCE([[
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
959 #include <stdio.h>
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
960 #include <time.h>
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
961 int main() {
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
962 FILE *f;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
963 int bits;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
964
6522
6c46542a5ce5 With 32bit time_t we were checking it up to 64 bits, which overflowed the
Timo Sirainen <tss@iki.fi>
parents: 6501
diff changeset
965 for (bits = 1; bits < sizeof(time_t)*8; bits++) {
6483
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
966 time_t t = ((time_t)1 << bits) - 1;
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
967 if (gmtime(&t) == NULL) {
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
968 bits--;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
969 break;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
970 }
1658
20519e4bca48 utc_mktime() crashed with 64bit time_t if gmtime() didn't like >32bit values
Timo Sirainen <tss@iki.fi>
parents: 1656
diff changeset
971 }
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
972 if (bits > 40) {
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
973 /* Solaris 9 breaks after 55 bits. Perhaps other systems break earlier.
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
974 Let's just do the same as Cyrus folks and limit it to 40 bits. */
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
975 bits = 40;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
976 }
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
977
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
978 f = fopen("conftest.temp", "w");
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
979 if (f == NULL) {
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
980 perror("fopen()");
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
981 return 1;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
982 }
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
983 fprintf(f, "%d", bits);
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
984 fclose(f);
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
985 return 0;
3206
6400a517f087 Limit TIME_T_MAX_BITS to 40.
Timo Sirainen <tss@iki.fi>
parents: 3199
diff changeset
986 }
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
987 ]])],[
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
988 i_cv_gmtime_max_time_t=`cat conftest.temp`
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
989 rm -f conftest.temp
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
990 ], [
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
991 printf "check failed, assuming "
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
992 i_cv_gmtime_max_time_t=31
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
993 ],[])
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
994 ])
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
995 AC_DEFINE_UNQUOTED(TIME_T_MAX_BITS, $i_cv_gmtime_max_time_t, [max. time_t bits gmtime() can handle])
1658
20519e4bca48 utc_mktime() crashed with 64bit time_t if gmtime() didn't like >32bit values
Timo Sirainen <tss@iki.fi>
parents: 1656
diff changeset
996
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
997 AC_CACHE_CHECK([whether time_t is signed],i_cv_signed_time_t,[
6483
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
998 AC_RUN_IFELSE([AC_LANG_SOURCE([[
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
999 #include <sys/types.h>
21283
16869cca53ce configure: Fix some implicit function declarations
Paul Howarth <paul@city-fan.org>
parents: 21271
diff changeset
1000 #include <stdlib.h>
6483
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
1001 int main() {
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
1002 /* return 0 if we're signed */
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
1003 exit((time_t)(int)-1 <= 0 ? 0 : 1);
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
1004 }
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
1005 ]])],[
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1006 i_cv_signed_time_t=yes
6483
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
1007 ], [
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1008 i_cv_signed_time_t=no
6483
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
1009 ])
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
1010 ])
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1011 if test $i_cv_signed_time_t = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1012 AC_DEFINE(TIME_T_SIGNED,, [Define if your time_t is signed])
6483
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
1013 fi
6d15946eccb5 Rewrote utc_mktime() so it's now MIT licensed. This also fixes handling
Timo Sirainen <tss@iki.fi>
parents: 6403
diff changeset
1014
20474
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1015 AC_CACHE_CHECK([if we can use C99 static in array sizes],i_cv_c99_static_arrays,[
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1016 AC_TRY_COMPILE([
20492
fac0281a2c4e configure: Fix static array check
Aki Tuomi <aki.tuomi@dovecot.fi>
parents: 20491
diff changeset
1017 void foo(unsigned char [static 20]);
20474
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1018 ], [
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1019 ], [
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1020 i_cv_c99_static_arrays=yes
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1021 ], [
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1022 i_cv_c99_static_arrays=no
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1023 ])
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1024 ])
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1025
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1026 if test $i_cv_c99_static_arrays = yes; then
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1027 static_value=static
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1028 else
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1029 static_value=
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1030 fi
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1031 AC_DEFINE_UNQUOTED(STATIC_ARRAY, $static_value, [C99 static array])
3f63a4e80fe1 configure: Check if C99 "static" keyword is supported for array sizes.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 20425
diff changeset
1032
7997
0d66b44689ee Fixed compiling on some older pre-C99 compilers.
Timo Sirainen <tss@iki.fi>
parents: 7990
diff changeset
1033 dnl Our implementation of AC_C_FLEXIBLE_ARRAY_MEMBER.
0d66b44689ee Fixed compiling on some older pre-C99 compilers.
Timo Sirainen <tss@iki.fi>
parents: 7990
diff changeset
1034 dnl Use it until autoconf 2.61+ becomes more widely used
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1035 AC_CACHE_CHECK([if we can use C99-like flexible array members],i_cv_c99_flex_arrays,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1036 AC_TRY_COMPILE([
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1037 struct foo {
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1038 int x;
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1039 char y[];
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1040 };
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1041 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1042 struct foo foo;
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1043 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1044 i_cv_c99_flex_arrays=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1045 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1046 i_cv_c99_flex_arrays=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1047 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1048 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1049
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1050 if test $i_cv_c99_flex_arrays = yes; then
10094
634588d51ae6 configure: FLEXIBLE_ARRAY_MEMBER value was reversed.
Timo Sirainen <tss@iki.fi>
parents: 10091
diff changeset
1051 flexible_value=
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1052 else
10094
634588d51ae6 configure: FLEXIBLE_ARRAY_MEMBER value was reversed.
Timo Sirainen <tss@iki.fi>
parents: 10091
diff changeset
1053 flexible_value=1
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1054 fi
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1055 AC_DEFINE_UNQUOTED(FLEXIBLE_ARRAY_MEMBER, $flexible_value, [How to define flexible array members in structs])
7997
0d66b44689ee Fixed compiling on some older pre-C99 compilers.
Timo Sirainen <tss@iki.fi>
parents: 7990
diff changeset
1056
411
c2fdc076ae7f checks for writev()
Timo Sirainen <tss@iki.fi>
parents: 353
diff changeset
1057 dnl * do we have struct iovec
c2fdc076ae7f checks for writev()
Timo Sirainen <tss@iki.fi>
parents: 353
diff changeset
1058 AC_MSG_CHECKING([for struct iovec])
c2fdc076ae7f checks for writev()
Timo Sirainen <tss@iki.fi>
parents: 353
diff changeset
1059 AC_CACHE_VAL(i_cv_struct_iovec,
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
1060 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
411
c2fdc076ae7f checks for writev()
Timo Sirainen <tss@iki.fi>
parents: 353
diff changeset
1061 #include <sys/types.h>
c2fdc076ae7f checks for writev()
Timo Sirainen <tss@iki.fi>
parents: 353
diff changeset
1062 #include <sys/uio.h>
2796
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
1063 #include <unistd.h>]],
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
1064 [[struct iovec *iovec;]])],
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
1065 [i_cv_struct_iovec=yes],
fb7f862194b5 Upgrades to autoconf 2.5 and automake >1.4.
Timo Sirainen <tss@iki.fi>
parents: 2784
diff changeset
1066 [i_cv_struct_iovec=no])])
411
c2fdc076ae7f checks for writev()
Timo Sirainen <tss@iki.fi>
parents: 353
diff changeset
1067
c2fdc076ae7f checks for writev()
Timo Sirainen <tss@iki.fi>
parents: 353
diff changeset
1068 if test $i_cv_struct_iovec = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1069 AC_DEFINE(HAVE_STRUCT_IOVEC,, [Define if you have struct iovec])
411
c2fdc076ae7f checks for writev()
Timo Sirainen <tss@iki.fi>
parents: 353
diff changeset
1070 fi
c2fdc076ae7f checks for writev()
Timo Sirainen <tss@iki.fi>
parents: 353
diff changeset
1071 AC_MSG_RESULT($i_cv_struct_iovec)
c2fdc076ae7f checks for writev()
Timo Sirainen <tss@iki.fi>
parents: 353
diff changeset
1072
691
567f5e66c7b8 We compile now if dev_t is a structure (eg. glibc+tcc).
Timo Sirainen <tss@iki.fi>
parents: 679
diff changeset
1073 dnl * is dev_t an integer or something else?
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1074 AC_CACHE_CHECK([whether dev_t is struct],i_cv_dev_t_struct,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1075 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1076 #include <sys/types.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1077 struct test { dev_t a; };
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1078 static struct test t = { 0 };
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1079 ]],
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1080 [[ ]])], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1081 i_cv_dev_t_struct=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1082 ],[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1083 i_cv_dev_t_struct=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1084 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1085 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1086 if test $i_cv_dev_t_struct = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1087 AC_DEFINE(DEV_T_STRUCT,, [Define if your dev_t is a structure instead of integer type])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1088 fi
691
567f5e66c7b8 We compile now if dev_t is a structure (eg. glibc+tcc).
Timo Sirainen <tss@iki.fi>
parents: 679
diff changeset
1089
739
f50714973d0b RLIMIT_AS isn't supported everywhere - use it if it exists, but also use
Timo Sirainen <tss@iki.fi>
parents: 733
diff changeset
1090 dnl * Do we have RLIMIT_AS?
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1091 AC_CACHE_CHECK([whether RLIMIT_AS exists],i_cv_have_rlimit_as,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1092 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1093 #include <sys/types.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1094 #include <sys/time.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1095 #include <sys/resource.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1096 ]], [[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1097 struct rlimit r;
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1098 getrlimit(RLIMIT_AS, &r);
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1099 ]])],[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1100 i_cv_have_rlimit_as=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1101 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1102 i_cv_have_rlimit_as=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1103 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1104 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1105
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1106 if test $i_cv_have_rlimit_as = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1107 AC_DEFINE(HAVE_RLIMIT_AS,, [Define if you have RLIMIT_AS for setrlimit()])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1108 fi
739
f50714973d0b RLIMIT_AS isn't supported everywhere - use it if it exists, but also use
Timo Sirainen <tss@iki.fi>
parents: 733
diff changeset
1109
1065
6cb5b50aea71 Don't let login process fork()
Timo Sirainen <tss@iki.fi>
parents: 1058
diff changeset
1110 dnl * Do we have RLIMIT_NPROC?
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1111 AC_CACHE_CHECK([whether RLIMIT_NPROC exists],i_cv_have_rlimit_nproc,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1112 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1113 #include <sys/types.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1114 #include <sys/time.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1115 #include <sys/resource.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1116 ]], [[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1117 struct rlimit r;
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1118 getrlimit(RLIMIT_NPROC, &r);
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1119 ]])],[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1120 i_cv_have_rlimit_nproc=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1121 ],[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1122 i_cv_have_rlimit_nproc=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1123 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1124 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1125
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1126 if test $i_cv_have_rlimit_nproc = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1127 AC_DEFINE(HAVE_RLIMIT_NPROC,, [Define if you have RLIMIT_NPROC for setrlimit()])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1128 fi
1065
6cb5b50aea71 Don't let login process fork()
Timo Sirainen <tss@iki.fi>
parents: 1058
diff changeset
1129
7946
aad49536db41 If core dump limit is 0, add "core dumps disabled" to startup log line.
Timo Sirainen <tss@iki.fi>
parents: 7929
diff changeset
1130 dnl * Do we have RLIMIT_CORE?
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1131 AC_CACHE_CHECK([whether RLIMIT_CORE exists],i_cv_have_rlimit_core,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1132 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1133 #include <sys/types.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1134 #include <sys/time.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1135 #include <sys/resource.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1136 ]], [[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1137 struct rlimit r;
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1138 getrlimit(RLIMIT_CORE, &r);
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1139 ]])],[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1140 i_cv_have_rlimit_core=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1141 ],[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1142 i_cv_have_rlimit_core=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1143 ])
8798
c9381a0fdc5e Improved logging for core dumping. With Linux use PR_SET_DUMPABLE for imap/pop3.
Timo Sirainen <tss@iki.fi>
parents: 8743
diff changeset
1144 ])
c9381a0fdc5e Improved logging for core dumping. With Linux use PR_SET_DUMPABLE for imap/pop3.
Timo Sirainen <tss@iki.fi>
parents: 8743
diff changeset
1145
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1146 if test $i_cv_have_rlimit_core = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1147 AC_DEFINE(HAVE_RLIMIT_CORE,, [Define if you have RLIMIT_CORE for getrlimit()])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1148 fi
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1149
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1150 AC_CACHE_CHECK([whether PR_SET_DUMPABLE exists],i_cv_have_pr_set_dumpable,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1151 AC_TRY_LINK([
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1152 #include <sys/prctl.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1153 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1154 prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1155 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1156 i_cv_have_pr_set_dumpable=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1157 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1158 i_cv_have_pr_set_dumpable=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1159 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1160 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1161 if test $i_cv_have_pr_set_dumpable = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1162 AC_DEFINE(HAVE_PR_SET_DUMPABLE,, [Define if you have prctl(PR_SET_DUMPABLE)])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1163 fi
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1164
528
a95b1ccff82e Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents: 494
diff changeset
1165 dnl * Linux compatible mremap()
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1166 AC_CACHE_CHECK([Linux compatible mremap()],i_cv_have_linux_mremap,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1167 AC_TRY_LINK([
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1168 #include <unistd.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1169 #define __USE_GNU
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1170 #include <sys/mman.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1171 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1172 mremap(0, 0, 0, MREMAP_MAYMOVE);
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1173 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1174 i_cv_have_linux_mremap=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1175 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1176 i_cv_have_linux_mremap=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1177 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1178 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1179 if test $i_cv_have_linux_mremap = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1180 AC_DEFINE(HAVE_LINUX_MREMAP,, [Define if you have Linux-compatible mremap()])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1181 fi
224
e8863d6088fe mremap() check
Timo Sirainen <tss@iki.fi>
parents: 191
diff changeset
1182
1622
d22e03714d36 index_mmap_invalidate = yes now invalidate memory maps before accessing
Timo Sirainen <tss@iki.fi>
parents: 1611
diff changeset
1183 dnl * If mmap() plays nicely with write()
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1184 AC_CACHE_CHECK([whether shared mmaps get updated by write()s],i_cv_mmap_plays_with_write,[
2349
b65456de1b49 Check BUGGY_CMSG_MACROS in configure.
Timo Sirainen <tss@iki.fi>
parents: 2325
diff changeset
1185 AC_TRY_RUN([
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1186 #include <stdio.h>
2349
b65456de1b49 Check BUGGY_CMSG_MACROS in configure.
Timo Sirainen <tss@iki.fi>
parents: 2325
diff changeset
1187 #include <sys/types.h>
b65456de1b49 Check BUGGY_CMSG_MACROS in configure.
Timo Sirainen <tss@iki.fi>
parents: 2325
diff changeset
1188 #include <sys/stat.h>
b65456de1b49 Check BUGGY_CMSG_MACROS in configure.
Timo Sirainen <tss@iki.fi>
parents: 2325
diff changeset
1189 #include <unistd.h>
b65456de1b49 Check BUGGY_CMSG_MACROS in configure.
Timo Sirainen <tss@iki.fi>
parents: 2325
diff changeset
1190 #include <fcntl.h>
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1191 #include <sys/mman.h>
21283
16869cca53ce configure: Fix some implicit function declarations
Paul Howarth <paul@city-fan.org>
parents: 21271
diff changeset
1192 #include <string.h>
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1193 int main() {
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1194 /* return 0 if we're signed */
8226
3e493fd3a9fa configure: create test files with mode 0600.
Timo Sirainen <tss@iki.fi>
parents: 8173
diff changeset
1195 int f = open("conftest.mmap", O_RDWR|O_CREAT|O_TRUNC, 0600);
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1196 void *mem;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1197 if (f == -1) {
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1198 perror("open()");
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1199 return 1;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1200 }
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1201 unlink("conftest.mmap");
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1202
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1203 write(f, "1", 2);
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1204 mem = mmap(NULL, 2, PROT_READ|PROT_WRITE, MAP_SHARED, f, 0);
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1205 if (mem == MAP_FAILED) {
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1206 perror("mmap()");
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1207 return 1;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1208 }
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1209 strcpy(mem, "2");
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1210 msync(mem, 2, MS_SYNC);
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1211 lseek(f, 0, SEEK_SET);
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1212 write(f, "3", 2);
2349
b65456de1b49 Check BUGGY_CMSG_MACROS in configure.
Timo Sirainen <tss@iki.fi>
parents: 2325
diff changeset
1213
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1214 return strcmp(mem, "3") == 0 ? 0 : 1;
2349
b65456de1b49 Check BUGGY_CMSG_MACROS in configure.
Timo Sirainen <tss@iki.fi>
parents: 2325
diff changeset
1215 }
b65456de1b49 Check BUGGY_CMSG_MACROS in configure.
Timo Sirainen <tss@iki.fi>
parents: 2325
diff changeset
1216 ], [
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1217 i_cv_mmap_plays_with_write=yes
2349
b65456de1b49 Check BUGGY_CMSG_MACROS in configure.
Timo Sirainen <tss@iki.fi>
parents: 2325
diff changeset
1218 ], [
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1219 i_cv_mmap_plays_with_write=no
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1220 ])
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1221 ])
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1222 if test $i_cv_mmap_plays_with_write = no; then
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1223 AC_DEFINE(MMAP_CONFLICTS_WRITE,, [Define if shared mmaps don't get updated by write()s])
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1224 fi
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1225
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1226 dnl * see if fd passing works
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1227 AC_CACHE_CHECK([whether fd passing works],i_cv_fd_passing,[
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1228 for i in 1 2; do
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1229 old_cflags="$CFLAGS"
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1230 CFLAGS="$CFLAGS -I$srcdir/src/lib $srcdir/src/lib/fdpass.c"
2349
b65456de1b49 Check BUGGY_CMSG_MACROS in configure.
Timo Sirainen <tss@iki.fi>
parents: 2325
diff changeset
1231 if test $i = 2; then
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1232 CFLAGS="$CFLAGS -DBUGGY_CMSG_MACROS"
2349
b65456de1b49 Check BUGGY_CMSG_MACROS in configure.
Timo Sirainen <tss@iki.fi>
parents: 2325
diff changeset
1233 fi
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1234
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1235 AC_TRY_RUN([
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1236 #include <sys/types.h>
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1237 #include <sys/socket.h>
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1238 #include <sys/wait.h>
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1239 #include <sys/stat.h>
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1240 #include <unistd.h>
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1241 #include <fcntl.h>
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1242 #include "fdpass.h"
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1243
8578
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1244 int nopen(void)
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1245 {
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1246 int i, n;
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1247 struct stat sb;
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1248 for (i = n = 0; i < 256; i++)
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1249 if (fstat(i, &sb) == 0) n++;
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1250 return n;
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1251 }
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1252 int main(void)
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1253 {
8578
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1254 int fd[2], send_fd, recv_fd, status, n1, n2;
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1255 struct stat st, st2;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1256 char data;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1257
8226
3e493fd3a9fa configure: create test files with mode 0600.
Timo Sirainen <tss@iki.fi>
parents: 8173
diff changeset
1258 send_fd = creat("conftest.fdpass", 0600);
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1259 if (send_fd == -1) return 2;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1260 unlink("conftest.fdpass");
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1261 if (fstat(send_fd, &st) < 0) return 2;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1262 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fd) < 0) return 2;
8578
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1263 n1 = nopen();
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1264
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1265 switch (fork()) {
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1266 case -1:
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1267 return 2;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1268 case 0:
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1269 alarm(1);
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1270 if (fd_send(fd[0], send_fd, &data, 1) != 1) return 2;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1271 return 0;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1272 default:
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1273 alarm(2);
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1274 if (wait(&status) == -1)
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1275 return 2;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1276 if (status != 0)
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1277 return status;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1278 if (fd_read(fd[1], &data, 1, &recv_fd) != 1) return 1;
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1279 if (fstat(recv_fd, &st2) < 0) return 2;
8578
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1280 /* nopen check is for making sure that only a single fd
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1281 was received */
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1282 n2 = nopen();
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1283 return st.st_ino == st2.st_ino && n2 == n1 + 1 ? 0 : 1;
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1284 }
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1285 }
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1286 ], [
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1287 CFLAGS=$old_cflags
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1288 if test $i = 2; then
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1289 i_cv_fd_passing=buggy_cmsg_macros
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1290 else
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1291 i_cv_fd_passing=yes
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1292 fi
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1293 break
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1294 ], [
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1295 dnl no, try with BUGGY_CMSG_MACROS
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1296 CFLAGS=$old_cflags
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1297 i_cv_fd_passing=no
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1298 ])
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1299 done
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1300 ]);
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1301
8578
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1302 case "$host_os" in
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1303 darwin[[1-9]].*)
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1304 if test "$i_cv_fd_passing" = "yes"; then
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1305 i_cv_fd_passing=buggy_cmsg_macros
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1306 fi
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1307 ;;
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1308 esac
729576bb91d8 Some versions of Mac OS X have buggy CMSG_* macros, avoid using them.
Timo Sirainen <tss@iki.fi>
parents: 8572
diff changeset
1309
7555
47c5e52c1181 Prefix AC_CACHE_CHECK variables with i_cv_.
Timo Sirainen <tss@iki.fi>
parents: 7554
diff changeset
1310 if test $i_cv_fd_passing = buggy_cmsg_macros; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1311 AC_DEFINE(BUGGY_CMSG_MACROS,, [Define if you have buggy CMSG macros])
5165
04bdc7c83854 Added AC_CACHE_CHECK()s to all AC_TRY_RUN and AC_RUN_IFELSE checks so that
Timo Sirainen <tss@iki.fi>
parents: 5103
diff changeset
1312 fi
11839
8cf47a359213 configure: If fd passing check fails, abort
Timo Sirainen <tss@iki.fi>
parents: 11820
diff changeset
1313 if test $i_cv_fd_passing = no; then
8cf47a359213 configure: If fd passing check fails, abort
Timo Sirainen <tss@iki.fi>
parents: 11820
diff changeset
1314 AC_ERROR([fd passing is required for Dovecot to work])
8cf47a359213 configure: If fd passing check fails, abort
Timo Sirainen <tss@iki.fi>
parents: 11820
diff changeset
1315 fi
1622
d22e03714d36 index_mmap_invalidate = yes now invalidate memory maps before accessing
Timo Sirainen <tss@iki.fi>
parents: 1611
diff changeset
1316
2035
0e65efd14eda Solaris: Move from sendfilev() to sendfile() (was it always there?). Make
Timo Sirainen <tss@iki.fi>
parents: 2028
diff changeset
1317 dnl * Solaris compatible sendfile()
0e65efd14eda Solaris: Move from sendfilev() to sendfile() (was it always there?). Make
Timo Sirainen <tss@iki.fi>
parents: 2028
diff changeset
1318 AC_CHECK_LIB(sendfile, sendfile, [
976
b3e0f857981c Support for Solaris sendfilev(). Entirely untested, hope it works.
Timo Sirainen <tss@iki.fi>
parents: 975
diff changeset
1319 LIBS="$LIBS -lsendfile"
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1320 AC_DEFINE(HAVE_SOLARIS_SENDFILE,, [Define if you have Solaris-compatible sendfile()])
976
b3e0f857981c Support for Solaris sendfilev(). Entirely untested, hope it works.
Timo Sirainen <tss@iki.fi>
parents: 975
diff changeset
1321 ], [
981
7e9b90bfe78c If Solaris sendfilev() is found, don't try checking for Linux one. Linux
Timo Sirainen <tss@iki.fi>
parents: 976
diff changeset
1322 dnl * Linux compatible sendfile() - don't check if Solaris one was found.
7e9b90bfe78c If Solaris sendfilev() is found, don't try checking for Linux one. Linux
Timo Sirainen <tss@iki.fi>
parents: 976
diff changeset
1323 dnl * This seems to pass with Solaris for some reason..
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1324 AC_CACHE_CHECK([Linux compatible sendfile()],i_cv_have_linux_sendfile,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1325 AC_TRY_LINK([
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1326 #undef _FILE_OFFSET_BITS
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1327 #include <sys/types.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1328 #include <sys/socket.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1329 #include <sys/sendfile.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1330 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1331 sendfile(0, 0, (void *) 0, 0);
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1332 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1333 i_cv_have_linux_sendfile=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1334 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1335 i_cv_have_linux_sendfile=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1336 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1337 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1338 if test $i_cv_have_linux_sendfile = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1339 AC_DEFINE(HAVE_LINUX_SENDFILE,, [Define if you have Linux-compatible sendfile()])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1340 fi
981
7e9b90bfe78c If Solaris sendfilev() is found, don't try checking for Linux one. Linux
Timo Sirainen <tss@iki.fi>
parents: 976
diff changeset
1341
7e9b90bfe78c If Solaris sendfilev() is found, don't try checking for Linux one. Linux
Timo Sirainen <tss@iki.fi>
parents: 976
diff changeset
1342 dnl * FreeBSD compatible sendfile()
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1343 AC_CACHE_CHECK([FreeBSD compatible sendfile()],i_cv_have_freebsd_sendfile,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1344 AC_TRY_LINK([
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1345 #include <sys/types.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1346 #include <sys/socket.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1347 #include <sys/uio.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1348 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1349 struct sf_hdtr hdtr;
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1350 sendfile(0, 0, 0, 0, &hdtr, (void *) 0, 0);
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1351 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1352 i_cv_have_freebsd_sendfile=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1353 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1354 i_cv_have_freebsd_sendfile=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1355 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1356 ])
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1357 if test $i_cv_have_freebsd_sendfile = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1358 AC_DEFINE(HAVE_FREEBSD_SENDFILE,, [Define if you have FreeBSD-compatible sendfile()])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1359 fi
976
b3e0f857981c Support for Solaris sendfilev(). Entirely untested, hope it works.
Timo Sirainen <tss@iki.fi>
parents: 975
diff changeset
1360 ])
b3e0f857981c Support for Solaris sendfilev(). Entirely untested, hope it works.
Timo Sirainen <tss@iki.fi>
parents: 975
diff changeset
1361
10491
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1362 AC_CACHE_CHECK([if unsetenv returns int],i_cv_unsetenv_ret_int,[
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1363 AC_TRY_COMPILE([
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1364 #include <stdlib.h>
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1365 ], [
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1366 if (unsetenv("env") < 0) ;
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1367 ], [
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1368 i_cv_unsetenv_ret_int=yes
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1369 ], [
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1370 i_cv_unsetenv_ret_int=no
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1371 ])
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1372 ])
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1373 if test $i_cv_unsetenv_ret_int = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1374 AC_DEFINE(UNSETENV_RET_INT,, [Define if unsetenv() returns int])
10491
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1375 fi
617fa0739538 Compile fix for systems where unsetenv() returns void.
Timo Sirainen <tss@iki.fi>
parents: 10489
diff changeset
1376
3590
340e1b87c27b Added check for _XPG6 macro for crypt().
Timo Sirainen <tss@iki.fi>
parents: 3575
diff changeset
1377 dnl * Check for crypt() if unistd.h compiles with _XOPEN_SOURCE + _XPG6
340e1b87c27b Added check for _XPG6 macro for crypt().
Timo Sirainen <tss@iki.fi>
parents: 3575
diff changeset
1378 dnl * Add other macros there too "just in case".
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1379 AC_CACHE_CHECK([if we should use _XPG6 macro for crypt()],i_cv_use_xpg6_crypt,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1380 AC_TRY_COMPILE([
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1381 #define _XOPEN_SOURCE 4
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1382 #define _XOPEN_SOURCE_EXTENDED 1
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1383 #define _XOPEN_VERSION 4
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1384 #define _XPG4_2
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1385 #define _XPG6
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1386 #include <unistd.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1387 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1388 crypt("a", "b");
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1389 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1390 i_cv_use_xpg6_crypt=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1391 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1392 i_cv_use_xpg6_crypt=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1393 ])
3590
340e1b87c27b Added check for _XPG6 macro for crypt().
Timo Sirainen <tss@iki.fi>
parents: 3575
diff changeset
1394 ])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1395 if test $i_cv_use_xpg6_crypt = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1396 AC_DEFINE(CRYPT_USE_XPG6,, [Define if _XPG6 macro is needed for crypt()])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1397 fi
7526
a957567706ec Replaced HAVE_ST_NSEC macro checks with more generic ST_?TIME_NSEC() macros
Timo Sirainen <tss@iki.fi>
parents: 7502
diff changeset
1398
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1399 AC_CACHE_CHECK([if struct stat has st_?tim timespec fields],i_cv_have_st_tim_timespec,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1400 AC_TRY_COMPILE([
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1401 #include <sys/types.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1402 #include <sys/stat.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1403 #include <unistd.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1404 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1405 struct stat st;
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1406 unsigned long x = st.st_mtim.tv_nsec;
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1407
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1408 return 0;
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1409 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1410 i_cv_have_st_tim_timespec=yes
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1411 ], [
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1412 i_cv_have_st_tim_timespec=no
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1413 ])
5375
94f043494a12 Check if struct stat has tv_nsec fields
Timo Sirainen <tss@iki.fi>
parents: 5359
diff changeset
1414 ])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1415 if test $i_cv_have_st_tim_timespec = yes; then
18690
a2c3a0f671a6 configure: Use consistent quotation for AC_DEFINEs as per autoconf recommendations.
Matti Hamalainen <ccr@tnsp.org>
parents: 18682
diff changeset
1416 AC_DEFINE(HAVE_STAT_XTIM,, [Define if you have st_?tim timespec fields in struct stat])
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1417 fi
5375
94f043494a12 Check if struct stat has tv_nsec fields
Timo Sirainen <tss@iki.fi>
parents: 5359
diff changeset
1418
10014
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1419 AC_CACHE_CHECK([if struct stat has st_?timespec fields],i_cv_have_st_timespec,[
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1420 AC_TRY_COMPILE([
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1421 #include <sys/types.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1422 #include <sys/stat.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset
1423 #include <unistd.h>
e7f8f15f1c4c configure: Use cache for more checks.
Timo Sirainen <tss@iki.fi>
parents: 10001
diff changeset