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