-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
executable file
·345 lines (309 loc) · 13 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
#######################################################################
# Thus it begins...
#######################################################################
AC_INIT(smtpf, 2.6, [Anthony Howe <achowe@snert.com>])
dnl The autoconf version I learned to deal with.
AC_PREREQ(2.59)
dnl Yes I wrote this mess.
SNERT_INIT([],[Copyright 2006, 2022 by SnertSoft. All rights reserved.], [src/BUILD_ID.TXT])
AC_SUBST(rel_incdir, '../../include')
AC_SUBST(rel_libdir, '../../lib')
AC_SUBST(rel_tardir, '../../../..')
#######################################################################
# Auxliary files to be modified later
#######################################################################
AC_CONFIG_FILES(MANIFEST.TXT)
AC_CONFIG_FILES(package/FreeBSD/+CONTENTS)
AC_CONFIG_FILES(package/FreeBSD/+COMMENT)
AC_CONFIG_FILES(package/FreeBSD/+DESC)
AC_CONFIG_FILES(package/FreeBSD/+DISPLAY)
AC_CONFIG_FILES(package/FreeBSD/makefile)
AC_CONFIG_FILES(package/Linux.rpm/makefile)
AC_CONFIG_FILES(package/OpenBSD/+CONTENTS)
AC_CONFIG_FILES(package/OpenBSD/+COMMENT)
AC_CONFIG_FILES(package/OpenBSD/+DESC)
AC_CONFIG_FILES(package/OpenBSD/+DISPLAY)
AC_CONFIG_FILES(package/OpenBSD/makefile)
AC_CONFIG_FILES(package/Windows/installer.nsi)
AC_CONFIG_FILES(makefile)
AC_CONFIG_FILES(install.sh)
AC_CONFIG_FILES(src/makefile)
AC_CONFIG_FILES(doc/smtpf.0)
AC_CONFIG_FILES(doc/manual.shtml)
AC_CONFIG_FILES(doc/install.html)
AC_CONFIG_FILES(doc/access-map.html)
AC_CONFIG_FILES(doc/route-map.html)
AC_CONFIG_FILES(doc/reply.html)
AC_CONFIG_FILES(doc/smtpf-cf.html)
AC_CONFIG_FILES(doc/syslog.html)
AC_CONFIG_FILES(doc/glossary.html)
AC_CONFIG_FILES(doc/runtime.html)
AC_CONFIG_FILES(doc/summary.html)
AC_CONFIG_FILES(doc/BarricadeMX.html)
AC_CONFIG_FILES(examples/netbsd.rcd)
AC_CONFIG_FILES(examples/startup.sh)
AC_CONFIG_FILES(examples/Makefile)
dnl AC_CONFIG_FILES(test/makefile)
AC_CONFIG_FILES(src/config.h.in)
AC_CONFIG_HEADERS(src/config.h)
#######################################################################
# Configuration options: settings
#######################################################################
SNERT_OPTION_ENABLE_RUN_USER(smtpf)
SNERT_OPTION_ENABLE_RUN_GROUP(smtpf)
AC_ARG_ENABLE(attachment, [AS_HELP_STRING([--disable-attachment],[disable file attachment filter])])
AC_ARG_ENABLE(avastd, [AS_HELP_STRING([--enable-avastd],[enable Avast! AV support])])
AC_ARG_ENABLE(clamd, [AS_HELP_STRING([--disable-clamd],[disable Clam AV support])])
AC_ARG_ENABLE(cli, [AS_HELP_STRING([--enable-cli],[enable command line interface support])])
AC_ARG_ENABLE(click, [AS_HELP_STRING([--disable-click],[enable rejection click support])])
AC_ARG_ENABLE(concurrent, [AS_HELP_STRING([--disable-concurrent],[disable concurrent connection tests])])
AC_ARG_ENABLE(ctasd, [AS_HELP_STRING([--enable-ctasd],[enable CommTouch Advanced Security daemon support])])
AC_ARG_ENABLE(dnslists, [AS_HELP_STRING([--disable-dnslists],[disable DNS B/W list support])])
AC_ARG_ENABLE(digest, [AS_HELP_STRING([--disable-digest],[disable digest black lists])])
AC_ARG_ENABLE(dupmsg, [AS_HELP_STRING([--disable-dupmsg],[disable duplicate message tracking])])
AC_ARG_ENABLE(emew, [AS_HELP_STRING([--disable-emew],[disable EMEW support])])
AC_ARG_ENABLE(freemail, [AS_HELP_STRING([--disable-freemail],[disable free mail source testing])])
AC_ARG_ENABLE(fpscand, [AS_HELP_STRING([--enable-fpscand],[enable F-Prot AV support])])
AC_ARG_ENABLE(grey, [AS_HELP_STRING([--disable-grey],[disable grey-listing])])
AC_ARG_ENABLE(ixhash, [AS_HELP_STRING([--disable-ixhash],[disable iXhash DNS black list support])])
AC_ARG_ENABLE(lickey, [AS_HELP_STRING([--enable-lickey],[enable license key checks])])
dnl AC_ARG_ENABLE(lua, [AS_HELP_STRING([--enable-lua],[enable LUA scripting support (experimental)])])
AC_ARG_ENABLE(misc, [AS_HELP_STRING([--disable-misc],[disable miscellanous tests])])
AC_ARG_ENABLE(msglimit, [AS_HELP_STRING([--disable-msglimit],[disable message limit restrictions])])
AC_ARG_ENABLE(null, [AS_HELP_STRING([--disable-null],[disable null sender throttling])])
AC_ARG_ENABLE(p0f, [AS_HELP_STRING([--enable-p0f],[enable p0f support])])
AC_ARG_ENABLE(pad, [AS_HELP_STRING([--disable-pad],[disable RFC 2821 reply line padding])])
AC_ARG_ENABLE(quit, [AS_HELP_STRING([--disable-quit],[disable quit, restart, restart-if options])])
AC_ARG_ENABLE(sav, [AS_HELP_STRING([--enable-sav],[enable sender address verification])])
AC_ARG_ENABLE(save, [AS_HELP_STRING([--disable-save],[disable save message support])])
AC_ARG_ENABLE(savdid, [AS_HELP_STRING([--enable-savdid],[enable Sophos AV support])])
AC_ARG_ENABLE(siq, [AS_HELP_STRING([--enable-siq],[enable Server Index Query support])])
AC_ARG_ENABLE(size, [AS_HELP_STRING([--disable-size],[disable message size restrictions])])
AC_ARG_ENABLE(spamd, [AS_HELP_STRING([--enable-spamd],[enable older reject-only SpamAssassin support])])
AC_ARG_ENABLE(spamd2, [AS_HELP_STRING([--disable-spamd2],[disable newer SpamAssassin with tagging support])])
AC_ARG_ENABLE(spf, [AS_HELP_STRING([--disable-spf],[disable SPF Classic support])])
AC_ARG_ENABLE(timelimit, [AS_HELP_STRING([--disable-timelimit],[disable time limited recipient address feature])])
AC_ARG_ENABLE(uribl, [AS_HELP_STRING([--disable-uribl],[disable URI black list support])])
AS_IF([test ${enable_attachment:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_ATTACHMENT)])
AS_IF([test ${enable_avastd:='no'} = 'yes'],[enable_save='yes'; AC_DEFINE_UNQUOTED(FILTER_AVASTD)])
AS_IF([test ${enable_clamd:='yes'} = 'yes'],[enable_save='yes'; AC_DEFINE_UNQUOTED(FILTER_CLAMD)])
AS_IF([test ${enable_cli:='no'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_CLI)])
AS_IF([test ${enable_click:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_CLICK)])
AS_IF([test ${enable_concurrent:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_CONCURRENT)])
AS_IF([test ${enable_ctasd:='no'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_CTASD)])
AS_IF([test ${enable_digest:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_DIGEST)])
AS_IF([test ${enable_dnslists:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_RBL)])
AS_IF([test ${enable_dupmsg:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_DUPMSG)])
AS_IF([test ${enable_emew:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_EMEW)])
AS_IF([test ${enable_freemail:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_FREEMAIL)])
AS_IF([test ${enable_fpscand:='no'} = 'yes'],[enable_save='yes'; AC_DEFINE_UNQUOTED(FILTER_FPSCAND)])
AS_IF([test ${enable_grey:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_GREY)])
AS_IF([test ${enable_ixhash:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_IXHASH)])
AS_IF([test ${enable_lickey:='no'} = 'yes'],[AC_DEFINE_UNQUOTED(ENABLE_LICKEY)])
dnl AS_IF([test ${enable_lua:='no'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_LUA)])
AS_IF([test ${enable_misc:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_MISC)])
AS_IF([test ${enable_msglimit:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_MSG_LIMIT)])
AS_IF([test ${enable_null:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_NULL)])
AS_IF([test ${enable_p0f:='no'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_P0F)])
AS_IF([test ${enable_pad:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_PAD)])
AS_IF([test ${enable_quit:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(ENABLE_OPTION_QUIT)])
AS_IF([test ${enable_sav:='no'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_SAV)])
AS_IF([test ${enable_savdid:='no'} = 'yes'],[enable_save='yes'; AC_DEFINE_UNQUOTED(FILTER_SAVDID)])
AS_IF([test ${enable_siq:='no'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_SIQ)])
AS_IF([test ${enable_size:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_SIZE)])
AS_IF([test ${enable_spamd:='no'} = 'yes'],[enable_spamd2='no'; AC_DEFINE_UNQUOTED(FILTER_SPAMD)])
AS_IF([test ${enable_spamd2:='yes'} = 'yes'],[enable_save='yes'; AC_DEFINE_UNQUOTED(FILTER_SPAMD2)])
AS_IF([test ${enable_spf:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_SPF)])
AS_IF([test ${enable_timelimit:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_TIMELIMIT)])
AS_IF([test ${enable_uribl:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_URIBL)])
AS_IF([test ${enable_save:='yes'} = 'yes'],[AC_DEFINE_UNQUOTED(FILTER_SAVE)])
#######################################################################
# Configuration options: packages
#######################################################################
AC_ARG_WITH(p0f,
[AS_HELP_STRING([[--with-p0f=dir ]],[ p0f source directory or location of p0f-query.h])],
[
],[
with_p0f='/usr/local/src/p0f'
]
)
AC_SUBST(with_p0f)
AS_IF([test -d ${with_p0f:-undef}],[
CFLAGS="-I${with_p0f} ${CFLAGS}"
AC_CHECK_HEADERS([p0f-query.h api.h])
AC_CHECK_DECLS([QUERY_MAGIC, P0F_QUERY_MAGIC],[],[],[
AC_INCLUDES_DEFAULT
#if defined HAVE_API_H
# include <api.h>
#elif defined HAVE_P0F_QUERY_H
# include <p0f-query.h>
#endif
])
])
AC_ARG_WITH(lua,
[AS_HELP_STRING([--with-lua],[enable LUA scripting support (experimental)])],
[
AC_CHECK_HEADERS([lua.h],[],[],[/* */])
if test "$ac_cv_header_lua_h" = 'no'; then
saved_cflags=$CFLAGS
CFLAGS="-I/usr/local/include ${saved_cflags}"
unset ac_cv_header_lua_h
echo "retrying with -I/usr/local/include ..."
AC_CHECK_HEADERS([lua.h],[],[],[/* */])
if test "$ac_cv_header_lua_h" = 'no'; then
CFLAGS=$saved_cflags
else
LDFLAGS="-L/usr/local/lib ${LDFLAGS}"
fi
fi
if test "$ac_cv_header_lua_h" = 'yes'; then
AC_DEFINE_UNQUOTED(FILTER_LUA)
LIBS="-llua -lm $LIBS"
LDFLAGS="-Wl,-E ${LDFLAGS}"
fi
]
)
#######################################################################
# Load LibSnert Configuration
#######################################################################
if test -f '../lib/version.sh' ; then
snert_libsnert=yes
. '../lib/version.sh'
SNERT_TAR_SETTINGS
case "$platform" in
Linux)
AC_SUBST(CACHE_DIR, '/var/cache/smtpf')
AC_SUBST(STATS_DIR, '/var/cache/smtpf')
;;
*BSD|SunOS|Solaris)
AC_SUBST(CACHE_DIR, '/var/db/smtpf')
AC_SUBST(STATS_DIR, '/var/db/smtpf')
;;
*)
AC_SUBST(CACHE_DIR, '.')
AC_SUBST(STATS_DIR, '.')
;;
esac
AC_SUBST(CC)
AC_SUBST(CC_O)
AC_SUBST(CC_E)
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(ARCHIVE)
AC_SUBST(COMPILE)
AC_SUBST(RANLIB)
AC_SUBST(LIBEXT)
AC_SUBST(OBJEXT)
AC_SUBST(EXEEXT)
AC_SUBST(AUTOCONF)
AC_SUBST(MD5SUM)
AC_SUBST(TAR_I)
AC_SUBST(ENABLE_MINGW)
AC_SUBST(LIBS_RT)
AC_SUBST(CFLAGS_DB)
AC_SUBST(LDFLAGS_DB)
AC_SUBST(HAVE_LIB_DB)
AC_SUBST(LIBS_LUA)
AC_SUBST(CFLAGS_LUA)
AC_SUBST(LDFLAGS_LUA)
AC_SUBST(LIBS_SQLITE3)
AC_SUBST(CFLAGS_SQLITE3)
AC_SUBST(LDFLAGS_SQLITE3)
AC_SUBST(CFLAGS_PTHREAD)
AC_SUBST(LDFLAGS_PTHREAD)
AC_SUBST(HAVE_LIB_PTHREAD)
AC_SUBST(HAVE_LIB_SEM)
AC_SUBST(HAVE_LIB_WS2_32)
AC_SUBST(HAVE_LIB_IPHLPAPI)
AC_SUBST(NETWORK_LIBS)
AC_SUBST(LIBS_SSL)
AC_SUBST(CFLAGS_SSL)
AC_SUBST(LDFLAGS_SSL)
if test "X${HAVE_LIB_SQLITE3}" = 'X' ; then
echo
echo '***************************************************************'
echo "*** This application requires threaded SQLite3 support. ***"
echo '***************************************************************'
echo
# exit 1
fi
expr "${CFLAGS_PTHREAD}" : '.*-pthread' >/dev/null ;
has_freebsd_pthread=$?
if test "X${HAVE_LIB_PTHREAD}" = 'X' -a $has_freebsd_pthread -ne 0 -a "X${ENABLE_MINGW}" = 'X'; then
echo
echo '***************************************************************'
echo "*** This application requires POSIX thread support. ***"
echo '***************************************************************'
echo
exit 1
fi
LIBS="${LIBS} ${HAVE_LIB_DB} ${LIBS_RT} ${LIBS_SQLITE3} ${HAVE_LIB_PTHREAD} ${LIBS_SSL} ${HAVE_LIB_WS2_32} ${HAVE_LIB_IPHLPAPI}"
else
snert_libsnert=no
echo
echo '***************************************************************'
echo 'Oi! You must download, configure, and build LibSnert first!'
echo '***************************************************************'
echo
fi
#######################################################################
# Generate output.
#######################################################################
SNERT_FINI
echo
echo "Generating files..."
echo
AC_OUTPUT()
echo
echo $PACKAGE_NAME/$package_major.$package_minor.$package_build
echo $package_copyright
echo
AC_MSG_RESULT([ Platform..........: $platform])
AC_MSG_RESULT([ prefix............: $prefix])
AC_MSG_RESULT([ exec_prefix.......: $exec_prefix])
AC_MSG_RESULT([ sbindir...........: $sbindir])
AC_MSG_RESULT([ run-user..........: $enable_run_user])
AC_MSG_RESULT([ run-group.........: $enable_run_group])
AC_MSG_RESULT([ CFLAGS............: $CFLAGS])
AC_MSG_RESULT([ LDFLAGS...........: $LDFLAGS])
AC_MSG_RESULT([ LIBS..............: $LIBS])
for feature in \
enable_attachment \
enable_avastd \
enable_clamd \
enable_cli \
enable_click \
enable_concurrent \
enable_ctasd \
enable_digest \
enable_dnslists \
enable_dupmsg \
enable_emew \
enable_freemail \
enable_fpscand \
enable_grey \
enable_ixhash \
enable_lickey \
enable_misc \
enable_msglimit \
enable_null \
enable_p0f \
enable_pad \
enable_quit \
enable_sav \
enable_savdid \
enable_siq \
enable_size \
enable_spamd \
enable_spamd2 \
enable_spf \
enable_timelimit \
enable_uribl \
enable_save
do
name=$(echo $feature | sed -e 's/enable_//')
eval value="\$$feature"
AS_IF([test "$value" = 'yes'], [features="$features $name"])
done
AC_MSG_RESULT([ FEATURES..........: $features])
echo