-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathconfigure.ac
410 lines (354 loc) · 12.1 KB
/
configure.ac
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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
AC_INIT([vuurmuur],[0.8.1])
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])AM_SILENT_RULES([yes])
AC_CONFIG_SRCDIR([vuurmuur/vuurmuur.c])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS
AC_LANG([C])
AC_PROG_CC
AC_PROG_CC_C99
LT_INIT
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION
ac_build_ipv6=yes
AC_ARG_ENABLE([ipv6],
[AS_HELP_STRING([--disable-ipv6],[disable IPv6 support])],
[ if test "x$enableval" = "xno"; then
ac_build_ipv6=$enableval
fi
], [
ac_build_ipv6=yes
] )
if test "x${ac_build_ipv6}" = "xyes"; then
AC_DEFINE(IPV6_ENABLED, 1, [build with IPv6 support])
fi
# locale dir option for rpm building
# switch to VRMR_LOCALEDIR because LOCALEDIR conflicts with intl/ in
# make distcheck
AC_ARG_WITH(tmplocaledir,
[ --with-localedir=DIR vuurmuur locale dir (default $prefix/locale)],
[tmplocaledir="$withval"],[tmplocaledir=no])
if test "$tmplocaledir" != "no"; then
CPPFLAGS="${CPPFLAGS} -DVRMR_LOCALEDIR=\"${tmplocaledir}\""
else
CPPFLAGS="${CPPFLAGS} -DVRMR_LOCALEDIR=\"${datadir}/locale\""
fi
# shared dir option for rpm building
AC_ARG_WITH(shareddir,
[ --with-shareddir=DIR vuurmuur shared dir (default $datadir/vuurmuur)],
[shareddir="$withval"],[shareddir=no])
if test "$shareddir" != "no"; then
CPPFLAGS="${CPPFLAGS} -DDATADIR=\"${shareddir}\""
else
CPPFLAGS="${CPPFLAGS} -DDATADIR=\"${datadir}/vuurmuur\""
fi
# nfnetlink lib
AC_ARG_WITH(libnfnetlink_includes,
[ --with-libnfnetlink-includes=DIR libnfnetlink include directory],
[with_libnfnetlink_includes="$withval"],[with_libnfnetlink_includes=no])
AC_ARG_WITH(libnfnetlink_libraries,
[ --with-libnfnetlink-libraries=DIR libnfnetlink library directory],
[with_libnfnetlink_libraries="$withval"],[with_libnfnetlink_libraries="no"])
if test "$with_libnfnetlink_includes" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${with_libnfnetlink_includes}"
fi
AC_CHECK_HEADER(libnfnetlink/libnfnetlink.h,,)
if test "$with_libnfnetlink_libraries" != "no"; then
LDFLAGS="${LDFLAGS} -L${with_libnfnetlink_libraries}"
fi
AC_CHECK_LIB(nfnetlink, nfnl_fd, [LIBNFNETLINK_LIBS="-lnfnetlink"], NFNETLINK="no")
if test "$NFNETLINK" != "no"; then
AC_DEFINE([HAVE_NFNETLINK],[1],[libnfnetlink available])
fi
# mnl lib
AC_ARG_WITH(libmnl_includes,
[ --with-libmnl-includes=DIR libmnl include directory],
[with_libmnl_includes="$withval"],[with_libmnl_includes=no])
AC_ARG_WITH(libmnl_libraries,
[ --with-libmnl-libraries=DIR libmnl library directory],
[with_libmnl_libraries="$withval"],[with_libmnl_libraries="no"])
if test "$with_libmnl_includes" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${with_libmnl_includes}"
fi
AC_CHECK_HEADER(libmnl/libmnl.h,,)
if test "$with_libmnl_libraries" != "no"; then
LDFLAGS="${LDFLAGS} -L${with_libmnl_libraries}"
fi
AC_CHECK_LIB(mnl, mnl_socket_open, [LIBMNL_LIBS="-lmnl"], MNL="no")
if test "$MNL" != "no"; then
AC_DEFINE([HAVE_MNL],[1],[libmnl available])
fi
# netfilter_conntrack lib
AC_ARG_WITH(libnetfilter_conntrack_includes,
[ --with-libnetfilter_conntrack-includes=DIR libnetfilter_conntrack include directory],
[with_libnetfilter_conntrack_includes="$withval"],[with_libnetfilter_conntrack_includes=no])
AC_ARG_WITH(libnetfilter_conntrack_libraries,
[ --with-libnetfilter_conntrack-libraries=DIR libnetfilter_conntrack library directory],
[with_libnetfilter_conntrack_libraries="$withval"],[with_libnetfilter_conntrack_libraries="no"])
if test "$with_libnetfilter_conntrack_includes" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${with_libnetfilter_conntrack_includes}"
fi
AC_CHECK_HEADER(libnetfilter_conntrack/libnetfilter_conntrack.h,,)
if test "$with_libnetfilter_conntrack_libraries" != "no"; then
LDFLAGS="${LDFLAGS} -L${with_libnetfilter_conntrack_libraries}"
fi
AC_CHECK_LIB(netfilter_conntrack, nfct_nlmsg_parse, [LIBNETFILTER_CONNTRACK_LIBS="-lnetfilter_conntrack"], NFCONNTRACK="no")
if test "$NFCONNTRACK" = "no"; then
echo "ERROR libnetfilter_conntrack was not found"
exit 1
fi
AC_DEFINE([HAVE_LIBNETFILTER_CONNTRACK],[1],[libnetfilter_conntrack available])
# netfilter_log lib
AC_ARG_WITH(libnetfilter_log_includes,
[ --with-libnetfilter_log-includes=DIR libnetfilter_log include directory],
[with_libnetfilter_log_includes="$withval"],[with_libnetfilter_log_includes=no])
AC_ARG_WITH(libnetfilter_log_libraries,
[ --with-libnetfilter_log-libraries=DIR libnetfilter_log library directory],
[with_libnetfilter_log_libraries="$withval"],[with_libnetfilter_log_libraries="no"])
if test "$with_libnetfilter_log_includes" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${with_libnetfilter_log_includes}"
fi
AC_CHECK_HEADER(libnetfilter_log/libnetfilter_log.h,,)
if test "$with_libnetfilter_log_libraries" != "no"; then
LDFLAGS="${LDFLAGS} -L${with_libnetfilter_log_libraries}"
fi
AC_CHECK_LIB(netfilter_log, nflog_open, [LIBNETFILTER_LOG_LIBS="-lnetfilter_log"], NFLOG="no")
if test "$NFLOG" = "no"; then
echo "ERROR libnetfilter_log was not found"
exit 1
fi
AC_DEFINE([HAVE_LIBNETFILTER_LOG],[1],[libnetfilter_log available])
AC_ARG_WITH(ncurses_includes,
[ --with-libncurses-includes=DIR libncurses includes directory],
[with_libncurses_includes="$withval"],[with_libncurses_includes=no])
AC_ARG_WITH(ncurses_libraries,
[ --with-libncurses-libraries=DIR libncurses library directory],
[with_libncurses_libraries="$withval"],[with_libncurses_libraries=no])
if test "$with_libncurses_includes" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${with_libncurses_includes}"
fi
if test "$with_libncurses_libraries" != "no"; then
LDFLAGS="${LDFLAGS} -L${with_libncurses_libraries}"
fi
AC_ARG_WITH(widec,
[ --with-widec=yes|no|auto(default) compile with widecharacter support (ncursesw)],
[widec="$withval"],[widec=auto])
if test "$widec" = "auto"; then
LCURS=""
WCURS=""
AC_CHECK_HEADERS(ncurses.h,, LCURS="no")
AC_CHECK_HEADERS(ncursesw/ncurses.h,, WCURS="no")
if test "$LCURS" = "no" && test "$WCURS" = "no"; then
echo
echo " ERROR! ncurses.h header not found!"
echo " Please install the development package of Ncurses."
exit
fi
if test "$WCURS" != "no"; then
CPPFLAGS="${CPPFLAGS} -DHAVE_NC_WIDE_HEADERS"
fi
LCURS=""
WCURS=""
AC_CHECK_HEADERS(panel.h,, LCURS="no")
AC_CHECK_HEADERS(ncursesw/panel.h,, WCURS="no")
if test "$LCURS" = "no" && test "$WCURS" = "no"; then
echo
echo " ERROR! panel.h header not found!"
echo " Please install the development package of Ncurses."
exit
fi
LCURS=""
WCURS=""
AC_CHECK_HEADERS(menu.h,, LCURS="no")
AC_CHECK_HEADERS(ncursesw/menu.h,, WCURS="no")
if test "$LCURS" = "no" && test "$WCURS" = "no"; then
echo
echo " ERROR! menu.h header not found!"
echo " Please install the development package of Ncurses."
exit
fi
NCURS=""
NCURSW=""
AC_CHECK_LIB(ncursesw,initscr,[NCURSES_LIBS="$NCURSES_LIBS -lncursesw"], NCURSW="no")
if test "$NCURSW" = "no"; then
AC_CHECK_LIB(ncurses,initscr,[NCURSES_LIBS="$NCURSES_LIBS -lncurses"], NCURS="no")
if test "$NCURS" = "no" && test "$NCURSW" = "no"; then
echo
echo " ERROR! Ncurses library not found!"
exit
fi
else
CPPFLAGS="${CPPFLAGS} -DUSE_WIDEC"
fi
NCURS=""
NCURSW=""
AC_CHECK_LIB(menuw,new_menu,[NCURSES_LIBS="$NCURSES_LIBS -lmenuw"], NCURSW="no")
if test "$NCURSW" = "no"; then
AC_CHECK_LIB(menu,new_menu,, NCURS="no")
if test "$NCURS" = "no"; then
echo
echo " ERROR! Ncurses/menu library not found!"
exit
fi
fi
NCURS=""
NCURSW=""
AC_CHECK_LIB(formw,new_form,[NCURSES_LIBS="$NCURSES_LIBS -lformw"], NCURSW="no")
if test "$NCURSW" = "no"; then
AC_CHECK_LIB(form,new_form,, NCURS="no")
if test "$NCURS" = "no"; then
echo
echo " ERROR! Ncurses/form library not found!"
exit
fi
fi
NCURS=""
NCURSW=""
AC_CHECK_LIB(panelw,new_panel,[NCURSES_LIBS="$NCURSES_LIBS -lpanelw"], NCURSW="no")
if test "$NCURSW" = "no"; then
AC_CHECK_LIB(panel,new_panel,, NCURS="no")
if test "$NCURS" = "no"; then
echo
echo " ERROR! Ncurses/panel library not found!"
exit
fi
fi
elif test "$widec" = "yes"; then
# check for normal ncurses headers as well, because some
# distros seem to have placed the wide headers in
# the path of the normal ones (suse 9.3)
CPPFLAGS="${CPPFLAGS} -DUSE_WIDEC"
LCURS=""
WCURS=""
AC_CHECK_HEADERS(ncursesw/ncurses.h,, WCURS="no")
if test "$LCURS" = "no" && test "$WCURS" = "no"; then
echo
echo " ERROR! ncurses.h header not found!"
echo " Please install the development package of Ncurses."
exit
fi
if test "$WCURS" != "no"; then
CPPFLAGS="${CPPFLAGS} -DHAVE_NC_WIDE_HEADERS"
fi
LCURS=""
WCURS=""
AC_CHECK_HEADERS(panel.h,, LCURS="no")
AC_CHECK_HEADERS(ncursesw/panel.h,, WCURS="no")
if test "$LCURS" = "no" && test "$WCURS" = "no"; then
echo
echo " ERROR! panel.h header not found!"
echo " Please install the development package of Ncurses."
exit
fi
LCURS=""
WCURS=""
AC_CHECK_HEADERS(menu.h,, LCURS="no")
AC_CHECK_HEADERS(ncursesw/menu.h,, WCURS="no")
if test "$LCURS" = "no" && test "$WCURS" = "no"; then
echo
echo " ERROR! menu.h header not found!"
echo " Please install the development package of Ncurses."
exit
fi
NCURSW=""
AC_CHECK_LIB(ncursesw,initscr,[NCURSES_LIBS="$NCURSES_LIBS -lncursesw"], NCURSW="no")
if test "$NCURSW" = "no"; then
echo
echo " ERROR! Ncursesw library not found!"
exit
fi
NCURSW=""
AC_CHECK_LIB(menuw,new_menu,[NCURSES_LIBS="$NCURSES_LIBS -lmenuw"], NCURSW="no")
if test "$NCURSW" = "no"; then
echo
echo " ERROR! Ncursesw/menuw library not found!"
exit
fi
NCURSW=""
AC_CHECK_LIB(formw,new_form,[NCURSES_LIBS="$NCURSES_LIBS -lformw"], NCURSW="no")
if test "$NCURSW" = "no"; then
echo
echo " ERROR! Ncursesw/formw library not found!"
exit
fi
NCURSW=""
AC_CHECK_LIB(panelw,new_panel,[NCURSES_LIBS="$NCURSES_LIBS -lpanelw"], NCURSW="no")
if test "$NCURSW" = "no"; then
echo
echo " ERROR! Ncursesw/panelw library not found!"
exit
fi
else
# No ncursesw. Just check for normal ncurses
#
#
LCURS=""
AC_CHECK_HEADERS(ncurses.h,, LCURS="no")
if test "$LCURS" = "no"; then
echo
echo " ERROR! ncurses.h header not found!"
echo " Please install the development package of Ncurses."
exit
fi
LCURS=""
AC_CHECK_HEADERS(panel.h,, LCURS="no")
if test "$LCURS" = "no"; then
echo
echo " ERROR! panel.h header not found!"
echo " Please install the development package of Ncurses."
exit
fi
LCURS=""
AC_CHECK_HEADERS(menu.h,, LCURS="no")
if test "$LCURS" = "no"; then
echo
echo " ERROR! menu.h header not found!"
echo " Please install the development package of Ncurses."
exit
fi
NCURS=""
AC_CHECK_LIB(ncurses,initscr,[NCURSES_LIBS="$NCURSES_LIBS -lncurses"], NCURS="no")
if test "$NCURS" = "no"; then
echo
echo " ERROR! Ncurses library not found!"
exit
fi
NCURS=""
AC_CHECK_LIB(menu,new_menu,[NCURSES_LIBS="$NCURSES_LIBS -lmenu"], NCURS="no")
if test "$NCURS" = "no"; then
echo
echo " ERROR! Ncurses/menu library not found!"
exit
fi
NCURS=""
AC_CHECK_LIB(form,new_form, [NCURSES_LIBS="$NCURSES_LIBS -lform"], NCURS="no")
if test "$NCURS" = "no"; then
echo
echo " ERROR! Ncurses/form library not found!"
exit
fi
NCURS=""
AC_CHECK_LIB(panel,new_panel, [NCURSES_LIBS="$NCURSES_LIBS -lpanel"], NCURS="no")
if test "$NCURS" = "no"; then
echo
echo " ERROR! Ncurses/panel library not found!"
exit
fi
fi
LIBVUURMUUR_LDADD="../lib/libvuurmuur.la"
AC_SUBST(LIBVUURMUUR_LDADD)
# make sure vuurmuur.h is added to the includes
CPPFLAGS="-I\${top_srcdir}/include/ ${CPPFLAGS}"
AC_SUBST(LIBNFNETLINK_LIBS)
AC_SUBST(LIBMNL_LIBS)
AC_SUBST(LIBNETFILTER_CONNTRACK_LIBS)
AC_SUBST(LIBNETFILTER_LOG_LIBS)
AC_SUBST(NCURSES_LIBS)
AC_CONFIG_FILES([Makefile include/Makefile lib/Makefile lib/textdir/Makefile
vuurmuur/Makefile vuurmuur_log/Makefile vuurmuur_conf/Makefile
po/Makefile.in
vuurmuur_script/Makefile scripts/Makefile services/Makefile
config/Makefile man/Makefile man/en/Makefile man/ru/Makefile
debian/Makefile help/Makefile doc/Makefile])
AC_OUTPUT