2 # This is not an autconf generated configure
4 INCLUDE=${1:-"$PWD/include"}
6 echo "# Generated config based on" $INCLUDE >Config
11 cat >/tmp/atmtest.c <<EOF
13 int main(int argc, char **argv) {
15 (void) text2qos("aal5,ubr:sdu=9180,rx:none",&qos,0);
19 gcc -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1
22 echo "TC_CONFIG_ATM:=y" >>Config
27 rm -f /tmp/atmtest.c /tmp/atmtest
31 #check if we have xtables from iptables >= 1.4.5.
32 cat >/tmp/ipttest.c <<EOF
34 #include <linux/netfilter.h>
35 static struct xtables_globals test_globals = {
37 .program_name = "tc-ipt",
38 .program_version = XTABLES_VERSION,
44 int main(int argc, char **argv)
46 xtables_init_all(&test_globals, NFPROTO_IPV4);
52 if gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl -lxtables >/dev/null 2>&1
54 echo "TC_CONFIG_XT:=y" >>Config
55 echo "using xtables instead of iptables"
58 #check if we need dont our internal header ..
59 cat >/tmp/ipttest.c <<EOF
62 unsigned int global_option_offset = 0;
63 const char *program_version = XTABLES_VERSION;
64 const char *program_name = "tc-ipt";
65 struct afinfo afinfo = {
66 .libprefix = "libxt_",
69 void exit_error(enum exittype status, const char *msg, ...)
73 int main(int argc, char **argv) {
79 gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
83 echo "TC_CONFIG_XT_OLD:=y" >>Config
84 echo "using xtables seems no need for internal.h"
89 #check if we need our own internal.h
90 cat >/tmp/ipttest.c <<EOF
92 #include "xt-internal.h"
94 unsigned int global_option_offset = 0;
95 const char *program_version = XTABLES_VERSION;
96 const char *program_name = "tc-ipt";
97 struct afinfo afinfo = {
98 .libprefix = "libxt_",
101 void exit_error(enum exittype status, const char *msg, ...)
105 int main(int argc, char **argv) {
111 gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
115 echo "using xtables instead of iptables (need for internal.h)"
116 echo "TC_CONFIG_XT_OLD_H:=y" >>Config
119 echo "failed test 3 using iptables"
121 rm -f /tmp/ipttest.c /tmp/ipttest