This repository has been archived by the owner on Mar 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.in
276 lines (234 loc) · 7.46 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
## configure.in
## ======================================================================
# FIXME
AC_PREREQ(2.54)
AC_INIT(samba-virusfilter, 0.1.4)
AC_CONFIG_HEADER(include/virusfilter-config.h)
AC_SUBST(CONFIG_HEADERS)
CONFIG_HEADERS="$ac_config_headers"
AC_CONFIG_FILES(
Makefile
build/Makefile.common
build/Makefile.package
build/Makefile.top
build/subst.pl
build/subst.vars
test/Makefile
)
## Installation directories
## ======================================================================
AC_SUBST(package_subdir)
#package_subdir=
#AC_ARG_WITH(
# subdir,
# AC_HELP_STRING(--with-subdir=DIR, change default subdirectory used for installs @<:@/chimera@:>@),
# [case "$withval" in
# no) package_subdir=""
# ;;
# yes)
# ;;
# /*|\\*)
# package_subdir="$withval"
# ;;
# *)
# package_subdir="/$withval"
# ;;
# esac
# ])
## Samba
## ======================================================================
AC_SUBST(SAMBA_SOURCE_DIR)
AC_ARG_WITH(
samba-source,
AC_HELP_STRING(--with-samba-source=PATH, [Where is the Samba source directory]),
[case "$withval" in
yes|no)
;;
*)
SAMBA_SOURCE_DIR=$withval
AC_MSG_RESULT([using $SAMBA_SOURCE_DIR for the Samba source])
;;
esac
]
)
if test -z "$SAMBA_SOURCE_DIR"; then
AC_ERROR([You must specify --with-samba-source=PATH])
fi
case "$SAMBA_SOURCE_DIR" in
/*)
## OK, $SAMBA_SOURCE_DIR has absolute path
;;
*)
AC_MSG_RESULT([converting the specified Samba source path into absolute path])
SAMBA_SOURCE_DIR=`cd "$SAMBA_SOURCE_DIR" && pwd`
;;
esac
AC_SUBST(SAMBA_TOP_DIR)
case "$SAMBA_SOURCE_DIR" in
*/source*)
SAMBA_TOP_DIR=`dirname "$SAMBA_SOURCE_DIR"`
;;
*)
SAMBA_TOP_DIR="$SAMBA_SOURCE_DIR"
if test -d "$SAMBA_SOURCE_DIR/source3"; then
SAMBA_SOURCE_DIR="$SAMBA_TOP_DIR/source3"
elif test -d "$SAMBA_SOURCE_DIR/source3"; then
SAMBA_SOURCE_DIR="$SAMBA_TOP_DIR/source"
else
AC_ERROR([Samba source has no source* directory: $SAMBA_SOURCE_DIR])
fi
;;
esac
if test -f "$SAMBA_SOURCE_DIR/include/config.h"; then
: OK
else
AC_ERROR([Samba source has not been configured: $SAMBA_SOURCE_DIR])
fi
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,prefix,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,exec_prefix,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,CONFIGDIR,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,BINDIR,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,LIBDIR,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,DATADIR,SAMBA_)
case "$SAMBA_DATADIR" in
*/samba)
## OK
;;
*)
SAMBA_DATADIR="$SAMBA_DATADIR/samba"
;;
esac
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,MODULESDIR,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,VFSLIBDIR,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,LOCKDIR,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,CC,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,FLAGS,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,CPPFLAGS,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,CFLAGS,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,PICFLAG,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,SHLD,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,SHLD_MODULE,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,LDSHFLAGS,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,LDSHFLAGS_MODULES,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,DSO_EXPORTS,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,DSO_EXPORTS_CMD,SAMBA_)
AC_GET_MAKEFILE_VAR(${SAMBA_SOURCE_DIR}/Makefile,LIB_PATH_VAR,SAMBA_)
AC_GET_DEFINED_VAR(${SAMBA_SOURCE_DIR}/include/version.h,SAMBA_VERSION_MAJOR,)
AC_GET_DEFINED_VAR(${SAMBA_SOURCE_DIR}/include/version.h,SAMBA_VERSION_MINOR,)
AC_GET_DEFINED_VAR(${SAMBA_SOURCE_DIR}/include/version.h,SAMBA_VERSION_RELEASE,)
AC_GET_DEFINED_VAR(${SAMBA_SOURCE_DIR}/include/vfs.h,SMB_VFS_INTERFACE_VERSION,)
AC_SUBST(SAMBA_VERSION)
SAMBA_VERSION="$SAMBA_VERSION_MAJOR.$SAMBA_VERSION_MINOR.$SAMBA_VERSION_RELEASE"
AC_SUBST(SAMBA_VERSION_NUMBER)
SAMBA_VERSION_NUMBER=`printf '%d%02d%02d' $SAMBA_VERSION_MAJOR $SAMBA_VERSION_MINOR $SAMBA_VERSION_RELEASE`
SAMBA_FLAGS="`echo \" $SAMBA_FLAGS \" |sed 's#-I. #-I\$(SAMBA_SOURCE_DIR) #g;s# -I\./\.\./# -I\$(SAMBA_TOP_DIR)/#g;s# -I\.\./# -I\$(SAMBA_TOP_DIR)/#g;s# -I\./# -I\$(SAMBA_SOURCE_DIR)/#g'`"
SAMBA_CPPFLAGS="`echo \" $SAMBA_CPPFLAGS \" |sed 's#-I. #-I\$(SAMBA_SOURCE_DIR) #g;s# -I\./\.\./# -I\$(SAMBA_TOP_DIR)/#g;s# -I\.\./# -I\$(SAMBA_TOP_DIR)/#g;s# -I\./# -I\$(SAMBA_SOURCE_DIR)/#g'`"
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
CPPFLAGS="$CPPFLAGS -I\$(SOURCE_DIR)/include"
## ======================================================================
AC_SUBST(TEST_MODULES)
TEST_MODULES=""
AC_SUBST(CLAMD_COMMAND)
AC_ARG_WITH(
clamd,
AC_HELP_STRING(--with-clamd=PATH, [Use specific ClamAV clamd for test]),
[case "$withval" in
yes|no)
AC_ERROR([--with-clamd requires an argument])
;;
*)
CLAMD_COMMAND=$withval
;;
esac
],
[CLAMD_COMMAND=/usr/sbin/clamd]
)
AC_MSG_RESULT([using $CLAMD_COMMAND for ClamaAV clamd])
test -x "$CLAMD_COMMAND" && TEST_MODULES="$TEST_MODULES clamav"
## ----------------------------------------------------------------------
AC_SUBST(SAVDID_COMMAND)
AC_ARG_WITH(
savdid,
AC_HELP_STRING(--with-savdid=PATH, [Use specific Sophos AV savdid for test]),
[case "$withval" in
yes|no)
AC_ERROR([--with-savdid requires an argument])
;;
*)
SAVDID_COMMAND=$withval
;;
esac
],
[SAVDID_COMMAND=/usr/local/bin/savdid]
)
AC_MSG_RESULT([using $SAVDID_COMMAND for Sophos AV savdid])
test -x "$SAVDID_COMMAND" && TEST_MODULES="$TEST_MODULES sophos"
## ----------------------------------------------------------------------
AC_SUBST(FSAVD_COMMAND)
AC_ARG_WITH(
fsavd,
AC_HELP_STRING(--with-fsavd=PATH, [Use specific F-Secure AV fsavd for test]),
[case "$withval" in
yes|no)
AC_ERROR([--with-fsavd requires an argument])
;;
*)
FSAVD_COMMAND=$withval
;;
esac
],
[FSAVD_COMMAND=/opt/f-secure/fssp/sbin/fsavd]
)
AC_MSG_RESULT([using $FSAVD_COMMAND for F-Secure AV fsavd])
test -x "$FSAVD_COMMAND" && TEST_MODULES="$TEST_MODULES f-secure"
## Perl
## ======================================================================
AC_SUBST(PERL_COMMAND)
AC_ARG_WITH(
perl,
AC_HELP_STRING(--with-perl=PATH, [Use specific perl command]),
[case "$withval" in
yes|no)
;;
*)
PERL_COMMAND=$withval
AC_MSG_RESULT([using $PERL_COMMAND for perl])
;;
esac
],
[AC_PATH_PROG(PERL_COMMAND, perl, not found)]
)
## ksh (for test)
## ======================================================================
AC_SUBST(KSH_COMMAND)
AC_ARG_WITH(
ksh,
AC_HELP_STRING(--with-ksh=PATH, [Use specific ksh (Korn shell) for test]),
[case "$withval" in
yes|no)
;;
*)
KSH_COMMAND=$withval
AC_MSG_RESULT([using $PERL_COMMAND for perl])
;;
esac
],
[KSH_COMMAND=/bin/ksh]
)
AC_MSG_RESULT([using $KSH_COMMAND for Korn shell])
## Output
## ======================================================================
AC_OUTPUT
AC_MSG_RESULT([
Configuration summary for $PACKAGE_NAME $PACKAGE_VERSION:
Samba:
Source directory: $SAMBA_SOURCE_DIR
Version: $SAMBA_VERSION
VFS interface version: $SMB_VFS_INTERFACE_VERSION
Install prefix: $SAMBA_prefix
Anti-Virus daemons:
ClamAV clamd: $CLAMD_COMMAND
F-Secure AV fsavd: $FSAVD_COMMAND
Sophos AV savdid: $SAVDID_COMMAND
])