2 # This is not an autconf generated configure
4 INCLUDE=${1:-"$PWD/include"}
10 cat >/tmp/atmtest.c <<EOF
12 int main(int argc, char **argv) {
14 (void) text2qos("aal5,ubr:sdu=9180,rx:none",&qos,0);
18 gcc -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1
21 echo "TC_CONFIG_ATM:=y" >>Config
26 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
57 rm -f /tmp/ipttest.c /tmp/ipttest
62 # bail if previous XT checks has already succeded.
63 if grep TC_CONFIG_XT Config > /dev/null
68 #check if we dont need our internal header ..
69 cat >/tmp/ipttest.c <<EOF
72 unsigned int global_option_offset = 0;
73 const char *program_version = XTABLES_VERSION;
74 const char *program_name = "tc-ipt";
75 struct afinfo afinfo = {
76 .libprefix = "libxt_",
79 void exit_error(enum exittype status, const char *msg, ...)
83 int main(int argc, char **argv) {
89 gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
93 echo "TC_CONFIG_XT_OLD:=y" >>Config
94 echo "using old xtables (no need for xt-internal.h)"
96 rm -f /tmp/ipttest.c /tmp/ipttest
99 check_xt_old_internal_h()
101 # bail if previous XT checks has already succeded.
102 if grep TC_CONFIG_XT Config > /dev/null
107 #check if we need our own internal.h
108 cat >/tmp/ipttest.c <<EOF
110 #include "xt-internal.h"
112 unsigned int global_option_offset = 0;
113 const char *program_version = XTABLES_VERSION;
114 const char *program_name = "tc-ipt";
115 struct afinfo afinfo = {
116 .libprefix = "libxt_",
119 void exit_error(enum exittype status, const char *msg, ...)
123 int main(int argc, char **argv) {
129 gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
133 echo "using old xtables with xt-internal.h"
134 echo "TC_CONFIG_XT_OLD_H:=y" >>Config
136 rm -f /tmp/ipttest.c /tmp/ipttest
141 if ! grep TC_CONFIG_XT Config > /dev/null
143 echo "using iptables"
153 for dir in /lib /usr/lib /usr/local/lib
155 for file in $dir/$TABLES/lib*t_*so ; do
156 if [ -f $file ]; then
158 echo "IPT_LIB_DIR:=$dir/$TABLES" >> Config
166 echo "# Generated config based on" $INCLUDE >Config
176 check_xt_old_internal_h
179 echo -n "iptables modules directory: "