masqmail-0.2

view configure.ac @ 0:08114f7dcc23

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