]> git.proxmox.com Git - mirror_iproute2.git/blame - configure
Breakage noticed when debian upgraded to xtables (iptables > 1.4.1)
[mirror_iproute2.git] / configure
CommitLineData
449bf1f3
SH
1#! /bin/bash
2# This is not an autconf generated configure
3#
4b1bbd9c 4INCLUDE=${1:-"$PWD/include"}
449bf1f3
SH
5
6echo "# Generated config based on" $INCLUDE >Config
7
b9cb1c9a 8echo "TC schedulers"
449bf1f3 9
b9cb1c9a 10echo -n " ATM "
c830d77b
SH
11cat >/tmp/atmtest.c <<EOF
12#include <atm.h>
13int main(int argc, char **argv) {
14 struct atm_qos qos;
15 (void) text2qos("aal5,ubr:sdu=9180,rx:none",&qos,0);
16 return 0;
17}
18EOF
2979d52f 19gcc -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1
c830d77b 20if [ $? -eq 0 ]
449bf1f3 21then
c830d77b 22 echo "TC_CONFIG_ATM:=y" >>Config
b9cb1c9a 23 echo yes
449bf1f3 24else
b9cb1c9a 25 echo no
449bf1f3 26fi
2979d52f 27rm -f /tmp/atmtest.c /tmp/atmtest
63c7d26f
JHS
28
29echo -n " IPT "
30
31#check if we need dont our internal header ..
32cat >/tmp/ipttest.c <<EOF
33#include <xtables.h>
34char *lib_dir;
35unsigned int global_option_offset = 0;
36const char *program_version = XTABLES_VERSION;
37const char *program_name = "tc-ipt";
38struct afinfo afinfo = {
39 .libprefix = "libxt_",
40};
41
42void exit_error(enum exittype status, const char *msg, ...)
43{
44}
45
46int main(int argc, char **argv) {
47
48 return 0;
49}
50
51EOF
52gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
53
54if [ $? -eq 0 ]
55then
56 echo "TC_CONFIG_XT:=y" >>Config
57 echo "using xtables seems no need for internal.h"
58else
59 echo "failed test 2"
60fi
61
62#check if we need our own internal.h
63cat >/tmp/ipttest.c <<EOF
64#include <xtables.h>
65#include "xt-internal.h"
66char *lib_dir;
67unsigned int global_option_offset = 0;
68const char *program_version = XTABLES_VERSION;
69const char *program_name = "tc-ipt";
70struct afinfo afinfo = {
71 .libprefix = "libxt_",
72};
73
74void exit_error(enum exittype status, const char *msg, ...)
75{
76}
77
78int main(int argc, char **argv) {
79
80 return 0;
81}
82
83EOF
84gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
85
86if [ $? -eq 0 ]
87then
88 echo "using xtables instead of iptables (need for internal.h)"
89 echo "TC_CONFIG_XT_H:=y" >>Config
90
91else
92 echo "failed test 3 using iptables"
93fi
94rm -f /tmp/ipttest.c /tmp/ipttest