Mercurial > dovecot > original-hg > dovecot-1.2
annotate configure.in @ 530:e815df17e52e HEAD
and fix linux-sendfile check so it fails with freebsd :)
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 28 Oct 2002 05:43:13 +0200 |
parents | 3a1be480d16a |
children | 42e65c2ba49d |
rev | line source |
---|---|
0 | 1 AC_INIT(src) |
2 | |
3 AM_CONFIG_HEADER(config.h) | |
353 | 4 AM_INIT_AUTOMAKE(dovecot, 0.98.4) |
0 | 5 |
6 AM_MAINTAINER_MODE | |
7 | |
8 AC_ISC_POSIX | |
9 AC_PROG_CC | |
10 AC_PROG_CPP | |
11 AC_STDC_HEADERS | |
12 AC_C_INLINE | |
13 AC_ARG_PROGRAM | |
14 AM_PROG_LIBTOOL | |
15 | |
224 | 16 AC_CHECK_HEADERS(string.h stdlib.h unistd.h dirent.h) |
528
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
17 AC_CHECK_HEADERS(sys/uio.h linux/mman.h) |
0 | 18 |
19 # check posix headers | |
20 AC_CHECK_HEADERS(sys/time.h) | |
21 | |
22 AC_ARG_ENABLE(ipv6, | |
426 | 23 [ --enable-ipv6 Enable IPv6 support (default)], |
0 | 24 if test x$enableval = xno; then |
25 want_ipv6=no | |
26 else | |
27 want_ipv6=yes | |
28 fi, | |
426 | 29 want_ipv6=yes) |
0 | 30 |
328
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
31 AC_ARG_WITH(file-offset-size, |
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
32 [ --with-file-offset-size=BITS Set size of file offsets. Usually 32 or 64. |
439
b66ccecbc8a6
Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents:
426
diff
changeset
|
33 (default: 64 if available)], |
328
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
34 preferred_off_t_bits=$withval, |
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
35 preferred_off_t_bits=64) |
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
36 |
439
b66ccecbc8a6
Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents:
426
diff
changeset
|
37 AC_ARG_WITH(mem-align, |
b66ccecbc8a6
Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents:
426
diff
changeset
|
38 [ --with-mem-align=BYTES Set the memory alignment (default: 8)], |
b66ccecbc8a6
Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents:
426
diff
changeset
|
39 mem_align=$withval, |
b66ccecbc8a6
Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents:
426
diff
changeset
|
40 mem_align=8) |
b66ccecbc8a6
Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents:
426
diff
changeset
|
41 |
328
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
42 AC_ARG_WITH(passwd, |
426 | 43 [ --with-passwd Build with /etc/passwd support (default)], |
328
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
44 if test x$withval = xno; then |
0 | 45 want_passwd=no |
46 else | |
47 want_passwd=yes | |
48 fi, | |
49 want_passwd=yes) | |
50 | |
328
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
51 AC_ARG_WITH(passwd-file, |
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
52 [ --with-passwd-file Build with passwd-like file support (default)], |
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
53 if test x$withval = xno; then |
0 | 54 want_passwd_file=no |
55 else | |
56 want_passwd_file=yes | |
57 fi, | |
58 want_passwd_file=yes) | |
59 | |
328
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
60 AC_ARG_WITH(shadow, |
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
61 [ --with-shadow Build with shadow password support (default)], |
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
62 if test x$withval = xno; then |
0 | 63 want_shadow=no |
64 else | |
65 want_shadow=yes | |
66 fi, | |
67 want_shadow=yes) | |
68 | |
328
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
69 AC_ARG_WITH(pam, |
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
70 [ --with-pam Build with PAM support (default)], |
a0abed892d11
s/--enable/--with/ to all auth modules. added --with-file-offset-size=BITS
Timo Sirainen <tss@iki.fi>
parents:
313
diff
changeset
|
71 if test x$withval = xno; then |
0 | 72 want_pam=no |
73 else | |
74 want_pam=yes | |
75 fi, | |
76 want_pam=yes) | |
77 | |
280
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
78 AC_ARG_WITH(vpopmail, |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
79 [ --with-vpopmail Build with vpopmail support (default)], |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
80 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
|
81 want_vpopmail=no |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
82 else |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
83 want_vpopmail=yes |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
84 fi, |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
85 want_vpopmail=yes) |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
86 |
246
fa3b4c2e252a
another typo .. maybe --without-gnutls works now :)
Timo Sirainen <tss@iki.fi>
parents:
245
diff
changeset
|
87 AC_ARG_WITH(gnutls, |
280
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
88 [ --with-gnutls Build with GNUTLS (default)], |
245 | 89 if test x$withval = xno; then |
244 | 90 want_gnutls=no |
91 else | |
92 want_gnutls=yes | |
93 fi, | |
94 want_gnutls=yes) | |
95 | |
0 | 96 dnl ** |
97 dnl ** just some generic stuff... | |
98 dnl ** | |
99 | |
100 AC_CHECK_FUNC(socket, [], [ | |
101 AC_CHECK_LIB(socket, socket, [ | |
102 LIBS="$LIBS -lsocket" | |
103 ]) | |
104 ]) | |
105 | |
106 AC_CHECK_FUNC(inet_addr, [], [ | |
107 AC_CHECK_LIB(nsl, inet_addr, [ | |
108 LIBS="$LIBS -lnsl" | |
109 ]) | |
110 ]) | |
111 | |
494
83d4617e1dca
Check fdatasync() from -lrt if it's not in libc (solaris). Also fallback to
Timo Sirainen <tss@iki.fi>
parents:
464
diff
changeset
|
112 AC_CHECK_FUNC(fdatasync, [ |
83d4617e1dca
Check fdatasync() from -lrt if it's not in libc (solaris). Also fallback to
Timo Sirainen <tss@iki.fi>
parents:
464
diff
changeset
|
113 AC_DEFINE([HAVE_FDATASYNC]) |
83d4617e1dca
Check fdatasync() from -lrt if it's not in libc (solaris). Also fallback to
Timo Sirainen <tss@iki.fi>
parents:
464
diff
changeset
|
114 ], [ |
83d4617e1dca
Check fdatasync() from -lrt if it's not in libc (solaris). Also fallback to
Timo Sirainen <tss@iki.fi>
parents:
464
diff
changeset
|
115 AC_CHECK_LIB(rt, fdatasync, [ |
83d4617e1dca
Check fdatasync() from -lrt if it's not in libc (solaris). Also fallback to
Timo Sirainen <tss@iki.fi>
parents:
464
diff
changeset
|
116 AC_DEFINE([HAVE_FDATASYNC]) |
83d4617e1dca
Check fdatasync() from -lrt if it's not in libc (solaris). Also fallback to
Timo Sirainen <tss@iki.fi>
parents:
464
diff
changeset
|
117 LIBS="$LIBS -lrt" |
83d4617e1dca
Check fdatasync() from -lrt if it's not in libc (solaris). Also fallback to
Timo Sirainen <tss@iki.fi>
parents:
464
diff
changeset
|
118 ]) |
83d4617e1dca
Check fdatasync() from -lrt if it's not in libc (solaris). Also fallback to
Timo Sirainen <tss@iki.fi>
parents:
464
diff
changeset
|
119 ]) |
83d4617e1dca
Check fdatasync() from -lrt if it's not in libc (solaris). Also fallback to
Timo Sirainen <tss@iki.fi>
parents:
464
diff
changeset
|
120 |
0 | 121 dnl * after -lsocket and -lnsl tests, inet_aton() may be in them |
122 AC_CHECK_FUNCS(fcntl flock inet_aton sigaction getpagesize madvise setreuid) | |
411 | 123 AC_CHECK_FUNCS(strcasecmp stricmp vsnprintf memmove vsyslog writev) |
0 | 124 |
125 dnl * poll/select? | |
126 | |
127 AC_CHECK_FUNC(poll, [ | |
128 have_poll=yes | |
129 ], [ | |
130 have_poll=no | |
131 ]) | |
132 AM_CONDITIONAL(IOLOOP_POLL, test "$have_poll" = "yes") | |
133 | |
134 dnl * gcc specific options | |
135 if test "x$ac_cv_prog_gcc" = "xyes"; then | |
65
168e0bd616b6
added -Wcast-qual to list of "remember to test with" cflags :)
Timo Sirainen <tss@iki.fi>
parents:
60
diff
changeset
|
136 # -Wchar-subscripts -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations |
5
1b34ec11fff8
Message data is parsed in blocks (no longer entirely mmap()ed). Several
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
137 CFLAGS="$CFLAGS -Wall -W" |
0 | 138 fi |
139 | |
140 dnl * OS specific options | |
141 case "$host_os" in | |
142 hpux*) | |
143 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED" | |
144 ;; | |
145 *) | |
146 ;; | |
147 esac | |
148 | |
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
|
149 dnl * off_t checks, try to make it 64bit |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
150 AC_DEFINE_UNQUOTED(_FILE_OFFSET_BITS, $preferred_off_t_bits) |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
151 |
55
db8ea2c11ab7
whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents:
50
diff
changeset
|
152 AC_CHECK_SIZEOF(int) |
db8ea2c11ab7
whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents:
50
diff
changeset
|
153 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
|
154 AC_CHECK_SIZEOF(void *) |
55
db8ea2c11ab7
whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents:
50
diff
changeset
|
155 AC_CHECK_SIZEOF(long long) |
185 | 156 |
157 dnl * older autoconfs don't include sys/types.h, so do it manually | |
158 AC_MSG_CHECKING([size of ssize_t]) | |
159 AC_TRY_RUN([ | |
160 #include <stdio.h> | |
161 #include <sys/types.h> | |
162 int main() { | |
163 FILE *f=fopen("conftestval", "w"); | |
164 if (!f) exit(1); | |
165 fprintf(f, "%d\n", sizeof(ssize_t)); | |
166 exit(0); | |
167 } | |
168 ], [ | |
169 sizeof_ssize_t=`cat conftestval` | |
170 rm -f conftestval | |
171 ], [ | |
172 sizeof_ssize_t=0 | |
173 AC_ERROR([Unsupported ssize_t size]) | |
174 ]) | |
186
041fb6098877
result of ssize_t check wasn't reported
Timo Sirainen <tss@iki.fi>
parents:
185
diff
changeset
|
175 AC_MSG_RESULT($sizeof_ssize_t) |
55
db8ea2c11ab7
whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents:
50
diff
changeset
|
176 |
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
|
177 AC_MSG_CHECKING([size of off_t]) |
185 | 178 AC_TRY_RUN([ |
179 #include <stdio.h> | |
180 #include <sys/types.h> | |
181 int main() { | |
182 FILE *f=fopen("conftestval", "w"); | |
183 if (!f) exit(1); | |
184 fprintf(f, "%d\n", sizeof(off_t)); | |
185 exit(0); | |
186 } | |
187 ], [ | |
188 sizeof_off_t=`cat conftestval` | |
189 rm -f conftestval | |
190 ], [ | |
191 sizeof_off_t=0 | |
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
|
192 AC_ERROR([Unsupported off_t size]) |
185 | 193 ]) |
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
|
194 AC_MSG_RESULT($sizeof_off_t) |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
195 |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
196 if test x$sizeof_off_t = x$ac_cv_sizeof_long; then |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
197 # try to use unsigned long always first |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
198 AC_DEFINE_UNQUOTED(OFF_T_MAX, LONG_MAX) |
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
|
199 AC_DEFINE_UNQUOTED(PRIuUOFF_T, "lu") |
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
|
200 AC_DEFINE(UOFF_T_LONG) |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
201 elif test x$sizeof_off_t = x$ac_cv_sizeof_int; then |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
202 # next try int |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
203 AC_DEFINE_UNQUOTED(OFF_T_MAX, INT_MAX) |
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
|
204 AC_DEFINE_UNQUOTED(PRIuUOFF_T, "u") |
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
|
205 AC_DEFINE(UOFF_T_INT) |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
206 elif test x$sizeof_off_t = x$ac_cv_sizeof_long_long; then |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
207 # and finally long long |
56 | 208 AC_DEFINE_UNQUOTED(OFF_T_MAX, LLONG_MAX) |
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
|
209 AC_DEFINE_UNQUOTED(PRIuUOFF_T, "llu") |
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
|
210 AC_DEFINE(UOFF_T_LONG_LONG) |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
211 else |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
212 AC_ERROR([Couldn't find integer type for off_t]) |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
213 fi |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
214 |
185 | 215 if test x$sizeof_ssize_t = x$ac_cv_sizeof_int; then |
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
|
216 AC_DEFINE_UNQUOTED(SSIZE_T_MAX, INT_MAX) |
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
|
217 AC_DEFINE_UNQUOTED(PRIuSIZE_T, "u") |
191
e5465a0c6964
ssize_t should be checked against long before long long.
Timo Sirainen <tss@iki.fi>
parents:
186
diff
changeset
|
218 elif test x$sizeof_ssize_t = x$ac_cv_sizeof_long; then |
e5465a0c6964
ssize_t should be checked against long before long long.
Timo Sirainen <tss@iki.fi>
parents:
186
diff
changeset
|
219 AC_DEFINE_UNQUOTED(SSIZE_T_MAX, LONG_MAX) |
e5465a0c6964
ssize_t should be checked against long before long long.
Timo Sirainen <tss@iki.fi>
parents:
186
diff
changeset
|
220 AC_DEFINE_UNQUOTED(PRIuSIZE_T, "lu") |
185 | 221 elif test x$sizeof_ssize_t = x$ac_cv_sizeof_long_long; then |
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
|
222 AC_DEFINE_UNQUOTED(SSIZE_T_MAX, LLONG_MAX) |
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
|
223 AC_DEFINE_UNQUOTED(PRIuSIZE_T, "llu") |
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
|
224 else |
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
|
225 AC_ERROR([Couldn't find integer type for ssize_t]) |
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
|
226 fi |
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
|
227 |
179
0ffecd4e7e1a
added dec2str() function and largest_t type, removed itoa() and ltoa()
Timo Sirainen <tss@iki.fi>
parents:
175
diff
changeset
|
228 if test x$ac_cv_sizeof_long_long != x0; then |
0ffecd4e7e1a
added dec2str() function and largest_t type, removed itoa() and ltoa()
Timo Sirainen <tss@iki.fi>
parents:
175
diff
changeset
|
229 AC_DEFINE(LARGEST_T_LONG_LONG) |
0ffecd4e7e1a
added dec2str() function and largest_t type, removed itoa() and ltoa()
Timo Sirainen <tss@iki.fi>
parents:
175
diff
changeset
|
230 else |
0ffecd4e7e1a
added dec2str() function and largest_t type, removed itoa() and ltoa()
Timo Sirainen <tss@iki.fi>
parents:
175
diff
changeset
|
231 AC_DEFINE(LARGEST_T_LONG) |
0ffecd4e7e1a
added dec2str() function and largest_t type, removed itoa() and ltoa()
Timo Sirainen <tss@iki.fi>
parents:
175
diff
changeset
|
232 fi |
0ffecd4e7e1a
added dec2str() function and largest_t type, removed itoa() and ltoa()
Timo Sirainen <tss@iki.fi>
parents:
175
diff
changeset
|
233 |
439
b66ccecbc8a6
Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents:
426
diff
changeset
|
234 dnl * memory alignment |
b66ccecbc8a6
Added --with-mem-align=BYTES option
Timo Sirainen <tss@iki.fi>
parents:
426
diff
changeset
|
235 AC_DEFINE_UNQUOTED(MEM_ALIGN_SIZE, $mem_align) |
0 | 236 |
237 dnl * socklen_t - AC_CHECK_TYPE() would be _really_ useful if it only would | |
238 dnl * accept header files where to find the typedef.. | |
239 AC_MSG_CHECKING([for socklen_t]) | |
240 AC_CACHE_VAL(i_cv_type_socklen_t, | |
241 [AC_TRY_COMPILE([ | |
242 #include <sys/types.h> | |
243 #include <sys/socket.h>], | |
244 [socklen_t t;], | |
245 i_cv_type_socklen_t=yes, | |
246 i_cv_type_socklen_t=no, | |
247 )]) | |
248 if test $i_cv_type_socklen_t = no; then | |
249 AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.) | |
250 fi | |
251 AC_MSG_RESULT($i_cv_type_socklen_t) | |
252 | |
253 dnl * do we have tm_gmtoff | |
254 AC_MSG_CHECKING([for tm_gmtoff]) | |
255 AC_CACHE_VAL(i_cv_field_tm_gmtoff, | |
256 [AC_TRY_COMPILE([ | |
257 #include <time.h>], | |
258 [struct tm *tm; return tm->tm_gmtoff;], | |
259 i_cv_field_tm_gmtoff=yes, | |
260 i_cv_field_tm_gmtoff=no, | |
261 )]) | |
262 if test $i_cv_field_tm_gmtoff = yes; then | |
263 AC_DEFINE(HAVE_TM_GMTOFF) | |
264 fi | |
265 AC_MSG_RESULT($i_cv_field_tm_gmtoff) | |
266 | |
411 | 267 dnl * do we have struct iovec |
268 AC_MSG_CHECKING([for struct iovec]) | |
269 AC_CACHE_VAL(i_cv_struct_iovec, | |
412 | 270 [AC_TRY_COMPILE([ |
411 | 271 #include <sys/types.h> |
272 #include <sys/uio.h> | |
273 #include <unistd.h>], | |
274 [struct iovec *iovec;], | |
275 i_cv_struct_iovec=yes, | |
276 i_cv_struct_iovec=no)]) | |
277 | |
278 if test $i_cv_struct_iovec = yes; then | |
279 AC_DEFINE(HAVE_STRUCT_IOVEC) | |
280 fi | |
281 AC_MSG_RESULT($i_cv_struct_iovec) | |
282 | |
528
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
283 dnl * Linux compatible mremap() |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
284 AC_MSG_CHECKING([Linux compatible mremap()]) |
529
3a1be480d16a
buggy checks. we were supposed to compile them, not run. plus fixes for
Timo Sirainen <tss@iki.fi>
parents:
528
diff
changeset
|
285 AC_TRY_COMPILE([ |
224 | 286 #include <unistd.h> |
287 #define __USE_GNU | |
288 #include <sys/mman.h> | |
529
3a1be480d16a
buggy checks. we were supposed to compile them, not run. plus fixes for
Timo Sirainen <tss@iki.fi>
parents:
528
diff
changeset
|
289 ], [ |
3a1be480d16a
buggy checks. we were supposed to compile them, not run. plus fixes for
Timo Sirainen <tss@iki.fi>
parents:
528
diff
changeset
|
290 mremap(0, 0, 0, MREMAP_MAYMOVE); |
224 | 291 ], [ |
292 AC_DEFINE(HAVE_LINUX_MREMAP) | |
293 AC_MSG_RESULT(yes) | |
294 ], [ | |
295 AC_MSG_RESULT(no) | |
296 ]) | |
297 | |
528
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
298 dnl * Linux compatible sendfile() |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
299 AC_MSG_CHECKING([Linux compatible sendfile()]) |
529
3a1be480d16a
buggy checks. we were supposed to compile them, not run. plus fixes for
Timo Sirainen <tss@iki.fi>
parents:
528
diff
changeset
|
300 AC_TRY_COMPILE([ |
530
e815df17e52e
and fix linux-sendfile check so it fails with freebsd :)
Timo Sirainen <tss@iki.fi>
parents:
529
diff
changeset
|
301 #include <sys/types.h> |
e815df17e52e
and fix linux-sendfile check so it fails with freebsd :)
Timo Sirainen <tss@iki.fi>
parents:
529
diff
changeset
|
302 #include <sys/socket.h> |
e815df17e52e
and fix linux-sendfile check so it fails with freebsd :)
Timo Sirainen <tss@iki.fi>
parents:
529
diff
changeset
|
303 #include <sys/uio.h> |
528
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
304 #include <sys/sendfile.h> |
529
3a1be480d16a
buggy checks. we were supposed to compile them, not run. plus fixes for
Timo Sirainen <tss@iki.fi>
parents:
528
diff
changeset
|
305 ], [ |
3a1be480d16a
buggy checks. we were supposed to compile them, not run. plus fixes for
Timo Sirainen <tss@iki.fi>
parents:
528
diff
changeset
|
306 sendfile(0, 0, (void *) 0, 0); |
528
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
307 ], [ |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
308 AC_DEFINE(HAVE_LINUX_SENDFILE) |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
309 AC_MSG_RESULT(yes) |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
310 ], [ |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
311 AC_MSG_RESULT(no) |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
312 ]) |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
313 |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
314 dnl * FreeBSD compatible sendfile() |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
315 AC_MSG_CHECKING([FreeBSD compatible sendfile()]) |
529
3a1be480d16a
buggy checks. we were supposed to compile them, not run. plus fixes for
Timo Sirainen <tss@iki.fi>
parents:
528
diff
changeset
|
316 AC_TRY_COMPILE([ |
528
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
317 #include <sys/types.h> |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
318 #include <sys/socket.h> |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
319 #include <sys/uio.h> |
529
3a1be480d16a
buggy checks. we were supposed to compile them, not run. plus fixes for
Timo Sirainen <tss@iki.fi>
parents:
528
diff
changeset
|
320 ], [ |
3a1be480d16a
buggy checks. we were supposed to compile them, not run. plus fixes for
Timo Sirainen <tss@iki.fi>
parents:
528
diff
changeset
|
321 struct sf_hdtr hdtr; |
3a1be480d16a
buggy checks. we were supposed to compile them, not run. plus fixes for
Timo Sirainen <tss@iki.fi>
parents:
528
diff
changeset
|
322 sendfile(0, 0, 0, 0, &hdtr, (void *) 0, 0); |
528
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
323 ], [ |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
324 AC_DEFINE(HAVE_FREEBSD_SENDFILE) |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
325 AC_MSG_RESULT(yes) |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
326 ], [ |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
327 AC_MSG_RESULT(no) |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
328 ]) |
a95b1ccff82e
Support FreeBSD-compatible sendfile(). Completely untested.
Timo Sirainen <tss@iki.fi>
parents:
494
diff
changeset
|
329 |
0 | 330 dnl ** |
331 dnl ** SSL (gnutls) | |
332 dnl ** | |
333 | |
244 | 334 if test $want_gnutls = yes; then |
335 AC_CHECK_LIB(gnutls, gnutls_global_init, [ | |
336 AC_DEFINE(HAVE_SSL) | |
337 SSL_LIBS="-lgnutls -lgcrypt" | |
338 AC_SUBST(SSL_LIBS) | |
339 have_ssl=yes | |
340 ], [ | |
341 have_ssl=no | |
342 ], -lgcrypt) | |
247
cba0daefb7a5
report --without-gnutls better..
Timo Sirainen <tss@iki.fi>
parents:
246
diff
changeset
|
343 else |
cba0daefb7a5
report --without-gnutls better..
Timo Sirainen <tss@iki.fi>
parents:
246
diff
changeset
|
344 have_ssl=no |
244 | 345 fi |
0 | 346 |
347 dnl ** | |
348 dnl ** shadow/pam support | |
349 dnl ** | |
350 | |
351 need_crypt=no | |
352 auths="" | |
353 | |
354 if test $want_passwd = yes; then | |
355 need_crypt=yes | |
356 AC_DEFINE(USERINFO_PASSWD) | |
357 auths="$auths passwd" | |
358 fi | |
359 | |
360 if test $want_passwd_file = yes; then | |
361 need_crypt=yes | |
362 AC_DEFINE(USERINFO_PASSWD_FILE) | |
363 auths="$auths passwd-file" | |
364 fi | |
365 | |
366 if test $want_shadow = yes; then | |
367 AC_CHECK_FUNC(getspnam, [ | |
368 need_crypt=yes | |
369 AC_DEFINE(USERINFO_SHADOW) | |
370 auths="$auths shadow" | |
371 ]) | |
372 fi | |
373 | |
374 if test $want_pam = yes; then | |
375 AC_CHECK_LIB(pam, pam_start, [ | |
376 AC_CHECK_HEADER(security/pam_appl.h, [ | |
377 USERINFO_LIBS="$USERINFO_LIBS -lpam" | |
378 AC_DEFINE(USERINFO_PAM) | |
379 auths="$auths pam" | |
380 ]) | |
381 ]) | |
382 fi | |
383 | |
280
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
384 if test $want_vpopmail = yes; then |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
385 vpopmail_home="`echo ~vpopmail`" |
281 | 386 vpop_libdeps="$vpopmail_home/etc/lib_deps" |
387 | |
388 AC_MSG_CHECKING([for vpopmail configuration at $vpop_libdeps]) | |
389 if test -f $vpop_libdeps; then | |
283 | 390 need_crypt=yes |
280
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
391 VPOPMAIL_CFLAGS="`cat $vpopmail_home/etc/inc_deps` $CFLAGS" |
281 | 392 VPOPMAIL_LIBS="`cat $vpop_libdeps`" |
280
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
393 AC_DEFINE(USERINFO_VPOPMAIL) |
282 | 394 auths="$auths vpopmail" |
281 | 395 AC_MSG_RESULT(found) |
280
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
396 else |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
397 want_vpopmail=no |
281 | 398 AC_MSG_RESULT(not found) |
280
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
399 fi |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
400 fi |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
401 |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
402 AC_SUBST(VPOPMAIL_CFLAGS) |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
403 AC_SUBST(VPOPMAIL_LIBS) |
fa2d1a1d025e
vpopmail authentication. compiles, not tested if it really works.
Timo Sirainen <tss@iki.fi>
parents:
247
diff
changeset
|
404 |
0 | 405 if test $need_crypt = yes; then |
406 AC_CHECK_LIB(crypt, crypt, [ | |
407 USERINFO_LIBS="$USERINFO_LIBS -lcrypt" | |
408 ], [ | |
409 AC_CHECK_FUNC(crypt,, [ | |
410 AC_ERROR([crypt() wasn't found]) | |
411 ]) | |
412 ]) | |
413 fi | |
414 | |
415 AC_SUBST(USERINFO_LIBS) | |
416 | |
417 dnl ** | |
418 dnl ** Index file compatibility flags | |
419 dnl ** | |
420 | |
421 dnl * currently just checking for endianess | |
422 | |
423 AC_C_BIGENDIAN | |
424 | |
425 if test $ac_cv_c_bigendian = yes; then | |
426 flags=0 | |
427 | |
428 else | |
429 flags=1 | |
430 fi | |
431 | |
432 AC_DEFINE_UNQUOTED(MAIL_INDEX_COMPAT_FLAGS, $flags) | |
433 | |
434 dnl ** | |
435 dnl ** IPv6 support | |
436 dnl ** | |
437 | |
438 if test "x$want_ipv6" = "xyes"; then | |
439 AC_MSG_CHECKING([for IPv6]) | |
440 AC_CACHE_VAL(i_cv_type_in6_addr, | |
441 [AC_TRY_COMPILE([ | |
442 #include <sys/types.h> | |
443 #include <sys/socket.h> | |
444 #include <netinet/in.h> | |
445 #include <netdb.h> | |
446 #include <arpa/inet.h>], | |
447 [struct in6_addr i;], | |
448 i_cv_type_in6_addr=yes, | |
449 i_cv_type_in6_addr=no, | |
450 )]) | |
451 if test $i_cv_type_in6_addr = yes; then | |
452 AC_DEFINE(HAVE_IPV6) | |
453 fi | |
454 AC_MSG_RESULT($i_cv_type_in6_addr) | |
455 fi | |
456 | |
457 dnl ** | |
458 dnl ** capabilities | |
459 dnl ** | |
460 | |
461 capability="IMAP4rev1" | |
462 if test "$have_ssl" = "yes"; then | |
463 capability="$capability STARTTLS" | |
464 fi | |
465 AC_DEFINE_UNQUOTED(CAPABILITY_STRING, "$capability") | |
466 | |
467 dnl ** | |
468 dnl ** register the storage classes | |
469 dnl ** | |
470 | |
471 STORAGE="maildir mbox" | |
472 file="src/lib-storage/mail-storage-register.c" | |
473 | |
474 echo "/* this file is generated by configure */" > $file | |
475 echo '#include "lib.h"' >> $file | |
476 echo '#include "mail-storage.h"' >> $file | |
477 for storage in $STORAGE; do | |
478 echo "extern MailStorage ${storage}_storage;" >> $file | |
479 done | |
480 echo "void mail_storage_register_all(void) {" >> $file | |
481 for storage in $STORAGE; do | |
482 echo "mail_storage_class_register(&${storage}_storage);" >> $file | |
483 done | |
484 echo "}" >> $file | |
485 | |
486 AC_OUTPUT( | |
487 Makefile | |
488 doc/Makefile | |
489 src/Makefile | |
490 src/lib/Makefile | |
491 src/lib-imap/Makefile | |
492 src/lib-index/Makefile | |
493 src/lib-index/maildir/Makefile | |
494 src/lib-index/mbox/Makefile | |
495 src/lib-mail/Makefile | |
496 src/lib-storage/Makefile | |
497 src/lib-storage/index/Makefile | |
498 src/lib-storage/index/maildir/Makefile | |
499 src/lib-storage/index/mbox/Makefile | |
500 src/lib-storage/subscription-file/Makefile | |
501 src/auth/Makefile | |
502 src/imap/Makefile | |
503 src/login/Makefile | |
504 src/master/Makefile | |
505 stamp.h) | |
506 | |
507 echo | |
508 echo "Install prefix ............. : $prefix" | |
509 echo "Building with auth modules . :$auths" | |
510 echo "Building with SSL support .. : $have_ssl" | |
511 echo "Building with IPv6 support . : $want_ipv6" |