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
|
|
97 # -W -Wchar-subscripts -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
|
|
98 CFLAGS="$CFLAGS -Wall"
|
|
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
|
|
110 dnl * memory alignment, could be 1 for x86 systems but 4 should be
|
|
111 dnl * compatible with everyone. note that only 1, 2 and 4 work corrently.
|
|
112 dnl * is 8 needed anywhere?
|
|
113 AC_DEFINE(MEM_ALIGN_SIZE, 4)
|
|
114
|
|
115 dnl * socklen_t - AC_CHECK_TYPE() would be _really_ useful if it only would
|
|
116 dnl * accept header files where to find the typedef..
|
|
117 AC_MSG_CHECKING([for socklen_t])
|
|
118 AC_CACHE_VAL(i_cv_type_socklen_t,
|
|
119 [AC_TRY_COMPILE([
|
|
120 #include <sys/types.h>
|
|
121 #include <sys/socket.h>],
|
|
122 [socklen_t t;],
|
|
123 i_cv_type_socklen_t=yes,
|
|
124 i_cv_type_socklen_t=no,
|
|
125 )])
|
|
126 if test $i_cv_type_socklen_t = no; then
|
|
127 AC_DEFINE(socklen_t, int, Define to 'int' if <sys/socket.h> doesn't define.)
|
|
128 fi
|
|
129 AC_MSG_RESULT($i_cv_type_socklen_t)
|
|
130
|
|
131 dnl * do we have tm_gmtoff
|
|
132 AC_MSG_CHECKING([for tm_gmtoff])
|
|
133 AC_CACHE_VAL(i_cv_field_tm_gmtoff,
|
|
134 [AC_TRY_COMPILE([
|
|
135 #include <time.h>],
|
|
136 [struct tm *tm; return tm->tm_gmtoff;],
|
|
137 i_cv_field_tm_gmtoff=yes,
|
|
138 i_cv_field_tm_gmtoff=no,
|
|
139 )])
|
|
140 if test $i_cv_field_tm_gmtoff = yes; then
|
|
141 AC_DEFINE(HAVE_TM_GMTOFF)
|
|
142 fi
|
|
143 AC_MSG_RESULT($i_cv_field_tm_gmtoff)
|
|
144
|
|
145 dnl **
|
|
146 dnl ** SSL (gnutls)
|
|
147 dnl **
|
|
148
|
|
149 AC_CHECK_LIB(gnutls, gnutls_global_init, [
|
|
150 AC_DEFINE(HAVE_SSL)
|
|
151 SSL_LIBS="-lgnutls -lgcrypt"
|
|
152 AC_SUBST(SSL_LIBS)
|
|
153 have_ssl=yes
|
|
154 ], [
|
|
155 have_ssl=no
|
|
156 ], -lgcrypt)
|
|
157
|
|
158 dnl **
|
|
159 dnl ** shadow/pam support
|
|
160 dnl **
|
|
161
|
|
162 need_crypt=no
|
|
163 auths=""
|
|
164
|
|
165 if test $want_passwd = yes; then
|
|
166 need_crypt=yes
|
|
167 AC_DEFINE(USERINFO_PASSWD)
|
|
168 auths="$auths passwd"
|
|
169 fi
|
|
170
|
|
171 if test $want_passwd_file = yes; then
|
|
172 need_crypt=yes
|
|
173 AC_DEFINE(USERINFO_PASSWD_FILE)
|
|
174 auths="$auths passwd-file"
|
|
175 fi
|
|
176
|
|
177 if test $want_shadow = yes; then
|
|
178 AC_CHECK_FUNC(getspnam, [
|
|
179 need_crypt=yes
|
|
180 AC_DEFINE(USERINFO_SHADOW)
|
|
181 auths="$auths shadow"
|
|
182 ])
|
|
183 fi
|
|
184
|
|
185 if test $want_pam = yes; then
|
|
186 AC_CHECK_LIB(pam, pam_start, [
|
|
187 AC_CHECK_HEADER(security/pam_appl.h, [
|
|
188 USERINFO_LIBS="$USERINFO_LIBS -lpam"
|
|
189 AC_DEFINE(USERINFO_PAM)
|
|
190 auths="$auths pam"
|
|
191 ])
|
|
192 ])
|
|
193 fi
|
|
194
|
|
195 if test $need_crypt = yes; then
|
|
196 AC_CHECK_LIB(crypt, crypt, [
|
|
197 USERINFO_LIBS="$USERINFO_LIBS -lcrypt"
|
|
198 ], [
|
|
199 AC_CHECK_FUNC(crypt,, [
|
|
200 AC_ERROR([crypt() wasn't found])
|
|
201 ])
|
|
202 ])
|
|
203 fi
|
|
204
|
|
205 AC_SUBST(USERINFO_LIBS)
|
|
206
|
|
207 dnl **
|
|
208 dnl ** Index file compatibility flags
|
|
209 dnl **
|
|
210
|
|
211 dnl * currently just checking for endianess
|
|
212
|
|
213 AC_C_BIGENDIAN
|
|
214
|
|
215 if test $ac_cv_c_bigendian = yes; then
|
|
216 flags=0
|
|
217
|
|
218 else
|
|
219 flags=1
|
|
220 fi
|
|
221
|
|
222 AC_DEFINE_UNQUOTED(MAIL_INDEX_COMPAT_FLAGS, $flags)
|
|
223
|
|
224 dnl **
|
|
225 dnl ** IPv6 support
|
|
226 dnl **
|
|
227
|
|
228 if test "x$want_ipv6" = "xyes"; then
|
|
229 AC_MSG_CHECKING([for IPv6])
|
|
230 AC_CACHE_VAL(i_cv_type_in6_addr,
|
|
231 [AC_TRY_COMPILE([
|
|
232 #include <sys/types.h>
|
|
233 #include <sys/socket.h>
|
|
234 #include <netinet/in.h>
|
|
235 #include <netdb.h>
|
|
236 #include <arpa/inet.h>],
|
|
237 [struct in6_addr i;],
|
|
238 i_cv_type_in6_addr=yes,
|
|
239 i_cv_type_in6_addr=no,
|
|
240 )])
|
|
241 if test $i_cv_type_in6_addr = yes; then
|
|
242 AC_DEFINE(HAVE_IPV6)
|
|
243 fi
|
|
244 AC_MSG_RESULT($i_cv_type_in6_addr)
|
|
245 fi
|
|
246
|
|
247 dnl **
|
|
248 dnl ** capabilities
|
|
249 dnl **
|
|
250
|
|
251 capability="IMAP4rev1"
|
|
252 if test "$have_ssl" = "yes"; then
|
|
253 capability="$capability STARTTLS"
|
|
254 fi
|
|
255 AC_DEFINE_UNQUOTED(CAPABILITY_STRING, "$capability")
|
|
256
|
|
257 dnl **
|
|
258 dnl ** register the storage classes
|
|
259 dnl **
|
|
260
|
|
261 STORAGE="maildir mbox"
|
|
262 file="src/lib-storage/mail-storage-register.c"
|
|
263
|
|
264 echo "/* this file is generated by configure */" > $file
|
|
265 echo '#include "lib.h"' >> $file
|
|
266 echo '#include "mail-storage.h"' >> $file
|
|
267 for storage in $STORAGE; do
|
|
268 echo "extern MailStorage ${storage}_storage;" >> $file
|
|
269 done
|
|
270 echo "void mail_storage_register_all(void) {" >> $file
|
|
271 for storage in $STORAGE; do
|
|
272 echo "mail_storage_class_register(&${storage}_storage);" >> $file
|
|
273 done
|
|
274 echo "}" >> $file
|
|
275
|
|
276 AC_OUTPUT(
|
|
277 Makefile
|
|
278 doc/Makefile
|
|
279 src/Makefile
|
|
280 src/lib/Makefile
|
|
281 src/lib-imap/Makefile
|
|
282 src/lib-index/Makefile
|
|
283 src/lib-index/maildir/Makefile
|
|
284 src/lib-index/mbox/Makefile
|
|
285 src/lib-mail/Makefile
|
|
286 src/lib-storage/Makefile
|
|
287 src/lib-storage/index/Makefile
|
|
288 src/lib-storage/index/maildir/Makefile
|
|
289 src/lib-storage/index/mbox/Makefile
|
|
290 src/lib-storage/subscription-file/Makefile
|
|
291 src/lib-storage/flags-file/Makefile
|
|
292 src/auth/Makefile
|
|
293 src/imap/Makefile
|
|
294 src/login/Makefile
|
|
295 src/master/Makefile
|
|
296 stamp.h)
|
|
297
|
|
298 echo
|
|
299 echo "Install prefix ............. : $prefix"
|
|
300 echo "Building with auth modules . :$auths"
|
|
301 echo "Building with SSL support .. : $have_ssl"
|
|
302 echo "Building with IPv6 support . : $want_ipv6"
|