forked from EnderUNIX/qSheff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
executable file
·294 lines (244 loc) · 6.8 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/main.c)
AM_INIT_AUTOMAKE(qsheff-II, 2.1-r3)
AM_CONFIG_HEADER(src/qsheff-config.h)
AC_PREFIX_DEFAULT([/usr/local])
if test "x${prefix}" = "xNONE"; then
prefix=${ac_default_prefix}
fi
AC_ISC_POSIX
CFLAGS=""
AC_SUBST(CFLAGS)
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
echo
AC_PATH_PROG( [RIPMIME], [ripmime], [FALSE], [$PATH])
if test "x${RIPMIME}" = "xFALSE"; then
AC_MSG_ERROR([ripmime not found])
fi
AC_SUBST(RIPMIME)
# Library depends
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS(connect, [inet])
AC_SEARCH_LIBS(setsockopt, [socket net])
AC_SEARCH_LIBS([socket], [socket], ,
[AC_CHECK_LIB([nsl], [socket], LIBS="$LIBS -lsocket -lnsl", , -lsocket)])
AC_CHECK_FUNCS(strcasestr, [], [AC_DEFINE(NOSTRCASESTR, 1, [there is no strcasestr])])
dnl Conditional variables
AM_CONDITIONAL(ENABLE_CLAMAV, test "$with_clamav")
AM_CONDITIONAL(ENABLE_CPROG, test "$with_clamav")
AM_CONDITIONAL(ENABLE_DEBUG, test "$enable_debug" = yes)
dnl *********************************************
dnl *** Optional Features ***
dnl *********************************************
AC_MSG_CHECKING(for debug mode)
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debug messages],
[
AC_MSG_RESULT(enabled)
AC_DEFINE(_DEBUG_, 1, [Enable debug mode])
],
[
AC_MSG_RESULT(disabled)
])
AC_MSG_CHECKING(for local filters)
AC_ARG_ENABLE(local_users,
[ --disable-local-users Disable the filters for local users],
[
AC_MSG_RESULT(disabled)
],
[
AC_MSG_RESULT(enabled)
AC_DEFINE(ENABLE_LOCAL_USERS, 1, [Enable the filters for local users])
])
AC_MSG_CHECKING(for syslog)
AC_ARG_ENABLE(syslog,
[ --enable-syslog Enable syslog messages],
[
AC_MSG_RESULT(enabled)
AC_DEFINE(ENABLE_SYSLOG, 1, [Enable syslog messages])
],
[
AC_MSG_RESULT(disabled)
])
AC_MSG_CHECKING(for backup mode)
AC_ARG_ENABLE(backup,
[ --enable-backup Enable backup],
[
AC_MSG_RESULT(enabled)
AC_DEFINE(BACKUP_ALL, 1, [Backup Enabled])
],
[ AC_MSG_RESULT(disabled)
])
AC_MSG_CHECKING(for spam tagging)
AC_ARG_ENABLE(spam_tag,
[ --enable-spam-tag Enable Spam Tagging],
[
AC_MSG_RESULT(enabled)
AC_DEFINE(SPAM_TAGGING, 1, [Spam tag enabled])
],
[ AC_MSG_RESULT(disabled)
])
AC_MSG_CHECKING(for virus tagging)
AC_ARG_ENABLE(virus_tag,
[ --enable-virus-tag Enable virus tagging],
[
AC_MSG_RESULT(enabled)
AC_DEFINE(VIRUS_TAGGING, 1, [Virus tag enabled])
],
[ AC_MSG_RESULT(disabled)
])
AC_MSG_CHECKING(for custom error patch)
AC_ARG_ENABLE(custom_error,
[ --enable-custom-error Enable the custom error patch],
[
AC_MSG_RESULT(enabled)
AC_DEFINE(CUSTOM_ERROR, 1, [Return custom messages to senders])
],
[ AC_MSG_RESULT(disabled)
])
AC_MSG_CHECKING(for maximum body line)
AC_ARG_WITH(max_bodyline,
[ --with-max-bodyline Maximum number of lines to filter, default=40],
[
AC_MSG_RESULT(${with_max_bodyline})
MAXBODYLINE=${with_max_bodyline}
AC_DEFINE_UNQUOTED(MAXBODYLINE, $MAXBODYLINE,[max body lines])
],
[ AC_MSG_RESULT(40)
MAXBODYLINE=40
AC_DEFINE_UNQUOTED(MAXBODYLINE, $MAXBODYLINE,[max body lines])
])
AC_MSG_CHECKING(for maximum files)
AC_ARG_WITH(maxfiles,
[ --with-maxfiles Maximum numbers of files in a dir. (OS limit), default=32000],
[
AC_MSG_RESULT(${with_maxfiles})
MAX_FILES=${with_maxfiles}
AC_DEFINE_UNQUOTED(MAX_FILES, $MAX_FILES,[max files])
],
[ AC_MSG_RESULT(32000)
MAX_FILES=32000
AC_DEFINE_UNQUOTED(MAX_FILES, $MAX_FILES,[max files])
])
AC_MSG_CHECKING(for qq patch)
AC_ARG_ENABLE(qq_patch,
[ --enable-qq-patch Enable qmailqueue patch],
[
AC_MSG_RESULT(enabled)
QMAILQUEUE=1
AC_DEFINE(QMAILQUEUE, 1, [use qmailqueue patch])
],
[ AC_MSG_RESULT(disabled)
QMAILQUEUE=0
])
AC_MSG_CHECKING(for qmailgroup)
AC_ARG_WITH(qmailgroup,
[ --with-qmailgroup Define qmail group, default=qmail],
[
AC_MSG_RESULT(${with_qmailgroup})
QMAILGROUP=${with_qmailgroup}
AC_SUBST(QMAILGROUP)
],
[ AC_MSG_RESULT(qmail)
QMAILGROUP="qmail"
AC_SUBST(QMAILGROUP)
])
AC_MSG_CHECKING(for qmail root directory)
AC_ARG_WITH(qmaildir,
[ --with-qmaildir Define qmail directory, default=/var/qmail],
[
AC_MSG_RESULT(${with_qmaildir})
QMAILDIR=${with_qmaildir}
AC_SUBST(QMAILDIR)
AC_DEFINE_UNQUOTED(QMAILDIR, "$QMAILDIR",[qmail root directory])
],
[ AC_MSG_RESULT(/var/qmail)
QMAILDIR="/var/qmail"
AC_SUBST(QMAILDIR)
AC_DEFINE_UNQUOTED(QMAILDIR, "$QMAILDIR",[qmail root directory])
])
AC_MSG_CHECKING(for ClamAv antivirus)
AC_ARG_WITH(clamav,
[ --with-clamav Enable ClamAv and define ClamAv installation prefix, default=/usr],
[
if test x"$withval" != xyes; then
AC_MSG_RESULT(${with_clamav})
CFLAGS="$CFLAGS -I${with_clamav}/include -L${with_clamav}/lib"
else
AC_MSG_RESULT(default)
fi
AC_DEFINE(ENABLE_CLAMAV, 1, [use clamav])
ENABLE_CLAMD=1
AC_SUBST(ENABLE_CLAMD)
],
[
AC_MSG_RESULT(disabled)
ENABLE_CLAMD=0
])
AC_MSG_CHECKING(for clamd socket path)
AC_ARG_WITH(clamd-socket,
[ --with-clamd-socket Path to clamd socket, default=/tmp/clamd],
[
AC_MSG_RESULT(${with_clamd_socket})
CLAMD_SOCKET=${with_clamd_socket}
AC_DEFINE_UNQUOTED(CLAMD_SOCKET, "$CLAMD_SOCKET",[clamd socket])
],
[ AC_MSG_RESULT(/tmp/clamd)
CLAMD_SOCKET=/tmp/clamd
AC_DEFINE_UNQUOTED(CLAMD_SOCKET, "$CLAMD_SOCKET",[clamd socket])
])
AC_MSG_CHECKING(for custom prog)
AC_ARG_WITH(custom-prog,
[ --with-custom-prog Enable User Defined Program, check qsheff.conf],
[
AC_MSG_RESULT(enabled)
CUSTOM_PROG="${with_custom_prog}"
ENABLE_CUSTOM_PROG=1
AC_DEFINE_UNQUOTED(ENABLE_CUSTOM_PROG, 1, [Enable custom program])
],
[
AC_MSG_RESULT(disabled);
CUSTOM_PROG="disabled"
ENABLE_CUSTOM_PROG=0
])
echo
AC_SUBST(ENABLE_CLAMD)
AC_SUBST(QUEUE_PROGRAM)
AC_SUBST(CUSTOM_PROG)
AC_SUBST(QMAILQUEUE)
AC_SUBST(ENABLE_CUSTOM_PROG)
config_dir=`echo $sysconfdir | grep prefix`
if test -n "$config_dir"; then
if test "$prefix" = "NONE"
then
config_dir="$ac_default_prefix/etc"
else
config_dir="$prefix/etc"
fi
else
config_dir="$sysconfdir"
fi
config_dir="$config_dir/$PACKAGE"
domain=`cat ${QMAILDIR}/control/me`
QUEUE_PROGRAM="${QMAILDIR}/bin/qmail-queue.orig"
AC_DEFINE_UNQUOTED(CFGFILE, "$config_dir/qsheff.conf",[qsheff.conf full path])
AC_DEFINE_UNQUOTED(IGNLISTFILE, "$config_dir/qsheff.ignore",[qsheff.ignore full path])
AC_DEFINE_UNQUOTED(ATTACHFILE, "$config_dir/qsheff.attach",[qsheff.attach full path])
AC_DEFINE_UNQUOTED(RULEFILE, "$config_dir/qsheff.rules",[qsheff.rules full path])
AC_DEFINE_UNQUOTED(MAILERDAEMON, "MAILER-DAEMON@${domain}",[Mailer-daemon email address])
AC_OUTPUT([
Makefile
src/Makefile
etc/install-wrapper.sh
etc/uninstall-wrapper.sh
etc/Makefile
etc/qsheff.conf-default
contrib/Makefile
doc/Makefile
samples/Makefile
])
echo
echo "Type 'make && make install' to install files."
echo