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