Mercurial > dovecot > original-hg > dovecot-1.2
annotate configure.in @ 55:db8ea2c11ab7 HEAD
whops, 64bit support was disabled.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 28 Aug 2002 02:27:56 +0300 |
parents | d493b9cc265e |
children | 62fc6c729962 |
rev | line source |
---|---|
0 | 1 AC_INIT(src) |
2 | |
3 AM_CONFIG_HEADER(config.h) | |
4 AM_INIT_AUTOMAKE(dovecot, 0.96) | |
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 | |
16 AC_CHECK_HEADERS(string.h stdlib.h unistd.h dirent.h sys/sendfile.h) | |
17 | |
18 # check posix headers | |
19 AC_CHECK_HEADERS(sys/time.h) | |
20 | |
21 AC_ARG_ENABLE(ipv6, | |
22 [ --enable-ipv6 Enable IPv6 support], | |
23 if test x$enableval = xno; then | |
24 want_ipv6=no | |
25 else | |
26 want_ipv6=yes | |
27 fi, | |
28 want_ipv6=no) | |
29 | |
30 AC_ARG_ENABLE(passwd, | |
31 [ --disable-passwd Disable /etc/passwd support], | |
32 if test x$enableval = xno; then | |
33 want_passwd=no | |
34 else | |
35 want_passwd=yes | |
36 fi, | |
37 want_passwd=yes) | |
38 | |
39 AC_ARG_ENABLE(passwd-file, | |
40 [ --disable-passwd-file Disable passwd-like file support], | |
41 if test x$enableval = xno; then | |
42 want_passwd_file=no | |
43 else | |
44 want_passwd_file=yes | |
45 fi, | |
46 want_passwd_file=yes) | |
47 | |
48 AC_ARG_ENABLE(shadow, | |
49 [ --disable-shadow Disable shadow password support], | |
50 if test x$enableval = xno; then | |
51 want_shadow=no | |
52 else | |
53 want_shadow=yes | |
54 fi, | |
55 want_shadow=yes) | |
56 | |
57 AC_ARG_ENABLE(pam, | |
58 [ --disable-pam Disable PAM support], | |
59 if test x$enableval = xno; then | |
60 want_pam=no | |
61 else | |
62 want_pam=yes | |
63 fi, | |
64 want_pam=yes) | |
65 | |
66 dnl ** | |
67 dnl ** just some generic stuff... | |
68 dnl ** | |
69 | |
70 AC_CHECK_FUNC(socket, [], [ | |
71 AC_CHECK_LIB(socket, socket, [ | |
72 LIBS="$LIBS -lsocket" | |
73 ]) | |
74 ]) | |
75 | |
76 AC_CHECK_FUNC(inet_addr, [], [ | |
77 AC_CHECK_LIB(nsl, inet_addr, [ | |
78 LIBS="$LIBS -lnsl" | |
79 ]) | |
80 ]) | |
81 | |
82 dnl * after -lsocket and -lnsl tests, inet_aton() may be in them | |
83 AC_CHECK_FUNCS(fcntl flock inet_aton sigaction getpagesize madvise setreuid) | |
84 AC_CHECK_FUNCS(strcasecmp stricmp vsnprintf memmove vsyslog) | |
85 | |
86 dnl * poll/select? | |
87 | |
88 AC_CHECK_FUNC(poll, [ | |
89 have_poll=yes | |
90 ], [ | |
91 have_poll=no | |
92 ]) | |
93 AM_CONDITIONAL(IOLOOP_POLL, test "$have_poll" = "yes") | |
94 | |
95 dnl * gcc specific options | |
96 if test "x$ac_cv_prog_gcc" = "xyes"; then | |
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
|
97 # -Wchar-subscripts -Wpointer-arith -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
|
98 CFLAGS="$CFLAGS -Wall -W" |
0 | 99 fi |
100 | |
101 dnl * OS specific options | |
102 case "$host_os" in | |
103 hpux*) | |
104 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED" | |
105 ;; | |
106 *) | |
107 ;; | |
108 esac | |
109 | |
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
|
110 dnl * off_t checks, try to make it 64bit |
55
db8ea2c11ab7
whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents:
50
diff
changeset
|
111 preferred_off_t_bits=64 |
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
|
112 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
|
113 |
55
db8ea2c11ab7
whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents:
50
diff
changeset
|
114 AC_CHECK_SIZEOF(int) |
db8ea2c11ab7
whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents:
50
diff
changeset
|
115 AC_CHECK_SIZEOF(long) |
db8ea2c11ab7
whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents:
50
diff
changeset
|
116 AC_CHECK_SIZEOF(long long) |
db8ea2c11ab7
whops, 64bit support was disabled.
Timo Sirainen <tss@iki.fi>
parents:
50
diff
changeset
|
117 |
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
|
118 AC_MSG_CHECKING([size of 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
|
119 sizeof_off_t=0 |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
120 for size in 4 8; do |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
121 AC_TRY_RUN([ |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
122 #define _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
|
123 #include <sys/types.h> |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
124 #include <unistd.h> |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
125 int main() { off_t size; return sizeof(size) == $size ? 0 : 1; } |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
126 ], [ |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
127 sizeof_off_t=$size |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
128 break |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
129 ]) |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
130 done |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
131 |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
132 if test x$sizeof_off_t = x0; 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
|
133 AC_ERROR([Unsupported off_t size]) |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
134 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
|
135 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
|
136 |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
137 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
|
138 # 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
|
139 AC_DEFINE_UNQUOTED(OFF_T_MAX, LONG_MAX) |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
140 AC_DEFINE_UNQUOTED(UOFF_T_FORMAT, "lu") |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
141 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
|
142 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
|
143 # 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
|
144 AC_DEFINE_UNQUOTED(OFF_T_MAX, INT_MAX) |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
145 AC_DEFINE_UNQUOTED(UOFF_T_FORMAT, "u") |
d493b9cc265e
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
146 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
|
147 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
|
148 # and finally 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
|
149 AC_DEFINE_UNQUOTED(OFF_T_MAX, LONG_LONG_MAX) |
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(UOFF_T_FORMAT, "llu") |
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 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
|
152 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
|
153 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
|
154 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
|
155 |
0 | 156 dnl * memory alignment, could be 1 for x86 systems but 4 should be |
157 dnl * compatible with everyone. note that only 1, 2 and 4 work corrently. | |
158 dnl * is 8 needed anywhere? | |
159 AC_DEFINE(MEM_ALIGN_SIZE, 4) | |
160 | |
161 dnl * socklen_t - AC_CHECK_TYPE() would be _really_ useful if it only would | |
162 dnl * accept header files where to find the typedef.. | |
163 AC_MSG_CHECKING([for socklen_t]) | |
164 AC_CACHE_VAL(i_cv_type_socklen_t, | |
165 [AC_TRY_COMPILE([ | |
166 #include <sys/types.h> | |
167 #include <sys/socket.h>], | |
168 [socklen_t t;], | |
169 i_cv_type_socklen_t=yes, | |
170 i_cv_type_socklen_t=no, | |
171 )]) | |
172 if test $i_cv_type_socklen_t = no; then | |
173 AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.) | |
174 fi | |
175 AC_MSG_RESULT($i_cv_type_socklen_t) | |
176 | |
177 dnl * do we have tm_gmtoff | |
178 AC_MSG_CHECKING([for tm_gmtoff]) | |
179 AC_CACHE_VAL(i_cv_field_tm_gmtoff, | |
180 [AC_TRY_COMPILE([ | |
181 #include <time.h>], | |
182 [struct tm *tm; return tm->tm_gmtoff;], | |
183 i_cv_field_tm_gmtoff=yes, | |
184 i_cv_field_tm_gmtoff=no, | |
185 )]) | |
186 if test $i_cv_field_tm_gmtoff = yes; then | |
187 AC_DEFINE(HAVE_TM_GMTOFF) | |
188 fi | |
189 AC_MSG_RESULT($i_cv_field_tm_gmtoff) | |
190 | |
191 dnl ** | |
192 dnl ** SSL (gnutls) | |
193 dnl ** | |
194 | |
195 AC_CHECK_LIB(gnutls, gnutls_global_init, [ | |
196 AC_DEFINE(HAVE_SSL) | |
197 SSL_LIBS="-lgnutls -lgcrypt" | |
198 AC_SUBST(SSL_LIBS) | |
199 have_ssl=yes | |
200 ], [ | |
201 have_ssl=no | |
202 ], -lgcrypt) | |
203 | |
204 dnl ** | |
205 dnl ** shadow/pam support | |
206 dnl ** | |
207 | |
208 need_crypt=no | |
209 auths="" | |
210 | |
211 if test $want_passwd = yes; then | |
212 need_crypt=yes | |
213 AC_DEFINE(USERINFO_PASSWD) | |
214 auths="$auths passwd" | |
215 fi | |
216 | |
217 if test $want_passwd_file = yes; then | |
218 need_crypt=yes | |
219 AC_DEFINE(USERINFO_PASSWD_FILE) | |
220 auths="$auths passwd-file" | |
221 fi | |
222 | |
223 if test $want_shadow = yes; then | |
224 AC_CHECK_FUNC(getspnam, [ | |
225 need_crypt=yes | |
226 AC_DEFINE(USERINFO_SHADOW) | |
227 auths="$auths shadow" | |
228 ]) | |
229 fi | |
230 | |
231 if test $want_pam = yes; then | |
232 AC_CHECK_LIB(pam, pam_start, [ | |
233 AC_CHECK_HEADER(security/pam_appl.h, [ | |
234 USERINFO_LIBS="$USERINFO_LIBS -lpam" | |
235 AC_DEFINE(USERINFO_PAM) | |
236 auths="$auths pam" | |
237 ]) | |
238 ]) | |
239 fi | |
240 | |
241 if test $need_crypt = yes; then | |
242 AC_CHECK_LIB(crypt, crypt, [ | |
243 USERINFO_LIBS="$USERINFO_LIBS -lcrypt" | |
244 ], [ | |
245 AC_CHECK_FUNC(crypt,, [ | |
246 AC_ERROR([crypt() wasn't found]) | |
247 ]) | |
248 ]) | |
249 fi | |
250 | |
251 AC_SUBST(USERINFO_LIBS) | |
252 | |
253 dnl ** | |
254 dnl ** Index file compatibility flags | |
255 dnl ** | |
256 | |
257 dnl * currently just checking for endianess | |
258 | |
259 AC_C_BIGENDIAN | |
260 | |
261 if test $ac_cv_c_bigendian = yes; then | |
262 flags=0 | |
263 | |
264 else | |
265 flags=1 | |
266 fi | |
267 | |
268 AC_DEFINE_UNQUOTED(MAIL_INDEX_COMPAT_FLAGS, $flags) | |
269 | |
270 dnl ** | |
271 dnl ** IPv6 support | |
272 dnl ** | |
273 | |
274 if test "x$want_ipv6" = "xyes"; then | |
275 AC_MSG_CHECKING([for IPv6]) | |
276 AC_CACHE_VAL(i_cv_type_in6_addr, | |
277 [AC_TRY_COMPILE([ | |
278 #include <sys/types.h> | |
279 #include <sys/socket.h> | |
280 #include <netinet/in.h> | |
281 #include <netdb.h> | |
282 #include <arpa/inet.h>], | |
283 [struct in6_addr i;], | |
284 i_cv_type_in6_addr=yes, | |
285 i_cv_type_in6_addr=no, | |
286 )]) | |
287 if test $i_cv_type_in6_addr = yes; then | |
288 AC_DEFINE(HAVE_IPV6) | |
289 fi | |
290 AC_MSG_RESULT($i_cv_type_in6_addr) | |
291 fi | |
292 | |
293 dnl ** | |
294 dnl ** capabilities | |
295 dnl ** | |
296 | |
297 capability="IMAP4rev1" | |
298 if test "$have_ssl" = "yes"; then | |
299 capability="$capability STARTTLS" | |
300 fi | |
301 AC_DEFINE_UNQUOTED(CAPABILITY_STRING, "$capability") | |
302 | |
303 dnl ** | |
304 dnl ** register the storage classes | |
305 dnl ** | |
306 | |
307 STORAGE="maildir mbox" | |
308 file="src/lib-storage/mail-storage-register.c" | |
309 | |
310 echo "/* this file is generated by configure */" > $file | |
311 echo '#include "lib.h"' >> $file | |
312 echo '#include "mail-storage.h"' >> $file | |
313 for storage in $STORAGE; do | |
314 echo "extern MailStorage ${storage}_storage;" >> $file | |
315 done | |
316 echo "void mail_storage_register_all(void) {" >> $file | |
317 for storage in $STORAGE; do | |
318 echo "mail_storage_class_register(&${storage}_storage);" >> $file | |
319 done | |
320 echo "}" >> $file | |
321 | |
322 AC_OUTPUT( | |
323 Makefile | |
324 doc/Makefile | |
325 src/Makefile | |
326 src/lib/Makefile | |
327 src/lib-imap/Makefile | |
328 src/lib-index/Makefile | |
329 src/lib-index/maildir/Makefile | |
330 src/lib-index/mbox/Makefile | |
331 src/lib-mail/Makefile | |
332 src/lib-storage/Makefile | |
333 src/lib-storage/index/Makefile | |
334 src/lib-storage/index/maildir/Makefile | |
335 src/lib-storage/index/mbox/Makefile | |
336 src/lib-storage/subscription-file/Makefile | |
337 src/lib-storage/flags-file/Makefile | |
338 src/auth/Makefile | |
339 src/imap/Makefile | |
340 src/login/Makefile | |
341 src/master/Makefile | |
342 stamp.h) | |
343 | |
344 echo | |
345 echo "Install prefix ............. : $prefix" | |
346 echo "Building with auth modules . :$auths" | |
347 echo "Building with SSL support .. : $have_ssl" | |
348 echo "Building with IPv6 support . : $want_ipv6" |