rev |
line source |
meillo@0
|
1 dnl Process this file with autoconf to produce a configure script.
|
meillo@0
|
2
|
meillo@0
|
3 AC_PREREQ(2.59)
|
meillo@159
|
4 AC_INIT(masqmail, 0.3.0, meillo@marmaro.de)
|
meillo@0
|
5 AC_CONFIG_SRCDIR([src/masqmail.c])
|
meillo@0
|
6 AM_CONFIG_HEADER(config.h)
|
meillo@0
|
7 AM_INIT_AUTOMAKE()
|
meillo@0
|
8
|
meillo@0
|
9 dnl Checks for programs.
|
meillo@0
|
10
|
meillo@0
|
11 dnl Checks for libraries.
|
meillo@0
|
12
|
meillo@0
|
13 AC_PROG_CC
|
meillo@0
|
14 AC_ISC_POSIX
|
meillo@0
|
15 AC_STDC_HEADERS
|
meillo@0
|
16 dnl AC_ARG_PROGRAM
|
meillo@0
|
17 AC_PROG_RANLIB
|
meillo@0
|
18
|
meillo@0
|
19 PKG_CHECK_MODULES(GLIB, glib-2.0)
|
meillo@0
|
20 AC_SUBST(GLIB_LIBS)
|
meillo@0
|
21 AC_SUBST(GLIB_CFLAGS)
|
meillo@0
|
22
|
meillo@0
|
23 dnl resolver support (default is use it)
|
meillo@0
|
24 AC_ARG_ENABLE(resolver,
|
meillo@0
|
25 [ --disable-resolver disable resolver support],
|
meillo@0
|
26 if test "$enable_resolver" != 'no'; then
|
meillo@0
|
27 resolver_enabled='yes'
|
meillo@0
|
28 fi,
|
meillo@0
|
29 resolver_enabled='yes'
|
meillo@0
|
30 )
|
meillo@0
|
31
|
meillo@0
|
32 if test "$resolver_enabled" = yes; then
|
meillo@0
|
33 AC_DEFINE(ENABLE_RESOLVER, 1, [If the resolver is to be used])
|
meillo@0
|
34 dnl checks necessary for libc5:
|
meillo@0
|
35 dnl if there is res_search in libc, it is probably libc5
|
meillo@0
|
36 dnl if not, it is probably libc6 and we need libresolv
|
meillo@0
|
37 AC_CHECK_LIB(c, res_search, need_resolv=no, need_resolv=yes)
|
meillo@0
|
38 if test "$need_resolv" = yes; then
|
meillo@1
|
39 AC_CHECK_LIB(resolv, res_search,
|
meillo@1
|
40 has_resolv=yes; RESOLV_LIBS="-lresolv",
|
meillo@1
|
41 has_resolv=no)
|
meillo@1
|
42 if test "$has_resolv" = no; then
|
meillo@1
|
43 saved_LIBS="$LIBS"
|
meillo@1
|
44 LIBS="$LIBS -lresolv"
|
meillo@1
|
45 AC_MSG_CHECKING(for res_search in -lresolv)
|
meillo@1
|
46 AC_TRY_LINK([#include <resolv.h>],
|
meillo@1
|
47 [res_search (0, 0, 0, 0, 0);],
|
meillo@1
|
48 RESOLV_LIBS="-lresolv"; has_resolv=yes; AC_MSG_RESULT(yes),
|
meillo@1
|
49 AC_MSG_RESULT(no));
|
meillo@1
|
50 LIBS="$saved_LIBS"
|
meillo@1
|
51 fi
|
meillo@1
|
52 if test "$has_resolv" = no; then
|
meillo@1
|
53 AC_MSG_ERROR("no libresolv")
|
meillo@1
|
54 RESOLV_LIBS=''
|
meillo@1
|
55 fi
|
meillo@0
|
56 fi
|
meillo@0
|
57 else
|
meillo@0
|
58 RESOLV_LIBS=''
|
meillo@0
|
59 fi
|
meillo@0
|
60 AC_SUBST(RESOLV_LIBS)
|
meillo@0
|
61
|
meillo@0
|
62 dnl if there is no getline, we define it using getdelim in src/masqmail.h
|
meillo@0
|
63 AC_CHECK_FUNCS(getline)
|
meillo@0
|
64
|
meillo@0
|
65 dnl if there is no fdatasync, we define it to fsync in src/masqmail.h
|
meillo@0
|
66 AC_CHECK_FUNCS(fdatasync)
|
meillo@0
|
67
|
meillo@0
|
68 dnl Checks for header files.
|
meillo@0
|
69 AC_HEADER_STDC
|
meillo@0
|
70 AC_CHECK_HEADERS(fcntl.h sys/time.h syslog.h unistd.h)
|
meillo@0
|
71
|
meillo@0
|
72 dnl Checks for typedefs, structures, and compiler characteristics.
|
meillo@0
|
73 AC_C_CONST
|
meillo@0
|
74 AC_TYPE_PID_T
|
meillo@0
|
75 AC_TYPE_SIZE_T
|
meillo@0
|
76 AC_HEADER_TIME
|
meillo@0
|
77 AC_STRUCT_TM
|
meillo@0
|
78
|
meillo@0
|
79 dnl Checks for library functions.
|
meillo@0
|
80 AC_FUNC_FNMATCH
|
meillo@0
|
81 AC_TYPE_SIGNAL
|
meillo@0
|
82 AC_FUNC_STRFTIME
|
meillo@0
|
83 AC_FUNC_VPRINTF
|
meillo@0
|
84 AC_CHECK_FUNCS(select socket strerror strstr)
|
meillo@0
|
85
|
meillo@0
|
86 dnl user and group configuration
|
meillo@0
|
87 AC_ARG_WITH(user,
|
meillo@0
|
88 [ --with-user=USER set user [mail]],
|
meillo@0
|
89 )
|
meillo@0
|
90 if test "x$with_user" = 'x'; then
|
meillo@0
|
91 with_user='mail'
|
meillo@0
|
92 fi
|
meillo@0
|
93
|
meillo@0
|
94 AC_ARG_WITH(group,
|
meillo@0
|
95 [ --with-group=GROUP set group [trusted]],
|
meillo@0
|
96 )
|
meillo@0
|
97 if test "x$with_group" = 'x'; then
|
meillo@0
|
98 with_group='trusted'
|
meillo@0
|
99 fi
|
meillo@0
|
100
|
meillo@0
|
101 dnl debugging support (default is use it)
|
meillo@0
|
102 AC_ARG_ENABLE(debug,
|
meillo@0
|
103 [ --disable-debug disable debugging],
|
meillo@0
|
104 if test "x$enable_debug" != 'xno'; then
|
meillo@0
|
105 debug_enabled='yes'
|
meillo@0
|
106 fi,
|
meillo@0
|
107 debug_enabled='yes'
|
meillo@0
|
108 )
|
meillo@0
|
109 if test "x$debug_enabled" = xyes; then
|
meillo@0
|
110 AC_DEFINE(ENABLE_DEBUG, 1, [If debugging is enabled])
|
meillo@0
|
111 fi
|
meillo@0
|
112
|
meillo@0
|
113 AC_DEFINE_UNQUOTED(DEF_MAIL_USER, "${with_user}", [The mail user])
|
meillo@0
|
114 AC_SUBST(with_user)
|
meillo@0
|
115 AC_DEFINE_UNQUOTED(DEF_MAIL_GROUP, "${with_group}", [The mail group])
|
meillo@0
|
116 AC_SUBST(with_group)
|
meillo@0
|
117
|
meillo@0
|
118 dnl link glib statically?
|
meillo@0
|
119 AC_ARG_WITH(glib_static,
|
meillo@0
|
120 [ --with-glib-static=path link glib statically (path mandatory!)],
|
meillo@0
|
121 )
|
meillo@0
|
122 if test "x$with_glib_static" != 'x'; then
|
meillo@0
|
123 GLIB_LIBS=$with_glib_static
|
meillo@0
|
124 AC_SUBST(GLIB_LIBS)
|
meillo@0
|
125 fi
|
meillo@0
|
126
|
meillo@0
|
127 dnl optional features
|
meillo@0
|
128 MD5_LIBS=''
|
meillo@0
|
129 BASE64_LIBS=''
|
meillo@0
|
130
|
meillo@0
|
131 dnl smtp server support (default is use it)
|
meillo@0
|
132 AC_ARG_ENABLE(smtp_server,
|
meillo@0
|
133 [ --disable-smtp-server disable smtp server support],
|
meillo@0
|
134 if test "x$enable_smtp_server" != 'xno'; then
|
meillo@0
|
135 smtp_server_enabled='yes'
|
meillo@0
|
136 fi,
|
meillo@0
|
137 smtp_server_enabled='yes'
|
meillo@0
|
138 )
|
meillo@0
|
139 if test "x$smtp_server_enabled" = xyes; then
|
meillo@0
|
140 AC_DEFINE(ENABLE_SMTP_SERVER, 1, [If the SMTP server is enabled])
|
meillo@0
|
141 fi
|
meillo@0
|
142
|
meillo@0
|
143 dnl pop support (default is use it)
|
meillo@0
|
144 AC_ARG_ENABLE(pop3,
|
meillo@0
|
145 [ --disable-pop3 disable pop3 support],
|
meillo@0
|
146 if test "x$enable_pop3" != 'xno'; then
|
meillo@0
|
147 pop3_enabled='yes'
|
meillo@0
|
148 fi,
|
meillo@0
|
149 )
|
meillo@0
|
150 if test "x$pop3_enabled" = xyes; then
|
meillo@0
|
151 AC_DEFINE(ENABLE_POP3, 1, [If the POP3 support is enabled])
|
meillo@0
|
152 # MD5_LIBS='md5/libmd5c.a'
|
meillo@0
|
153 need_md5='yes'
|
meillo@0
|
154 fi
|
meillo@0
|
155
|
meillo@0
|
156 dnl auth support (default is to not use it)
|
meillo@0
|
157 AC_ARG_ENABLE(auth,
|
meillo@0
|
158 [ --enable-auth enable AUTH (RFC 2554) client support],
|
meillo@0
|
159 if test "x$enable_auth" != 'xno'; then
|
meillo@0
|
160 auth_enabled='yes'
|
meillo@0
|
161 fi,
|
meillo@0
|
162 )
|
meillo@0
|
163 if test "x$auth_enabled" = xyes; then
|
meillo@0
|
164 AC_DEFINE(ENABLE_AUTH, 1, [If AUTH is enabled])
|
meillo@0
|
165 BASE64_LIBS='base64/libbase64.a'
|
meillo@0
|
166 # MD5_LIBS='md5/libmd5c.a'
|
meillo@0
|
167 need_md5='yes'
|
meillo@0
|
168 fi
|
meillo@0
|
169 AC_SUBST(BASE64_LIBS)
|
meillo@0
|
170
|
meillo@0
|
171 dnl maildir support (default is to not use it)
|
meillo@0
|
172 AC_ARG_ENABLE(maildir,
|
meillo@0
|
173 [ --enable-maildir enable qmail style maildir support],
|
meillo@0
|
174 if test "x$enable_maildir" != 'xno'; then
|
meillo@0
|
175 maildir_enabled='yes'
|
meillo@0
|
176 fi,
|
meillo@0
|
177 )
|
meillo@0
|
178 if test "x$maildir_enabled" = xyes; then
|
meillo@0
|
179 AC_DEFINE(ENABLE_MAILDIR, 1, [If Maildirs are enabled])
|
meillo@0
|
180 fi
|
meillo@0
|
181
|
meillo@0
|
182 dnl libcrypto
|
meillo@0
|
183 AC_ARG_WITH(libcrypto,
|
meillo@0
|
184 [ --with-libcrypto use libcrypto],
|
meillo@0
|
185 )
|
meillo@0
|
186 if test "x$with_libcrypto" != 'xyes'; then
|
meillo@0
|
187 with_libcrypto='no'
|
meillo@0
|
188 fi
|
meillo@0
|
189
|
meillo@0
|
190 if test "x$need_md5" = 'xyes'; then
|
meillo@0
|
191 dnl check whether we have md5 in libcrypto if md5 needed and we shall link with libcrypto
|
meillo@0
|
192 if test "x$with_libcrypto" = "xyes"; then
|
meillo@0
|
193 AC_CHECK_LIB(crypto, MD5, has_crypto='yes', AC_MSG_ERROR('no libcrypto'))
|
meillo@0
|
194 if test "x$has_crypto" = 'xyes'; then
|
meillo@0
|
195 AC_DEFINE(USE_LIB_CRYPTO, 1, [If libcrypto is available])
|
meillo@0
|
196 MD5_LIBS='-lcrypto'
|
meillo@0
|
197 fi
|
meillo@0
|
198 else
|
meillo@0
|
199 MD5_LIBS='md5/libmd5c.a'
|
meillo@0
|
200 fi
|
meillo@0
|
201 fi
|
meillo@0
|
202 AC_SUBST(MD5_LIBS)
|
meillo@0
|
203
|
meillo@0
|
204 dnl ident support (default is to not use it)
|
meillo@0
|
205 IDENT_LIBS=''
|
meillo@0
|
206 AC_ARG_ENABLE(ident,
|
meillo@0
|
207 [ --enable-ident enable ident (RFC 1413) support],
|
meillo@0
|
208 if test "x$enable_ident" != 'xno'; then
|
meillo@0
|
209 ident_enabled='yes'
|
meillo@0
|
210 fi,
|
meillo@0
|
211 )
|
meillo@0
|
212 AC_SUBST(has_ident)
|
meillo@0
|
213 if test "x$ident_enabled" = xyes; then
|
meillo@0
|
214 AC_DEFINE(ENABLE_IDENT, 1, [If ident is enabled])
|
meillo@0
|
215 AC_CHECK_LIB(ident, ident_id, IDENT_LIBS='-lident', IDENT_LIBS='libident/libident.a')
|
meillo@0
|
216 fi
|
meillo@0
|
217 AC_SUBST(IDENT_LIBS)
|
meillo@0
|
218
|
meillo@0
|
219 dnl mserver support (default is to not use it)
|
meillo@0
|
220 AC_ARG_ENABLE(mserver,
|
meillo@0
|
221 [ --enable-mserver enable mserver support],
|
meillo@0
|
222 if test "x$enable_mserver" != 'xno'; then
|
meillo@0
|
223 mserver_enabled='yes'
|
meillo@0
|
224 fi,
|
meillo@0
|
225 )
|
meillo@0
|
226 if test "x$mserver_enabled" = xyes; then
|
meillo@0
|
227 AC_DEFINE(ENABLE_MSERVER, 1, [If mserver support is enabled])
|
meillo@0
|
228 fi
|
meillo@0
|
229
|
meillo@0
|
230 dnl liblockfile
|
meillo@0
|
231 AC_ARG_WITH(liblockfile,
|
meillo@0
|
232 [ --with-liblockfile use liblock (for Debian)],
|
meillo@0
|
233 )
|
meillo@0
|
234 if test "x$with_liblockfile" != 'x'; then
|
meillo@0
|
235 with_liblockfile='yes'
|
meillo@0
|
236 fi
|
meillo@0
|
237 if test "x$with_liblockfile" = xyes; then
|
meillo@0
|
238 AC_CHECK_LIB(lockfile, maillock, has_lockfile=yes, AC_MSG_ERROR("no liblockfile"))
|
meillo@0
|
239 LOCKFILE_LIBS='-llockfile'
|
meillo@0
|
240 AC_DEFINE(USE_LIBLOCKFILE, 1, [If liblockfile is to be used])
|
meillo@0
|
241 else
|
meillo@0
|
242 LOCKFILE_LIBS=''
|
meillo@0
|
243 fi
|
meillo@0
|
244 AC_SUBST(LOCKFILE_LIBS)
|
meillo@0
|
245 AC_SUBST(USE_LIBLOCKFILE)
|
meillo@0
|
246
|
meillo@0
|
247 dnl log and spool directories
|
meillo@0
|
248 AC_ARG_WITH(logdir,
|
meillo@151
|
249 [ --with-logdir=DIR set log directory [/var/log/masqmail]],
|
meillo@0
|
250 ,
|
meillo@0
|
251 with_logdir='/var/log/masqmail/'
|
meillo@0
|
252 )
|
meillo@151
|
253 AC_DEFINE_UNQUOTED(LOG_DIR, "${with_logdir}", [The log directory])
|
meillo@0
|
254 AC_SUBST(with_logdir)
|
meillo@0
|
255
|
meillo@0
|
256 AC_ARG_WITH(spooldir,
|
meillo@0
|
257 [ --with-spooldir=DIR set spool directory [/var/spool/masqmail]],
|
meillo@0
|
258 ,
|
meillo@0
|
259 with_spooldir='/var/spool/masqmail/'
|
meillo@0
|
260 )
|
meillo@151
|
261 AC_DEFINE_UNQUOTED(SPOOL_DIR, "${with_spooldir}", [The spool directory])
|
meillo@0
|
262 AC_SUBST(with_spooldir)
|
meillo@0
|
263
|
meillo@0
|
264 dnl configuration file
|
meillo@0
|
265 AC_ARG_WITH(confdir,
|
meillo@0
|
266 [ --with-confdir directory for configuration [/etc/masqmail]],
|
meillo@0
|
267 ,
|
meillo@0
|
268 with_confdir='/etc/masqmail'
|
meillo@0
|
269 )
|
meillo@0
|
270 AC_DEFINE_UNQUOTED(CONF_DIR, "${with_confdir}", [The configuration file location])
|
meillo@0
|
271 AC_SUBST(with_confdir)
|
meillo@0
|
272
|
meillo@0
|
273 test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
meillo@35
|
274
|
meillo@35
|
275 dnl well, /me/ thought that autoconf should make things _easy_ ... -- oku
|
meillo@35
|
276 dnl I needed the two `eval's to get the variable expanded in all cases -- meillo
|
meillo@35
|
277 dnl this is just horrible! -- meillo
|
meillo@35
|
278 AC_DEFINE_UNQUOTED(DATA_DIR, "`eval eval echo $datadir`/masqmail", [The data directory])
|
meillo@0
|
279
|
meillo@0
|
280 dnl gymnastics to get the correct path where masqmail should be installed
|
meillo@0
|
281 dnl we need this to call ourselves in failmsg.c
|
meillo@0
|
282 if test "x${exec_prefix}" != 'xNONE'; then
|
meillo@0
|
283 AC_DEFINE_UNQUOTED(SBINDIR, "${exec_prefix}/sbin", [The sbin directory])
|
meillo@0
|
284 else
|
meillo@0
|
285 if test "x${prefix}" != 'xNONE'; then
|
meillo@0
|
286 AC_DEFINE_UNQUOTED(SBINDIR, "${prefix}/sbin")
|
meillo@0
|
287 else
|
meillo@0
|
288 AC_DEFINE_UNQUOTED(SBINDIR, "/usr/sbin")
|
meillo@0
|
289 fi
|
meillo@0
|
290 fi
|
meillo@0
|
291
|
meillo@0
|
292 AC_OUTPUT(Makefile \
|
meillo@0
|
293 src/Makefile \
|
meillo@0
|
294 src/base64/Makefile \
|
meillo@0
|
295 src/md5/Makefile \
|
meillo@55
|
296 src/libident/Makefile \
|
meillo@57
|
297 man/Makefile
|
meillo@0
|
298 )
|