]>
Commit | Line | Data |
---|---|---|
449bf1f3 SH |
1 | #! /bin/bash |
2 | # This is not an autconf generated configure | |
3 | # | |
4b1bbd9c | 4 | INCLUDE=${1:-"$PWD/include"} |
449bf1f3 SH |
5 | |
6 | echo "# Generated config based on" $INCLUDE >Config | |
7 | ||
b9cb1c9a | 8 | echo "TC schedulers" |
449bf1f3 | 9 | |
b9cb1c9a | 10 | echo -n " ATM " |
c830d77b SH |
11 | cat >/tmp/atmtest.c <<EOF |
12 | #include <atm.h> | |
13 | int 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 | } | |
18 | EOF | |
2979d52f | 19 | gcc -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1 |
c830d77b | 20 | if [ $? -eq 0 ] |
449bf1f3 | 21 | then |
c830d77b | 22 | echo "TC_CONFIG_ATM:=y" >>Config |
b9cb1c9a | 23 | echo yes |
449bf1f3 | 24 | else |
b9cb1c9a | 25 | echo no |
449bf1f3 | 26 | fi |
2979d52f | 27 | rm -f /tmp/atmtest.c /tmp/atmtest |
63c7d26f JHS |
28 | |
29 | echo -n " IPT " | |
30 | ||
a36ceb85 AH |
31 | #check if we have xtables from iptables >= 1.4.5. |
32 | cat >/tmp/ipttest.c <<EOF | |
33 | #include <xtables.h> | |
34 | #include <linux/netfilter.h> | |
35 | static struct xtables_globals test_globals = { | |
36 | .option_offset = 0, | |
37 | .program_name = "tc-ipt", | |
38 | .program_version = XTABLES_VERSION, | |
39 | .orig_opts = NULL, | |
40 | .opts = NULL, | |
41 | .exit_err = NULL, | |
42 | }; | |
43 | ||
44 | int main(int argc, char **argv) | |
45 | { | |
46 | xtables_init_all(&test_globals, NFPROTO_IPV4); | |
47 | return 0; | |
48 | } | |
49 | ||
50 | EOF | |
51 | ||
52 | if gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl -lxtables >/dev/null 2>&1 | |
53 | then | |
54 | echo "TC_CONFIG_XT:=y" >>Config | |
55 | echo "using xtables instead of iptables" | |
56 | fi | |
57 | ||
63c7d26f JHS |
58 | #check if we need dont our internal header .. |
59 | cat >/tmp/ipttest.c <<EOF | |
60 | #include <xtables.h> | |
61 | char *lib_dir; | |
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_", | |
67 | }; | |
68 | ||
69 | void exit_error(enum exittype status, const char *msg, ...) | |
70 | { | |
71 | } | |
72 | ||
73 | int main(int argc, char **argv) { | |
74 | ||
75 | return 0; | |
76 | } | |
77 | ||
78 | EOF | |
79 | gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1 | |
80 | ||
81 | if [ $? -eq 0 ] | |
82 | then | |
80d689d0 | 83 | echo "TC_CONFIG_XT_OLD:=y" >>Config |
63c7d26f JHS |
84 | echo "using xtables seems no need for internal.h" |
85 | else | |
86 | echo "failed test 2" | |
87 | fi | |
88 | ||
89 | #check if we need our own internal.h | |
90 | cat >/tmp/ipttest.c <<EOF | |
91 | #include <xtables.h> | |
92 | #include "xt-internal.h" | |
93 | char *lib_dir; | |
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_", | |
99 | }; | |
100 | ||
101 | void exit_error(enum exittype status, const char *msg, ...) | |
102 | { | |
103 | } | |
104 | ||
105 | int main(int argc, char **argv) { | |
106 | ||
107 | return 0; | |
108 | } | |
109 | ||
110 | EOF | |
111 | gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1 | |
112 | ||
113 | if [ $? -eq 0 ] | |
114 | then | |
115 | echo "using xtables instead of iptables (need for internal.h)" | |
80d689d0 | 116 | echo "TC_CONFIG_XT_OLD_H:=y" >>Config |
63c7d26f JHS |
117 | |
118 | else | |
119 | echo "failed test 3 using iptables" | |
120 | fi | |
121 | rm -f /tmp/ipttest.c /tmp/ipttest |