]>
Commit | Line | Data |
---|---|---|
62f71e22 | 1 | dnl Boilerplate |
ce6db35a | 2 | AC_INIT([ipset], [7.19], [kadlec@netfilter.org]) |
4f3fe23c | 3 | AC_CONFIG_AUX_DIR([build-aux]) |
159593b6 | 4 | AC_CANONICAL_HOST |
9bff2f93 | 5 | AC_CONFIG_MACRO_DIR([m4]) |
62f71e22 | 6 | AC_CONFIG_HEADER([config.h]) |
7273a704 | 7 | AM_INIT_AUTOMAKE([foreign subdir-objects tar-pax no-dist-gzip dist-xz]) |
b8112e34 | 8 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
62f71e22 | 9 | |
325af556 | 10 | AC_PROG_LN_S |
2da431d3 NS |
11 | AC_ENABLE_STATIC |
12 | LT_INIT([dlopen]) | |
13 | LT_CONFIG_LTDL_DIR([libltdl]) | |
14 | LTDL_INIT([nonrecursive]) | |
15 | ||
fc7221d2 | 16 | PKG_PROG_PKG_CONFIG |
75cd25a0 | 17 | PKG_INSTALLDIR |
fc7221d2 | 18 | |
62f71e22 | 19 | dnl Shortcut: Linux supported alone |
159593b6 | 20 | case "$host" in |
5b360d3e | 21 | *-*-linux* | *-*-uclinux*) ;; |
62f71e22 JK |
22 | *) AC_MSG_ERROR([Linux systems supported exclusively!]);; |
23 | esac | |
24 | ||
70fdf030 MB |
25 | dnl Optionnally disable building the kernel module |
26 | AC_ARG_WITH([kmod], | |
27 | AS_HELP_STRING([--with-kmod=yes/no], | |
28 | [Build the kernel module (default: yes)]), | |
29 | [BUILDKMOD="$withval";], | |
30 | [BUILDKMOD="yes";]) | |
e55645ac | 31 | AM_CONDITIONAL(WITH_KMOD, test "$BUILDKMOD" = "yes") |
70fdf030 | 32 | |
62f71e22 JK |
33 | dnl Additional arguments |
34 | dnl Kernel build directory or source tree | |
d6484ee2 JE |
35 | AC_ARG_WITH([kbuild], |
36 | AS_HELP_STRING([--with-kbuild=PATH], | |
37 | [Path to kernel build directory]), | |
38 | [KBUILDDIR="$withval";]) | |
39 | AC_ARG_WITH([ksource], | |
40 | AS_HELP_STRING([--with-ksource=PATH], | |
0bd46e82 | 41 | [Path to kernel source directory, if not the same as the kernel build directory]), |
d6484ee2 | 42 | [KSOURCEDIR="$withval";]) |
62f71e22 JK |
43 | AM_CONDITIONAL(WITH_KBUILDDIR, test "$KBUILDDIR" != "") |
44 | AC_SUBST(KBUILDDIR) | |
45 | ||
3b094130 MF |
46 | dnl ipset bash compspec - bash shell programmable completion |
47 | AC_ARG_ENABLE([bashcompl], | |
48 | AS_HELP_STRING([--enable-bashcompl], | |
49 | [Install bash completion for ipset]), | |
50 | [enable_bashcompl="$enableval"], [enable_bashcompl="no"]) | |
51 | ||
a3a98490 JK |
52 | # backward compatibility with older pkg-config |
53 | m4_ifndef([PKG_CHECK_VAR], [ | |
54 | # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, | |
55 | # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) | |
56 | # ------------------------------------------- | |
57 | # Retrieves the value of the pkg-config variable for the given module. | |
58 | AC_DEFUN([PKG_CHECK_VAR], | |
59 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | |
60 | AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl | |
61 | ||
62 | _PKG_CONFIG([$1], [variable="][$3]["], [$2]) | |
63 | AS_VAR_COPY([$1], [pkg_cv_][$1]) | |
64 | ||
65 | AS_VAR_IF([$1], [""], [$5], [$4])dnl | |
66 | ])# PKG_CHECK_VAR | |
67 | ]) | |
68 | ||
66d51258 SP |
69 | # This hack makes PKG_CHECK_VARS from m4/pkg.m4 work on autoconf 2.63 |
70 | # (courtesy of sunnybear in https://github.com/gdnsd/gdnsd/issues/85) | |
71 | m4_ifndef([AS_VAR_COPY], | |
72 | [m4_define([AS_VAR_COPY], | |
73 | [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])]) | |
74 | ||
3b094130 MF |
75 | if test "x$enable_bashcompl" = "xyes"; then |
76 | PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], , bashcompdir="${sysconfdir}/bash_completion.d") | |
77 | AC_SUBST(bashcompdir) | |
78 | fi | |
79 | ||
e55645ac | 80 | if test "$BUILDKMOD" = "yes" |
70fdf030 | 81 | then |
8dd10256 JK |
82 | dnl Sigh: check kernel version dependencies |
83 | if test "$KBUILDDIR" != "" | |
84 | then | |
85 | kbuilddir="$KBUILDDIR" | |
86 | else | |
87 | kbuilddir="/lib/modules/`uname -r`/build" | |
88 | fi | |
89 | ||
d6484ee2 JE |
90 | if test -n "$KSOURCEDIR"; then |
91 | ksourcedir="$KSOURCEDIR" | |
0bd46e82 JK |
92 | elif test -e "$kbuilddir/include/linux/netfilter/nfnetlink.h"; then |
93 | ksourcedir="$kbuilddir" | |
d6484ee2 JE |
94 | else |
95 | ksourcedir="/lib/modules/$(uname -r)/source" | |
8dd10256 | 96 | fi |
0bd46e82 JK |
97 | if test ! -e "$ksourcedir/include/linux/netfilter/nfnetlink.h" |
98 | then | |
99 | AC_MSG_ERROR([Invalid kernel source directory $ksourcedir]) | |
100 | fi | |
8dd10256 | 101 | |
1b8c69e1 JK |
102 | if test ! -e "$kbuilddir/.config" |
103 | then | |
104 | AC_MSG_ERROR([The kernel build directory $kbuilddir is not configured]) | |
105 | fi | |
106 | ||
107 | AC_PROG_GREP | |
8a82b39e | 108 | AC_PROG_AWK |
1b8c69e1 | 109 | |
0c3884a5 JE |
110 | if ! $GREP -q "NFNL_SUBSYS_IPSET" "$ksourcedir/include/linux/netfilter/nfnetlink.h" && \ |
111 | ! $GREP -q "NFNL_SUBSYS_IPSET" "$ksourcedir/include/uapi/linux/netfilter/nfnetlink.h"; | |
18ae855b JK |
112 | then |
113 | AC_MSG_ERROR([The kernel source directory $ksourcedir is not patched with netlink.patch to support ipset]) | |
114 | fi | |
70fdf030 | 115 | fi |
18ae855b | 116 | |
62f71e22 JK |
117 | dnl Maximal number of sets supported by the kernel, default 256 |
118 | AC_ARG_WITH([maxsets], | |
119 | AS_HELP_STRING([--with-maxsets=256], | |
120 | [Maximal numer of sets supported by the kernel]), | |
121 | [MAXSETS="$withval";]) | |
122 | AM_CONDITIONAL(WITH_MAXSETS, test "$MAXSETS" != "") | |
123 | AC_SUBST(MAXSETS) | |
124 | ||
125 | dnl Verbose compiling | |
126 | AC_ARG_ENABLE([verbose], | |
127 | AS_HELP_STRING([--enable-verbose], | |
128 | [Enable verbose mode at compiling/linking.]), | |
129 | [case "${enableval}" in | |
130 | yes) enable_verbose=yes ;; | |
131 | no) enable_verbose=no ;; | |
132 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-verbose]) ;; | |
133 | esac], [enable_verbose=no]) | |
134 | ||
95bc8577 JK |
135 | AC_ARG_ENABLE([debug], |
136 | AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]), | |
137 | [], [enable_debug=no]) | |
138 | AS_IF([test "x$enable_debug" = "xyes"], [ | |
139 | AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) | |
140 | ]) | |
97a12ba3 | 141 | AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = xyes]) |
62f71e22 | 142 | |
2da431d3 NS |
143 | dnl Enable type modules |
144 | AC_ARG_ENABLE([settype_modules], | |
145 | AS_HELP_STRING([--enable-settype-modules], | |
146 | [Enable set type modules support]), | |
147 | [enable_settype_modules="$enableval"], | |
148 | [enable_settype_modules="no"]) | |
149 | ||
150 | AC_ARG_WITH([settype_modules_list], | |
151 | AS_HELP_STRING([--with-settype-modules-list="mod1 mod2 ..."], | |
152 | [List of dynamic loading modules, ignored if settype-modules is disabled. It could be "all" to build all available settypes as modules]), | |
153 | [SETTYPE_MODLIST_RAW="$withval";]) | |
154 | ||
155 | SETTYPE_MODLIST= | |
156 | if test "x$enable_settype_modules" = "xyes"; then | |
157 | for mod in $SETTYPE_MODLIST_RAW; do | |
158 | if echo $mod | grep "all"; then | |
159 | m="${mod}" | |
160 | else | |
161 | if echo $mod | grep "ipset_"; then | |
162 | m="${mod}.c" | |
163 | else | |
164 | m="ipset_${mod}.c" | |
165 | fi | |
166 | fi | |
167 | ||
168 | SETTYPE_MODLIST="${SETTYPE_MODLIST} $m" | |
169 | done | |
170 | ||
171 | AC_MSG_RESULT([checking for configuration with dynamic loading modules... $SETTYPE_MODLIST_RAW]) | |
172 | fi | |
173 | AC_SUBST(SETTYPE_MODLIST) | |
174 | ||
175 | AM_CONDITIONAL([ENABLE_SETTYPE_MODULES], [test "x$enable_settype_modules" = xyes]) | |
176 | ||
177 | AM_CONDITIONAL([ENABLE_STATIC], [test "x$enable_static" = xyes]) | |
178 | AM_CONDITIONAL([ENABLE_SHARED], [test "x$enable_shared" = xyes]) | |
179 | ||
62f71e22 | 180 | dnl Checks for programs |
5039472d JK |
181 | : ${CFLAGS=""} |
182 | ||
62f71e22 | 183 | AC_PROG_CC |
6fd3b235 | 184 | AM_PROG_CC_C_O |
c3ef8798 | 185 | AC_PROG_LIBTOOL |
62f71e22 JK |
186 | AC_PROG_INSTALL |
187 | AC_PROG_LN_S | |
188 | ||
189 | dnl Checks for libraries | |
7607e809 | 190 | PKG_CHECK_MODULES([libmnl], [libmnl >= 1]) |
62f71e22 JK |
191 | |
192 | dnl Checks for header files | |
193 | ||
2a233492 JK |
194 | dnl Checks for declarations |
195 | AC_CHECK_DECLS([NLA_F_NESTED, NLA_F_NET_BYTEORDER, NLA_TYPE_MASK],, | |
196 | [AC_MSG_ERROR([System kernel header files are older than 2.6.24, use CFLAGS for non-default location])], | |
197 | [#include <sys/socket.h> | |
198 | #include <linux/netlink.h>]) | |
199 | ||
c35dbd0a | 200 | dnl Checks for typedefs, structures |
62f71e22 JK |
201 | AC_CHECK_TYPES([union nf_inet_addr],,,[#include <linux/types.h> |
202 | #include <netinet/in.h> | |
203 | #include <linux/netfilter.h>]) | |
c35dbd0a | 204 | |
c52cf600 JK |
205 | dnl Checks for functions |
206 | AC_CHECK_FUNCS(gethostbyname2) | |
207 | ||
e55645ac | 208 | if test "$BUILDKMOD" = "yes" |
a76488a8 | 209 | then |
8a82b39e | 210 | dnl Check kernel incompatibilities... Ugly like hell |
33f38811 | 211 | |
73dfa4df SP |
212 | AC_MSG_CHECKING([kernel source for INIT_DEFERRABLE_WORK]) |
213 | if test -f $ksourcedir/include/linux/workqueue.h && \ | |
214 | $GREP -q 'INIT_DEFERRABLE_WORK' $ksourcedir/include/linux/workqueue.h; then | |
215 | AC_MSG_RESULT(yes) | |
216 | AC_SUBST(HAVE_INIT_DEFERRABLE_WORK, define) | |
217 | else | |
218 | AC_MSG_RESULT(no) | |
219 | AC_SUBST(HAVE_INIT_DEFERRABLE_WORK, undef) | |
220 | fi | |
221 | ||
33f38811 JK |
222 | AC_MSG_CHECKING([kernel source for system_power_efficient_wq]) |
223 | if test -f $ksourcedir/include/linux/workqueue.h && \ | |
224 | $GREP -q 'system_power_efficient_wq' $ksourcedir/include/linux/workqueue.h; then | |
225 | AC_MSG_RESULT(yes) | |
7b2eab58 | 226 | AC_SUBST(HAVE_SYSTEM_POWER_EFFICIENT_WQ, define) |
bf8533f5 JK |
227 | elif test -f $ksourcedir/include/linux/workqueue.h && \ |
228 | $GREP -q 'system_wq' $ksourcedir/include/linux/workqueue.h; then | |
33f38811 | 229 | AC_MSG_RESULT(no) |
7b2eab58 | 230 | AC_SUBST(HAVE_SYSTEM_POWER_EFFICIENT_WQ, undef) |
bf8533f5 JK |
231 | else |
232 | AC_MSG_ERROR([Kernel source tree is too old, at least v2.36 is required]) | |
33f38811 JK |
233 | fi |
234 | ||
8a82b39e JK |
235 | AC_MSG_CHECKING([kernel source for struct xt_action_param]) |
236 | if test -f $ksourcedir/include/linux/netfilter/x_tables.h && \ | |
237 | $GREP -q 'struct xt_action_param' $ksourcedir/include/linux/netfilter/x_tables.h; then | |
238 | AC_MSG_RESULT(yes) | |
239 | AC_SUBST(HAVE_STRUCT_XT_ACTION_PARAM, define) | |
240 | else | |
241 | AC_MSG_RESULT(no) | |
242 | AC_SUBST(HAVE_STRUCT_XT_ACTION_PARAM, undef) | |
243 | fi | |
244 | ||
245 | AC_MSG_CHECKING([kernel source for vzalloc]) | |
246 | if test -f $ksourcedir/include/linux/vmalloc.h && \ | |
247 | $GREP -q 'vzalloc' $ksourcedir/include/linux/vmalloc.h; then | |
248 | AC_MSG_RESULT(yes) | |
249 | AC_SUBST(HAVE_VZALLOC, define) | |
250 | else | |
251 | AC_MSG_RESULT(no) | |
252 | AC_SUBST(HAVE_VZALLOC, undef) | |
253 | fi | |
254 | ||
255 | AC_MSG_CHECKING([kernel source for ether_addr_equal]) | |
256 | if test -f $ksourcedir/include/linux/etherdevice.h && \ | |
257 | $GREP -q 'ether_addr_equal' $ksourcedir/include/linux/etherdevice.h; then | |
258 | AC_MSG_RESULT(yes) | |
259 | AC_SUBST(HAVE_ETHER_ADDR_EQUAL, define) | |
260 | else | |
261 | AC_MSG_RESULT(no) | |
262 | AC_SUBST(HAVE_ETHER_ADDR_EQUAL, undef) | |
263 | fi | |
264 | ||
831c1b70 JK |
265 | AC_MSG_CHECKING([kernel source for is_zero_ether_addr]) |
266 | if test -f $ksourcedir/include/linux/etherdevice.h && \ | |
267 | $GREP -q 'is_zero_ether_addr' $ksourcedir/include/linux/etherdevice.h; then | |
268 | AC_MSG_RESULT(yes) | |
269 | AC_SUBST(HAVE_IS_ZERO_ETHER_ADDR, define) | |
270 | else | |
271 | AC_MSG_RESULT(no) | |
272 | AC_SUBST(HAVE_IS_ZERO_ETHER_ADDR, undef) | |
273 | fi | |
274 | ||
90e279db JK |
275 | AC_MSG_CHECKING([kernel source for nla_put_be16]) |
276 | if test -f $ksourcedir/include/net/netlink.h && \ | |
277 | $GREP -q 'nla_put_be16' $ksourcedir/include/net/netlink.h; then | |
278 | AC_MSG_RESULT(yes) | |
279 | AC_SUBST(HAVE_NLA_PUT_BE16, define) | |
280 | else | |
281 | AC_MSG_RESULT(no) | |
282 | AC_SUBST(HAVE_NLA_PUT_BE16, undef) | |
283 | fi | |
284 | ||
8a82b39e JK |
285 | AC_MSG_CHECKING([kernel source for nla_put_be64]) |
286 | if test -f $ksourcedir/include/net/netlink.h && \ | |
287 | $GREP -q 'nla_put_be64' $ksourcedir/include/net/netlink.h; then | |
288 | AC_MSG_RESULT(yes) | |
289 | AC_SUBST(HAVE_NLA_PUT_BE64, define) | |
290 | else | |
291 | AC_MSG_RESULT(no) | |
292 | AC_SUBST(HAVE_NLA_PUT_BE64, undef) | |
293 | fi | |
294 | ||
caaa867c NS |
295 | AC_MSG_CHECKING([kernel source for nla_put_64bit]) |
296 | if test -f $ksourcedir/include/net/netlink.h && \ | |
297 | $GREP -q 'nla_put_64bit' $ksourcedir/include/net/netlink.h; then | |
298 | AC_MSG_RESULT(yes) | |
299 | AC_SUBST(HAVE_NLA_PUT_64BIT, define) | |
300 | else | |
301 | AC_MSG_RESULT(no) | |
302 | AC_SUBST(HAVE_NLA_PUT_64BIT, undef) | |
303 | fi | |
304 | ||
8a82b39e JK |
305 | AC_MSG_CHECKING([kernel source for portid in nl_info]) |
306 | if test -f $ksourcedir/include/linux/netlink.h && \ | |
0f822283 | 307 | $AWK '/^struct netlink_skb_parms /,/^}/' $ksourcedir/include/linux/netlink.h | $GREP -q 'portid;'; then |
8a82b39e JK |
308 | AC_MSG_RESULT(yes) |
309 | AC_SUBST(HAVE_NL_INFO_PORTID, define) | |
310 | else | |
311 | AC_MSG_RESULT(no) | |
312 | AC_SUBST(HAVE_NL_INFO_PORTID, undef) | |
313 | fi | |
314 | ||
315 | AC_MSG_CHECKING([kernel source for netlink_dump_start args]) | |
316 | if test -f $ksourcedir/include/linux/netlink.h && \ | |
0f822283 | 317 | $AWK '/ netlink_dump_start\(/,/\)/' $ksourcedir/include/linux/netlink.h | $GREP -q 'done.*;'; then |
8a82b39e JK |
318 | AC_MSG_RESULT(5 args) |
319 | AC_SUBST(HAVE_NETLINK_DUMP_START_ARGS, 5) | |
320 | elif test -f $ksourcedir/include/linux/netlink.h && \ | |
0f822283 | 321 | $AWK '/ netlink_dump_start\(/,/\)/' $ksourcedir/include/linux/netlink.h | $GREP -q 'min_dump_alloc.*;'; then |
8a82b39e JK |
322 | AC_MSG_RESULT(6 args) |
323 | AC_SUBST(HAVE_NETLINK_DUMP_START_ARGS, 6) | |
87131f28 SP |
324 | elif test -f $ksourcedir/include/linux/netlink.h && \ |
325 | $AWK '/^struct netlink_dump_control {/,/\}/' $ksourcedir/include/linux/netlink.h | $GREP -q '\(\*start\)'; then | |
8a82b39e JK |
326 | AC_MSG_RESULT(4 args) |
327 | AC_SUBST(HAVE_NETLINK_DUMP_START_ARGS, 4) | |
87131f28 SP |
328 | else |
329 | AC_MSG_RESULT(7 fake args) | |
330 | AC_SUBST(HAVE_NETLINK_DUMP_START_ARGS, 7) | |
8a82b39e JK |
331 | fi |
332 | ||
333 | AC_MSG_CHECKING([kernel source for ns_capable]) | |
334 | if test -f $ksourcedir/include/linux/capability.h && \ | |
335 | $GREP -q 'ns_capable' $ksourcedir/include/linux/capability.h; then | |
336 | AC_MSG_RESULT(yes) | |
337 | AC_SUBST(HAVE_NS_CAPABLE, define) | |
338 | else | |
339 | AC_MSG_RESULT(no) | |
340 | AC_SUBST(HAVE_NS_CAPABLE, undef) | |
341 | fi | |
342 | ||
343 | AC_MSG_CHECKING([kernel source for nfnl_lock per subsys]) | |
344 | if test -f $ksourcedir/include/linux/netfilter/nfnetlink.h && \ | |
345 | $GREP -q 'nfnl_lock.* subsys_id' $ksourcedir/include/linux/netfilter/nfnetlink.h; then | |
346 | AC_MSG_RESULT(yes) | |
347 | AC_SUBST(HAVE_NFNL_LOCK_SUBSYS, define) | |
348 | else | |
349 | AC_MSG_RESULT(no) | |
350 | AC_SUBST(HAVE_NFNL_LOCK_SUBSYS, undef) | |
351 | fi | |
352 | ||
353 | AC_MSG_CHECKING([kernel source for export.h]) | |
354 | if test -f $ksourcedir/include/linux/export.h; then | |
355 | AC_MSG_RESULT(yes) | |
356 | AC_SUBST(HAVE_EXPORT_H, define) | |
357 | else | |
358 | AC_MSG_RESULT(no) | |
359 | AC_SUBST(HAVE_EXPORT_H, undef) | |
360 | fi | |
361 | ||
362 | AC_MSG_CHECKING([kernel source for ipv6_skip_exthdr args]) | |
363 | if test -f $ksourcedir/include/net/ipv6.h && \ | |
a1ccbae8 | 364 | $AWK '/( |\t)ipv6_skip_exthdr\(/,/\)/' $ksourcedir/include/net/ipv6.h | $GREP -q 'frag_offp'; then |
8a82b39e JK |
365 | AC_MSG_RESULT(4 args) |
366 | AC_SUBST(HAVE_IPV6_SKIP_EXTHDR_ARGS, 4) | |
367 | else | |
368 | AC_MSG_RESULT(3 args) | |
369 | AC_SUBST(HAVE_IPV6_SKIP_EXTHDR_ARGS, 3) | |
370 | fi | |
371 | ||
bb750b8d SP |
372 | AC_MSG_CHECKING([kernel source for cond_resched_rcu]) |
373 | if test -f $ksourcedir/include/linux/sched.h && \ | |
374 | $AWK '/( |\t)cond_resched_rcu\(/,/\)/' $ksourcedir/include/linux/sched.h | $GREP -q 'cond_resched_rcu'; then | |
375 | AC_MSG_RESULT(yes) | |
376 | AC_SUBST(HAVE_COND_RESCHED_RCU, define) | |
377 | else | |
378 | AC_MSG_RESULT(no) | |
379 | AC_SUBST(HAVE_COND_RESCHED_RCU, undef) | |
380 | fi | |
381 | ||
8a82b39e | 382 | AC_MSG_CHECKING([kernel source for bool checkentry function prototype]) |
90e279db JK |
383 | if test -f $ksourcedir/include/linux/netfilter/x_tables.h && \ |
384 | $GREP -q 'bool .\*checkentry.' $ksourcedir/include/linux/netfilter/x_tables.h; then | |
8a82b39e JK |
385 | AC_MSG_RESULT(yes) |
386 | AC_SUBST(HAVE_CHECKENTRY_BOOL, define) | |
387 | else | |
388 | AC_MSG_RESULT(no) | |
389 | AC_SUBST(HAVE_CHECKENTRY_BOOL, undef) | |
390 | fi | |
391 | ||
392 | AC_MSG_CHECKING([kernel source for old struct xt_target_param]) | |
90e279db JK |
393 | if test -f $ksourcedir/include/linux/netfilter/x_tables.h && \ |
394 | $GREP -q '^struct xt_target_param ' $ksourcedir/include/linux/netfilter/x_tables.h; then | |
8a82b39e JK |
395 | AC_MSG_RESULT(yes) |
396 | AC_SUBST(HAVE_XT_TARGET_PARAM, define) | |
397 | else | |
398 | AC_MSG_RESULT(no) | |
399 | AC_SUBST(HAVE_XT_TARGET_PARAM, undef) | |
400 | fi | |
401 | ||
402 | AC_MSG_CHECKING([kernel source for id in struct pernet_operations]) | |
403 | if test -f $ksourcedir/include/net/net_namespace.h && \ | |
0f822283 | 404 | $AWK '/^struct pernet_operations /,/^}/' $ksourcedir/include/net/net_namespace.h | $GREP -q 'int \*id;'; then |
8a82b39e JK |
405 | AC_MSG_RESULT(yes) |
406 | AC_SUBST(HAVE_NET_OPS_ID, define) | |
407 | else | |
408 | AC_MSG_RESULT(no) | |
409 | AC_SUBST(HAVE_NET_OPS_ID, undef) | |
410 | fi | |
411 | ||
01b198d0 JK |
412 | AC_MSG_CHECKING([kernel source for async in struct pernet_operations]) |
413 | if test -f $ksourcedir/include/net/net_namespace.h && \ | |
414 | $AWK '/^struct pernet_operations /,/^}/' $ksourcedir/include/net/net_namespace.h | $GREP -q 'bool async;'; then | |
415 | AC_MSG_RESULT(yes) | |
416 | AC_SUBST(HAVE_NET_OPS_ASYNC, define) | |
417 | else | |
418 | AC_MSG_RESULT(no) | |
419 | AC_SUBST(HAVE_NET_OPS_ASYNC, undef) | |
420 | fi | |
421 | ||
f1446f13 JK |
422 | AC_MSG_CHECKING([kernel source for user_ns in struct net]) |
423 | if test -f $ksourcedir/include/net/net_namespace.h && \ | |
0f822283 | 424 | $AWK '/^struct net \{/,/^}/' $ksourcedir/include/net/net_namespace.h | $GREP -q 'user_ns'; then |
f1446f13 JK |
425 | AC_MSG_RESULT(yes) |
426 | AC_SUBST(HAVE_USER_NS_IN_STRUCT_NET, define) | |
427 | else | |
428 | AC_MSG_RESULT(no) | |
429 | AC_SUBST(HAVE_USER_NS_IN_STRUCT_NET, undef) | |
430 | fi | |
431 | ||
04ca6d37 CS |
432 | AC_MSG_CHECKING([kernel source for rbtree_postorder_for_each_entry_safe]) |
433 | if test -f $ksourcedir/include/linux/rbtree.h && \ | |
434 | $GREP -q 'rbtree_postorder_for_each_entry_safe' $ksourcedir/include/linux/rbtree.h; then | |
435 | AC_MSG_RESULT(yes) | |
436 | AC_SUBST(HAVE_RBTREE_POSTORDER_FOR_EACH_ENTRY_SAFE, define) | |
437 | else | |
438 | AC_MSG_RESULT(no) | |
439 | AC_SUBST(HAVE_RBTREE_POSTORDER_FOR_EACH_ENTRY_SAFE, undef) | |
440 | fi | |
441 | ||
a2774149 JK |
442 | AC_MSG_CHECKING([kernel source for kvcalloc]) |
443 | if test -f $ksourcedir/include/linux/mm.h && \ | |
444 | $GREP -q 'kvcalloc' $ksourcedir/include/linux/mm.h; then | |
445 | AC_MSG_RESULT(yes) | |
446 | AC_SUBST(HAVE_KVCALLOC, define) | |
b0a56bb1 JK |
447 | elif test -f $ksourcedir/include/linux/slab.h && \ |
448 | $GREP -q 'kvcalloc' $ksourcedir/include/linux/slab.h; then | |
449 | AC_MSG_RESULT(yes) | |
450 | AC_SUBST(HAVE_KVCALLOC, define) | |
a2774149 JK |
451 | else |
452 | AC_MSG_RESULT(no) | |
453 | AC_SUBST(HAVE_KVCALLOC, undef) | |
454 | fi | |
455 | ||
f87083ee WC |
456 | AC_MSG_CHECKING([kernel source for kvfree]) |
457 | if test -f $ksourcedir/include/linux/mm.h && \ | |
458 | $GREP -q 'kvfree' $ksourcedir/include/linux/mm.h; then | |
459 | AC_MSG_RESULT(yes) | |
460 | AC_SUBST(HAVE_KVFREE, define) | |
b0a56bb1 JK |
461 | elif test -f $ksourcedir/include/linux/slab.h && \ |
462 | $GREP -q 'kvfree' $ksourcedir/include/linux/slab.h; then | |
463 | AC_MSG_RESULT(yes) | |
464 | AC_SUBST(HAVE_KVFREE, define) | |
f87083ee WC |
465 | else |
466 | AC_MSG_RESULT(no) | |
467 | AC_SUBST(HAVE_KVFREE, undef) | |
468 | fi | |
469 | ||
3f685a1f JK |
470 | AC_MSG_CHECKING([kernel source for bitmap_zalloc]) |
471 | if test -f $ksourcedir/include/linux/bitmap.h && \ | |
472 | $GREP -q 'bitmap_zalloc' $ksourcedir/include/linux/bitmap.h; then | |
473 | AC_MSG_RESULT(yes) | |
474 | AC_SUBST(HAVE_BITMAP_ZALLOC, define) | |
475 | else | |
476 | AC_MSG_RESULT(no) | |
477 | AC_SUBST(HAVE_BITMAP_ZALLOC, undef) | |
478 | fi | |
479 | ||
480 | AC_MSG_CHECKING([kernel source for bitmap_zero]) | |
481 | if test -f $ksourcedir/include/linux/bitmap.h && \ | |
482 | $GREP -q 'bitmap_zero' $ksourcedir/include/linux/bitmap.h; then | |
483 | AC_MSG_RESULT(yes) | |
484 | AC_SUBST(HAVE_BITMAP_ZERO, define) | |
485 | else | |
486 | AC_MSG_RESULT(no) | |
487 | AC_SUBST(HAVE_BITMAP_ZERO, undef) | |
488 | fi | |
489 | ||
90e279db JK |
490 | AC_MSG_CHECKING([kernel source for struct net in struct xt_mtchk_param]) |
491 | if test -f $ksourcedir/include/linux/netfilter/x_tables.h && \ | |
0f822283 | 492 | $AWK '/^struct xt_mtchk_param /,/^}/' $ksourcedir/include/linux/netfilter/x_tables.h | \ |
90e279db JK |
493 | $GREP -q 'struct net '; then |
494 | AC_MSG_RESULT(yes) | |
495 | AC_SUBST(HAVE_XT_MTCHK_PARAM_STRUCT_NET, define) | |
496 | else | |
497 | AC_MSG_RESULT(no) | |
498 | AC_SUBST(HAVE_XT_MTCHK_PARAM_STRUCT_NET, undef) | |
499 | fi | |
500 | ||
3ee3e5ad JK |
501 | AC_MSG_CHECKING([kernel source for struct net in the change function of tcf_ematch_ops]) |
502 | if test -f $ksourcedir/include/net/pkt_cls.h && \ | |
0f822283 | 503 | $AWK '/^struct tcf_ematch_ops /,/^}/' $ksourcedir/include/net/pkt_cls.h | \ |
3ee3e5ad JK |
504 | $GREP -q '\*change..struct net \*net'; then |
505 | AC_MSG_RESULT(yes) | |
506 | AC_SUBST(HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET, define) | |
507 | else | |
508 | AC_MSG_RESULT(no) | |
509 | AC_SUBST(HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET, undef) | |
510 | fi | |
511 | ||
512 | AC_MSG_CHECKING([kernel source for struct net in struct tcf_ematch]) | |
513 | if test -f $ksourcedir/include/net/pkt_cls.h && \ | |
0f822283 | 514 | $AWK '/^struct tcf_ematch /,/^}/' $ksourcedir/include/net/pkt_cls.h | \ |
3ee3e5ad JK |
515 | $GREP -q 'struct net'; then |
516 | AC_MSG_RESULT(yes) | |
517 | AC_SUBST(HAVE_TCF_EMATCH_STRUCT_NET, define) | |
518 | else | |
519 | AC_MSG_RESULT(no) | |
520 | AC_SUBST(HAVE_TCF_EMATCH_STRUCT_NET, undef) | |
521 | fi | |
522 | ||
c350a7f3 JK |
523 | AC_MSG_CHECKING([kernel source for list_last_entry]) |
524 | if test -f $ksourcedir/include/linux/list.h && \ | |
525 | $GREP -q 'list_last_entry' $ksourcedir/include/linux/list.h; then | |
526 | AC_MSG_RESULT(yes) | |
527 | AC_SUBST(HAVE_LIST_LAST_ENTRY, define) | |
528 | else | |
529 | AC_MSG_RESULT(no) | |
530 | AC_SUBST(HAVE_LIST_LAST_ENTRY, undef) | |
531 | fi | |
532 | ||
f1d7b4b9 JK |
533 | AC_MSG_CHECKING([kernel source for list_next_entry]) |
534 | if test -f $ksourcedir/include/linux/list.h && \ | |
535 | $GREP -q 'list_next_entry' $ksourcedir/include/linux/list.h; then | |
536 | AC_MSG_RESULT(yes) | |
537 | AC_SUBST(HAVE_LIST_NEXT_ENTRY, define) | |
538 | else | |
539 | AC_MSG_RESULT(no) | |
540 | AC_SUBST(HAVE_LIST_NEXT_ENTRY, undef) | |
541 | fi | |
542 | ||
8bd2debc JK |
543 | AC_MSG_CHECKING([kernel source for ether_addr_copy]) |
544 | if test -f $ksourcedir/include/linux/etherdevice.h && \ | |
545 | $GREP -q 'ether_addr_copy' $ksourcedir/include/linux/etherdevice.h; then | |
546 | AC_MSG_RESULT(yes) | |
547 | AC_SUBST(HAVE_ETHER_ADDR_COPY, define) | |
548 | else | |
549 | AC_MSG_RESULT(no) | |
550 | AC_SUBST(HAVE_ETHER_ADDR_COPY, undef) | |
551 | fi | |
552 | ||
3fdc27aa FW |
553 | AC_MSG_CHECKING([kernel source for nf_bridge_get_physindev]) |
554 | if test -f $ksourcedir/include/linux/netfilter_bridge.h && \ | |
555 | $GREP -q 'nf_bridge_get_physindev' $ksourcedir/include/linux/netfilter_bridge.h; then | |
556 | AC_MSG_RESULT(yes) | |
557 | AC_SUBST(HAVE_NF_BRIDGE_GET_PHYSDEV, define) | |
558 | else | |
559 | AC_MSG_RESULT(no) | |
560 | AC_SUBST(HAVE_NF_BRIDGE_GET_PHYSDEV, undef) | |
561 | fi | |
562 | ||
01a13aa4 JB |
563 | AC_MSG_CHECKING([kernel source for nla_put_in_addr]) |
564 | if test -f $ksourcedir/include/net/netlink.h && \ | |
565 | $GREP -q 'nla_put_in_add' $ksourcedir/include/net/netlink.h; then | |
566 | AC_MSG_RESULT(yes) | |
567 | AC_SUBST(HAVE_NLA_PUT_IN_ADDR, define) | |
568 | else | |
569 | AC_MSG_RESULT(no) | |
570 | AC_SUBST(HAVE_NLA_PUT_IN_ADDR, undef) | |
571 | fi | |
572 | ||
bad58fb5 | 573 | AC_MSG_CHECKING([kernel source for struct net in the call() function in struct nfnl_callback]) |
b418935b | 574 | if test -f $ksourcedir/include/linux/netfilter/nfnetlink.h && \ |
bad58fb5 | 575 | $AWK '/^struct nfnl_callback /,/\);$/' $ksourcedir/include/linux/netfilter/nfnetlink.h | \ |
b418935b JK |
576 | $GREP -q 'struct net'; then |
577 | AC_MSG_RESULT(yes) | |
578 | AC_SUBST(HAVE_NET_IN_NFNL_CALLBACK_FN, define) | |
579 | else | |
580 | AC_MSG_RESULT(no) | |
581 | AC_SUBST(HAVE_NET_IN_NFNL_CALLBACK_FN, undef) | |
582 | fi | |
583 | ||
7de1b275 JK |
584 | AC_MSG_CHECKING([kernel source for EXPORT_SYMBOL_GPL in module.h]) |
585 | if test -f $ksourcedir/include/linux/module.h && \ | |
586 | $GREP -q 'EXPORT_SYMBOL_GPL' $ksourcedir/include/linux/module.h; then | |
587 | AC_MSG_RESULT(yes) | |
588 | AC_SUBST(HAVE_EXPORT_SYMBOL_GPL_IN_MODULE_H, define) | |
589 | else | |
590 | AC_MSG_RESULT(no) | |
591 | AC_SUBST(HAVE_EXPORT_SYMBOL_GPL_IN_MODULE_H, undef) | |
592 | fi | |
593 | ||
f0c110ec JP |
594 | AC_MSG_CHECKING([kernel source for tc_skb_protocol in pkt_sched.h]) |
595 | if test -f $ksourcedir/include/net/pkt_sched.h && \ | |
596 | $GREP -q 'tc_skb_protocol' $ksourcedir/include/net/pkt_sched.h; then | |
597 | AC_MSG_RESULT(yes) | |
598 | AC_SUBST(HAVE_TC_SKB_PROTOCOL, define) | |
599 | else | |
600 | AC_MSG_RESULT(no) | |
601 | AC_SUBST(HAVE_TC_SKB_PROTOCOL, undef) | |
de06e92f SP |
602 | |
603 | AC_MSG_CHECKING([kernel source for vlan_proto in struct sk_buff]) | |
604 | if test -f $ksourcedir/include/linux/skbuff.h && \ | |
605 | $AWK '/^struct sk_buff {/,/^};$/' $ksourcedir/include/linux/skbuff.h | \ | |
606 | $GREP -q 'vlan_proto'; then | |
607 | AC_MSG_RESULT(yes) | |
608 | AC_SUBST(HAVE_VLAN_PROTO_IN_SK_BUFF, define) | |
609 | else | |
610 | AC_MSG_RESULT(no) | |
611 | AC_SUBST(HAVE_VLAN_PROTO_IN_SK_BUFF, undef) | |
612 | fi | |
f0c110ec JP |
613 | fi |
614 | ||
a065f8ed SP |
615 | AC_MSG_CHECKING([kernel source for iif to skb_iif rename in struct sk_buff]) |
616 | if test -f $ksourcedir/include/linux/skbuff.h && \ | |
617 | $AWK '/^struct sk_buff {/,/^};$/' $ksourcedir/include/linux/skbuff.h | \ | |
618 | $GREP -q 'skb_iif'; then | |
619 | AC_MSG_RESULT(yes) | |
620 | AC_SUBST(HAVE_SKB_IIF, define) | |
621 | else | |
622 | AC_MSG_RESULT(no) | |
623 | AC_SUBST(HAVE_SKB_IIF, undef) | |
624 | fi | |
625 | ||
c71fc214 EB |
626 | AC_MSG_CHECKING([kernel source for struct net in struct xt_action_param]) |
627 | if test -f $ksourcedir/include/linux/netfilter/x_tables.h && \ | |
0f822283 | 628 | $AWK '/^struct xt_action_param /,/^}/' $ksourcedir/include/linux/netfilter/x_tables.h | \ |
c71fc214 EB |
629 | $GREP -q 'struct net '; then |
630 | AC_MSG_RESULT(yes) | |
631 | AC_SUBST(HAVE_NET_IN_XT_ACTION_PARAM, define) | |
632 | else | |
633 | AC_MSG_RESULT(no) | |
634 | AC_SUBST(HAVE_NET_IN_XT_ACTION_PARAM, undef) | |
635 | fi | |
636 | ||
1d90b779 JK |
637 | AC_MSG_CHECKING([kernel source for struct nf_hook_state in struct xt_action_param]) |
638 | if test -f $ksourcedir/include/linux/netfilter/x_tables.h && \ | |
0f822283 | 639 | $AWK '/^struct xt_action_param /,/^}/' $ksourcedir/include/linux/netfilter/x_tables.h | \ |
1d90b779 JK |
640 | $GREP -q 'struct nf_hook_state '; then |
641 | AC_MSG_RESULT(yes) | |
642 | AC_SUBST(HAVE_STATE_IN_XT_ACTION_PARAM, define) | |
643 | else | |
644 | AC_MSG_RESULT(no) | |
645 | AC_SUBST(HAVE_STATE_IN_XT_ACTION_PARAM, undef) | |
646 | fi | |
647 | ||
648 | AC_MSG_CHECKING([kernel source for xt_family() in x_tables.h]) | |
649 | if test -f $ksourcedir/include/linux/netfilter/x_tables.h && \ | |
650 | $GREP -q 'xt_family' $ksourcedir/include/linux/netfilter/x_tables.h; then | |
651 | AC_MSG_RESULT(yes) | |
652 | AC_SUBST(HAVE_XT_FAMILY, define) | |
653 | else | |
654 | AC_MSG_RESULT(no) | |
655 | AC_SUBST(HAVE_XT_FAMILY, undef) | |
656 | fi | |
657 | ||
658 | AC_MSG_CHECKING([kernel source for xt_net() in x_tables.h]) | |
659 | if test -f $ksourcedir/include/linux/netfilter/x_tables.h && \ | |
660 | $GREP -q 'xt_net' $ksourcedir/include/linux/netfilter/x_tables.h; then | |
661 | AC_MSG_RESULT(yes) | |
662 | AC_SUBST(HAVE_XT_NET, define) | |
663 | else | |
664 | AC_MSG_RESULT(no) | |
665 | AC_SUBST(HAVE_XT_NET, undef) | |
666 | fi | |
667 | ||
4469d05e JK |
668 | AC_MSG_CHECKING([kernel source for nfnl_msg_type() in nfnetlink.h]) |
669 | if test -f $ksourcedir/include/linux/netfilter/nfnetlink.h && \ | |
670 | $GREP -q 'nfnl_msg_type' $ksourcedir/include/linux/netfilter/nfnetlink.h; then | |
671 | AC_MSG_RESULT(yes) | |
672 | AC_SUBST(HAVE_NFNL_MSG_TYPE, define) | |
673 | else | |
674 | AC_MSG_RESULT(no) | |
675 | AC_SUBST(HAVE_NFNL_MSG_TYPE, undef) | |
676 | fi | |
677 | ||
ad62744c JK |
678 | AC_MSG_CHECKING([kernel source for netlink extended ACK]) |
679 | if test -f $ksourcedir/include/linux/netlink.h && \ | |
d2bf2286 | 680 | $AWK '/void netlink_ack\(/,/\)/' $ksourcedir/include/linux/netlink.h | $GREP -q 'const struct netlink_ext_ack'; then |
ad62744c JK |
681 | AC_MSG_RESULT(yes) |
682 | AC_SUBST(HAVE_NETLINK_EXTENDED_ACK, define) | |
683 | else | |
684 | AC_MSG_RESULT(no) | |
685 | AC_SUBST(HAVE_NETLINK_EXTENDED_ACK, undef) | |
686 | fi | |
687 | ||
2c9ec23d | 688 | AC_MSG_CHECKING([kernel source for passing extended ACK struct to parsing functions]) |
d88c5b79 | 689 | if test -f $ksourcedir/include/net/netlink.h && \ |
0f822283 | 690 | $AWK '/^static inline int nla_parse_nested\(/,/\)/' $ksourcedir/include/net/netlink.h | $GREP -q 'struct netlink_ext_ack'; then |
2c9ec23d JK |
691 | AC_MSG_RESULT(yes) |
692 | AC_SUBST(HAVE_PASSING_EXTENDED_ACK_TO_PARSERS, define) | |
693 | else | |
694 | AC_MSG_RESULT(no) | |
695 | AC_SUBST(HAVE_PASSING_EXTENDED_ACK_TO_PARSERS, undef) | |
696 | fi | |
697 | ||
d88c5b79 JK |
698 | AC_MSG_CHECKING([kernel source for passing extended ACK struct to callback functions]) |
699 | if test -f $ksourcedir/include/linux/netfilter/nfnetlink.h && \ | |
0f822283 | 700 | $AWK '/^struct nfnl_callback /,/^}/' $ksourcedir/include/linux/netfilter/nfnetlink.h | $GREP -q 'struct netlink_ext_ack'; then |
d88c5b79 JK |
701 | AC_MSG_RESULT(yes) |
702 | AC_SUBST(HAVE_PASSING_EXTENDED_ACK_TO_CALLBACKS, define) | |
703 | else | |
704 | AC_MSG_RESULT(no) | |
705 | AC_SUBST(HAVE_PASSING_EXTENDED_ACK_TO_CALLBACKS, undef) | |
706 | fi | |
707 | ||
54185b43 JK |
708 | AC_MSG_CHECKING([kernel source for no typedef sctp_sctphdr_t]) |
709 | if test -f $ksourcedir/include/linux/sctp.h && \ | |
710 | $GREP -q '^typedef struct sctphdr' $ksourcedir/include/linux/sctp.h; then | |
711 | AC_MSG_RESULT(yes) | |
712 | AC_SUBST(HAVE_TYPEDEF_SCTP_SCTPHDR_T, define) | |
713 | else | |
714 | AC_MSG_RESULT(no) | |
715 | AC_SUBST(HAVE_TYPEDEF_SCTP_SCTPHDR_T, undef) | |
716 | fi | |
717 | ||
0a81ab50 JK |
718 | AC_MSG_CHECKING([kernel source for timer_setup in timer.h]) |
719 | if test -f $ksourcedir/include/linux/timer.h && \ | |
720 | $GREP -q ' timer_setup' $ksourcedir/include/linux/timer.h; then | |
721 | AC_MSG_RESULT(yes) | |
722 | AC_SUBST(HAVE_TIMER_SETUP, define) | |
723 | else | |
724 | AC_MSG_RESULT(no) | |
725 | AC_SUBST(HAVE_TIMER_SETUP, undef) | |
726 | fi | |
727 | ||
3dcf2f14 JK |
728 | AC_MSG_CHECKING([kernel source for timer_shutdown_sync() in timer.h]) |
729 | if test -f $ksourcedir/include/linux/timer.h && \ | |
730 | $GREP -q ' timer_shutdown_sync' $ksourcedir/include/linux/timer.h; then | |
731 | AC_MSG_RESULT(yes) | |
732 | AC_SUBST(HAVE_TIMER_SHUTDOWN_SYNC, define) | |
733 | else | |
734 | AC_MSG_RESULT(no) | |
735 | AC_SUBST(HAVE_TIMER_SHUTDOWN_SYNC, undef) | |
736 | fi | |
737 | ||
47105aa9 JK |
738 | AC_MSG_CHECKING([kernel source for lockdep_nfnl_is_held() in nfnetlink.h]) |
739 | if test -f $ksourcedir/include/linux/netfilter/nfnetlink.h && \ | |
740 | $GREP -q ' lockdep_nfnl_is_held' $ksourcedir/include/linux/netfilter/nfnetlink.h; then | |
741 | AC_MSG_RESULT(yes) | |
742 | AC_SUBST(HAVE_LOCKDEP_NFNL_IS_HELD, define) | |
743 | else | |
744 | AC_MSG_RESULT(no) | |
745 | AC_SUBST(HAVE_LOCKDEP_NFNL_IS_HELD, undef) | |
746 | fi | |
747 | ||
02811172 JK |
748 | AC_MSG_CHECKING([kernel source for nla_strscpy() in netlink.h]) |
749 | if test -f $ksourcedir/include/net/netlink.h && \ | |
750 | $GREP -q ' nla_strscpy' $ksourcedir/include/net/netlink.h; then | |
751 | AC_MSG_RESULT(yes) | |
752 | AC_SUBST(HAVE_NLA_STRSCPY, define) | |
753 | else | |
754 | AC_MSG_RESULT(no) | |
755 | AC_SUBST(HAVE_NLA_STRSCPY, undef) | |
756 | fi | |
757 | ||
1fb77035 JK |
758 | AC_MSG_CHECKING([kernel source for strscpy() in string.h]) |
759 | if test -f $ksourcedir/include/linux/timer.h && \ | |
760 | $GREP -q ' strscpy' $ksourcedir/include/linux/string.h; then | |
761 | AC_MSG_RESULT(yes) | |
762 | AC_SUBST(HAVE_STRSCPY, define) | |
763 | else | |
764 | AC_MSG_RESULT(no) | |
765 | AC_SUBST(HAVE_STRSCPY, undef) | |
766 | fi | |
767 | ||
540bc5a6 JK |
768 | AC_MSG_CHECKING([kernel source for strscpy_pad() in string.h]) |
769 | if test -f $ksourcedir/include/linux/timer.h && \ | |
770 | $GREP -q ' strscpy_pad' $ksourcedir/include/linux/string.h; then | |
771 | AC_MSG_RESULT(yes) | |
772 | AC_SUBST(HAVE_STRSCPY_PAD, define) | |
773 | else | |
774 | AC_MSG_RESULT(no) | |
775 | AC_SUBST(HAVE_STRSCPY, undef) | |
776 | fi | |
777 | ||
d2bf2286 JK |
778 | AC_MSG_CHECKING([kernel source for synchronize_rcu_bh() in rcutiny.h and rcupdate.h]) |
779 | if test -f $ksourcedir/include/linux/rcupdate.h && \ | |
780 | $GREP -q 'static inline void synchronize_rcu_bh' \ | |
781 | $ksourcedir/include/linux/rcutiny.h $ksourcedir/include/linux/rcupdate.h; then | |
782 | AC_MSG_RESULT(yes) | |
783 | AC_SUBST(HAVE_SYNCHRONIZE_RCU_BH, define) | |
784 | else | |
785 | AC_MSG_RESULT(no) | |
786 | AC_SUBST(HAVE_SYNCHRONIZE_RCU_BH, undef) | |
787 | fi | |
788 | ||
8f1af2e9 JK |
789 | AC_MSG_CHECKING([kernel source for the fourth arg of list_for_each_entry_rcu() in rculist.h]) |
790 | if test -f $ksourcedir/include/linux/rculist.h && \ | |
791 | $GREP -q 'define list_for_each_entry_rcu(pos, head, member, cond' $ksourcedir/include/linux/rculist.h; then | |
792 | AC_MSG_RESULT(yes) | |
793 | AC_SUBST(HAVE_LIST_FOR_EACH_ENTRY_RCU_FOUR_ARGS, define) | |
794 | else | |
795 | AC_MSG_RESULT(no) | |
796 | AC_SUBST(HAVE_LIST_FOR_EACH_ENTRY_RCU_FOUR_ARGS, undef) | |
797 | fi | |
798 | ||
c965c977 JK |
799 | AC_MSG_CHECKING([kernel source for skb_protocol() in if_vlan.h]) |
800 | if test -f $ksourcedir/include/linux/if_vlan.h && \ | |
801 | $GREP -q 'static inline __be16 skb_protocol' $ksourcedir/include/linux/if_vlan.h; then | |
802 | AC_MSG_RESULT(yes) | |
803 | AC_SUBST(HAVE_SKB_PROTOCOL, define) | |
804 | else | |
805 | AC_MSG_RESULT(no) | |
806 | AC_SUBST(HAVE_SKB_PROTOCOL, undef) | |
807 | fi | |
808 | ||
018b075c ED |
809 | AC_MSG_CHECKING([kernel source for NLA_POLICY_EXACT_LEN() in netlink.h]) |
810 | if test -f $ksourcedir/include/net/netlink.h && \ | |
811 | $GREP -q 'define NLA_POLICY_EXACT_LEN' $ksourcedir/include/net/netlink.h; then | |
812 | AC_MSG_RESULT(yes) | |
813 | AC_SUBST(HAVE_NLA_POLICY_EXACT_LEN, define) | |
814 | else | |
815 | AC_MSG_RESULT(no) | |
816 | AC_SUBST(HAVE_NLA_POLICY_EXACT_LEN, undef) | |
817 | fi | |
818 | ||
677895d0 JK |
819 | AC_MSG_CHECKING([kernel source for nfnl_msg_put() in nfnetlink.h]) |
820 | if test -f $ksourcedir/include/linux/netfilter/nfnetlink.h && \ | |
821 | $GREP -q 'nfnl_msg_put' $ksourcedir/include/linux/netfilter/nfnetlink.h; then | |
822 | AC_MSG_RESULT(yes) | |
823 | AC_SUBST(HAVE_NFNL_MSG_PUT, define) | |
824 | else | |
825 | AC_MSG_RESULT(no) | |
826 | AC_SUBST(HAVE_NFNL_MSG_PUT, undef) | |
827 | fi | |
828 | ||
3dda931d JK |
829 | AC_MSG_CHECKING([kernel source for struct nfnl_info in nfnl_callback function]) |
830 | if test -f $ksourcedir/include/linux/netfilter/nfnetlink.h && \ | |
831 | $AWK '/^struct nfnl_callback /,/^}/' $ksourcedir/include/linux/netfilter/nfnetlink.h | $GREP -q 'struct nfnl_info'; then | |
832 | AC_MSG_RESULT(yes) | |
833 | AC_SUBST(HAVE_NFNL_INFO_IN_NFNL_CALLBACK, define) | |
834 | else | |
835 | AC_MSG_RESULT(no) | |
836 | AC_SUBST(HAVE_NFNL_INFO_IN_NFNL_CALLBACK, undef) | |
837 | fi | |
838 | ||
039125a8 JK |
839 | AC_MSG_CHECKING([kernel source for enum nfnl_callback_type]) |
840 | if test -f $ksourcedir/include/linux/netfilter/nfnetlink.h && \ | |
841 | $GREP -q 'enum nfnl_callback_type ' $ksourcedir/include/linux/netfilter/nfnetlink.h; then | |
842 | AC_MSG_RESULT(yes) | |
843 | AC_SUBST(HAVE_NFNL_CALLBACK_TYPE, define) | |
844 | else | |
845 | AC_MSG_RESULT(no) | |
846 | AC_SUBST(HAVE_NFNL_CALLBACK_TYPE, undef) | |
847 | fi | |
848 | ||
55923f52 JK |
849 | AC_MSG_CHECKING([kernel source of handling -EAGAIN in nfnetlink_unicast]) |
850 | if test -f $ksourcedir/net/netfilter/nfnetlink.c && \ | |
851 | $AWK '/nfnetlink_unicast\(/,/^}/' $ksourcedir/net/netfilter/nfnetlink.c | $GREP -q 'err == -EAGAIN'; then | |
852 | AC_MSG_RESULT(yes) | |
853 | AC_SUBST(HAVE_EAGAIN_IN_NFNETLINK_UNICAST, define) | |
854 | else | |
855 | AC_MSG_RESULT(no) | |
856 | AC_SUBST(HAVE_EAGAIN_IN_NFNETLINK_UNICAST, undef) | |
857 | fi | |
858 | ||
859 | AC_MSG_CHECKING([kernel source for nlmsg_unicast which returns zero in case of success]) | |
860 | if test -f $ksourcedir/include/net/netlink.h && \ | |
861 | $AWK '/static inline int nlmsg_unicast\(/,/^}/' $ksourcedir/include/net/netlink.h | $GREP -q 'err > 0'; then | |
862 | AC_MSG_RESULT(yes) | |
863 | AC_SUBST(HAVE_NLMSG_UNICAST, define) | |
864 | else | |
865 | AC_MSG_RESULT(no) | |
866 | AC_SUBST(HAVE_NLMSG_UNICAST, undef) | |
867 | fi | |
868 | ||
b0a56bb1 | 869 | AC_MSG_CHECKING([kernel source for kvzalloc() in mm.h and slab.h]) |
04f17089 JK |
870 | if test -f $ksourcedir/include/linux/mm.h && \ |
871 | $GREP -q 'static inline void \*kvzalloc(' $ksourcedir/include/linux/mm.h; then | |
872 | AC_MSG_RESULT(yes) | |
873 | AC_SUBST(HAVE_KVZALLOC, define) | |
b0a56bb1 JK |
874 | elif test -f $ksourcedir/include/linux/slab.h && \ |
875 | $GREP -q 'kvzalloc' $ksourcedir/include/linux/slab.h; then | |
876 | AC_MSG_RESULT(yes) | |
877 | AC_SUBST(HAVE_KVZALLOC, define) | |
04f17089 JK |
878 | else |
879 | AC_MSG_RESULT(no) | |
880 | AC_SUBST(HAVE_KVZALLOC, undef) | |
881 | fi | |
882 | ||
883 | AC_MSG_CHECKING([kernel source for GFP_KERNEL_ACCOUNT in gfp.h]) | |
884 | if test -f $ksourcedir/include/linux/gfp.h && \ | |
885 | $GREP -q 'define GFP_KERNEL_ACCOUNT' $ksourcedir/include/linux/gfp.h; then | |
886 | AC_MSG_RESULT(yes) | |
887 | AC_SUBST(HAVE_GFP_KERNEL_ACCOUNT, define) | |
888 | else | |
889 | AC_MSG_RESULT(no) | |
890 | AC_SUBST(HAVE_GFP_KERNEL_ACCOUNT, undef) | |
891 | fi | |
892 | ||
8a82b39e JK |
893 | AC_MSG_CHECKING([kernel source for struct net_generic]) |
894 | if test -f $ksourcedir/include/net/netns/generic.h && \ | |
895 | $GREP -q 'struct net_generic' $ksourcedir/include/net/netns/generic.h; then | |
896 | AC_MSG_RESULT(yes) | |
897 | else | |
898 | AC_MSG_RESULT(no) | |
899 | AC_MSG_ERROR([Netns support is required in the Linux kernel tree]) | |
900 | fi | |
a76488a8 | 901 | fi |
8a82b39e JK |
902 | |
903 | dnl Checks for compiler characteristics. | |
c35dbd0a JK |
904 | dnl Check extra warning flags except |
905 | dnl -Wconversion -> we need it | |
906 | dnl -Wunreachable-code -> fails with ntoh* | |
907 | dnl -Wpointer-arith -> limbnl uses it | |
633aaaf0 | 908 | dnl -Wsign-conversion -> libmnl |
5039472d JK |
909 | if test "x$enable_debug" = "xyes" |
910 | then | |
c35dbd0a JK |
911 | AX_CFLAGS_GCC_OPTION(-Waggregate-return) |
912 | AX_CFLAGS_GCC_OPTION(-Wbad-function-cast) | |
913 | AX_CFLAGS_GCC_OPTION(-Wcast-align) | |
914 | AX_CFLAGS_GCC_OPTION(-Wcast-qual) | |
915 | AX_CFLAGS_GCC_OPTION(-Werror) | |
916 | AX_CFLAGS_GCC_OPTION(-Wextra) | |
917 | AX_CFLAGS_GCC_OPTION(-Wfloat-equal) | |
918 | AX_CFLAGS_GCC_OPTION(-Wformat=2) | |
633aaaf0 | 919 | AX_CFLAGS_GCC_OPTION(-Wjump-misses-init) |
c35dbd0a JK |
920 | AX_CFLAGS_GCC_OPTION(-Winit-self) |
921 | AX_CFLAGS_GCC_OPTION(-Winline) | |
633aaaf0 | 922 | AX_CFLAGS_GCC_OPTION(-Wlogical-op) |
c35dbd0a JK |
923 | AX_CFLAGS_GCC_OPTION(-Wmissing-declarations) |
924 | AX_CFLAGS_GCC_OPTION(-Wmissing-format-attribute) | |
925 | AX_CFLAGS_GCC_OPTION(-Wmissing-prototypes) | |
926 | AX_CFLAGS_GCC_OPTION(-Wnested-externs) | |
927 | AX_CFLAGS_GCC_OPTION(-Wno-missing-field-initializers) | |
633aaaf0 | 928 | AX_CFLAGS_GCC_OPTION(-Wold-style-definition) |
c35dbd0a JK |
929 | AX_CFLAGS_GCC_OPTION(-Woverlength-strings) |
930 | AX_CFLAGS_GCC_OPTION(-Wpacked) | |
931 | AX_CFLAGS_GCC_OPTION(-Wredundant-decls) | |
633aaaf0 | 932 | AX_CFLAGS_GCC_OPTION(-Wrwrite-strings) |
c35dbd0a JK |
933 | AX_CFLAGS_GCC_OPTION(-Wshadow) |
934 | AX_CFLAGS_GCC_OPTION(-Wsign-compare) | |
935 | AX_CFLAGS_GCC_OPTION(-Wstrict-prototypes) | |
936 | AX_CFLAGS_GCC_OPTION(-Wswitch-default) | |
937 | AX_CFLAGS_GCC_OPTION(-Wundef) | |
633aaaf0 | 938 | AX_CFLAGS_GCC_OPTION(-Wuninitialized) |
c35dbd0a | 939 | AX_CFLAGS_GCC_OPTION(-Wunused) |
633aaaf0 | 940 | AX_CFLAGS_GCC_OPTION(-Wvla) |
c35dbd0a | 941 | AX_CFLAGS_GCC_OPTION(-Wwrite-strings) |
5039472d | 942 | fi |
62f71e22 JK |
943 | dnl Checks for library functions. |
944 | ||
945 | dnl Generate output | |
22411e0b | 946 | AC_CONFIG_FILES([Makefile include/libipset/Makefile |
3b094130 | 947 | lib/Makefile lib/libipset.pc src/Makefile utils/Makefile |
8cdb9e6b JK |
948 | kernel/include/linux/netfilter/ipset/ip_set_compat.h |
949 | kernel/include/linux/netfilter/ipset/ip_set_compiler.h]) | |
62f71e22 | 950 | AC_OUTPUT |
69019ebd JK |
951 | |
952 | dnl Summary | |
953 | AC_MSG_RESULT([]) | |
954 | AC_MSG_RESULT([$PACKAGE userspace tool configuration:]) | |
3b094130 MF |
955 | if test "x$bashcompdir" != "x"; then |
956 | AC_MSG_RESULT([ Bash completion directory: ${bashcompdir}]) | |
957 | fi | |
69019ebd JK |
958 | if test "x$enable_settype_modules" != "xyes"; then |
959 | AC_MSG_RESULT([ Dynamic module loading: disabled]) | |
960 | else | |
961 | AC_MSG_RESULT([ Dynamic module loading: enabled]) | |
962 | fi | |
1c67aca4 | 963 | IPSET_ALL_MODULES="`ls ${srcdir}/lib/ipset_*.c|sed -e 's/^.*lib\///' -e 's/\.c$//'`" |
69019ebd JK |
964 | AC_MSG_RESULT([ Static modules:]) |
965 | if test "x$SETTYPE_MODLIST" = "x"; then | |
966 | for mod in $IPSET_ALL_MODULES; do | |
967 | AC_MSG_RESULT([ ${mod}]) | |
968 | done | |
969 | AC_MSG_RESULT([ Dynamic modules:]) | |
970 | elif echo $SETTYPE_MODLIST | grep "all" >/dev/null; then | |
971 | AC_MSG_RESULT([ Dynamic modules:]) | |
972 | for mod in $IPSET_ALL_MODULES; do | |
973 | AC_MSG_RESULT([ ${mod}]) | |
974 | done | |
975 | else | |
976 | for mod in $IPSET_ALL_MODULES; do | |
4dcf37de | 977 | if echo $SETTYPE_MODLIST | grep -w "$mod" >/dev/null; then |
69019ebd JK |
978 | : |
979 | else | |
980 | AC_MSG_RESULT([ ${mod}]) | |
981 | fi | |
982 | done | |
983 | AC_MSG_RESULT([ Dynamic modules:]) | |
984 | for mod in $IPSET_ALL_MODULES; do | |
4dcf37de | 985 | if echo $SETTYPE_MODLIST | grep -w "$mod" >/dev/null; then |
69019ebd JK |
986 | AC_MSG_RESULT([ ${mod}]) |
987 | fi | |
988 | done | |
989 | fi |