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
|
AC_INIT(conntrack-tools, 0.9.11, pablo@netfilter.org)
AC_CANONICAL_SYSTEM
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall])
AC_PROG_CC
AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
AM_PROG_LEX
AC_PROG_YACC
case $target in
*-*-linux*) ;;
*) AC_MSG_ERROR([Linux only, dude!]);;
esac
dnl Dependencies
LIBNFNETLINK_REQUIRED=0.0.40
LIBNETFILTER_CONNTRACK_REQUIRED=0.0.99
AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
if test "x$HAVE_PKG_CONFIG" = "x"
then
echo "*** Error: No suitable pkg-config found. ***"
echo " Please install the 'pkg-config' package."
exit 1
fi
PKG_CHECK_MODULES(LIBNFNETLINK, libnfnetlink >= $LIBNFNETLINK_REQUIRED,,
AC_MSG_ERROR(Cannot find libnfnetlink >= $LIBNFNETLINK_REQUIRED))
PKG_CHECK_MODULES(LIBNETFILTER_CONNTRACK, libnetfilter_conntrack >= $LIBNETFILTER_CONNTRACK_REQUIRED,,
AC_MSG_ERROR(Cannot find libnetfilter_conntrack >= $LIBNETFILTER_CONNTRACK_REQUIRED))
AC_CHECK_PROGS(XYACC,$YACC bison yacc,none)
if test "$XYACC" = "none"
then
echo "*** Error: No suitable bison/yacc found. ***"
echo " Please install the 'bison' package."
exit 1
fi
AC_CHECK_PROGS(XLEX,$LEX flex lex,none)
if test "$XLEX" = "none"
then
echo "*** Error: No suitable flex/lex found. ***"
echo " Please install the 'flex' package."
exit 1
fi
AC_MSG_CHECKING(flex version)
flex_version=`$LEX --version | sed 's/version//g' | awk '/flex/ {print $2}'`
flex_major=`echo $flex_version| cut -d . -f 1`
flex_minor=`echo $flex_version| cut -d . -f 2`
flex_rev=`echo $flex_version| cut -d . -f 3`
if test "$flex_major" -eq "2" && test "$flex_minor" -eq "5" && test "$flex_rev" -ge "33"; then
AC_MSG_RESULT([$flex_version. OK])
else
AC_MSG_WARN([flex version $flex_version found.
Version 2.5.33 or greater is required. You may experience problems
while compilating the conntrack-tools. Please, consider to upgrade
flex.])
fi
AC_CHECK_HEADERS([linux/capability.h],, [AC_MSG_ERROR([Cannot find linux/capabibility.h])])
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lc':
dnl AC_CHECK_LIB([c], [main])
# FIXME: Replace `main' with a function in `-ldl':
AC_CHECK_LIB([nfnetlink], [nfnl_query] ,,,[-lnfnetlink])
AC_CHECK_LIB([netfilter_conntrack], [nfct_query] ,,,[-lnetfilter_conntrack])
AC_CHECK_HEADERS(arpa/inet.h)
dnl check for inet_pton
AC_CHECK_FUNCS(inet_pton)
dnl Some systems have it, but not IPv6
if test "$ac_cv_func_inet_pton" = "yes" ; then
AC_MSG_CHECKING(if inet_pton supports IPv6)
AC_TRY_RUN(
[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
int main()
{
struct in6_addr addr6;
if (inet_pton(AF_INET6, "::1", &addr6) < 1)
exit(1);
else
exit(0);
}
], [ AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(HAVE_INET_PTON_IPV6, 1, [Define to 1 if inet_pton supports IPv6.])
], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
fi
# Checks for header files.
dnl AC_HEADER_STDC
dnl AC_CHECK_HEADERS([netinet/in.h stdlib.h])
# Checks for typedefs, structures, and compiler characteristics.
dnl AC_C_CONST
dnl AC_C_INLINE
# Checks for library functions.
dnl AC_FUNC_MALLOC
dnl AC_FUNC_VPRINTF
dnl AC_CHECK_FUNCS([memset])
dnl AC_CONFIG_FILES([Makefile
dnl debug/Makefile
dnl debug/src/Makefile
dnl extensions/Makefile
dnl src/Makefile])
CFLAGS="$CFLAGS $LIBNETFILTER_CONNTRACK_CFLAGS"
AC_SUBST(LIBNETFILTER_CONNTRACK_LIBS)
AC_CONFIG_FILES([Makefile src/Makefile include/Makefile extensions/Makefile])
AC_OUTPUT
|