]>
git.proxmox.com Git - mirror_iproute2.git/blob - configure
2 # This is not an autconf generated configure
4 INCLUDE
=${1:-"$PWD/include"}
8 cat >/tmp
/atmtest.c
<<EOF
10 int main(int argc, char **argv) {
12 (void) text2qos("aal5,ubr:sdu=9180,rx:none",&qos,0);
16 gcc
-I$INCLUDE -o /tmp
/atmtest
/tmp
/atmtest.c
-latm >/dev
/null
2>&1
19 echo "TC_CONFIG_ATM:=y" >>Config
24 rm -f /tmp
/atmtest.c
/tmp
/atmtest
29 #check if we have xtables from iptables >= 1.4.5.
30 cat >/tmp
/ipttest.c
<<EOF
32 #include <linux/netfilter.h>
33 static struct xtables_globals test_globals = {
35 .program_name = "tc-ipt",
36 .program_version = XTABLES_VERSION,
42 int main(int argc, char **argv)
44 xtables_init_all(&test_globals, NFPROTO_IPV4);
50 if gcc
-I$INCLUDE $IPTC -o /tmp
/ipttest
/tmp
/ipttest.c
$IPTL $
(pkg-config xtables
--cflags --libs) -ldl >/dev
/null
2>&1
52 echo "TC_CONFIG_XT:=y" >>Config
55 rm -f /tmp
/ipttest.c
/tmp
/ipttest
60 # bail if previous XT checks has already succeded.
61 if grep TC_CONFIG_XT Config
> /dev
/null
66 #check if we dont need our internal header ..
67 cat >/tmp
/ipttest.c
<<EOF
70 unsigned int global_option_offset = 0;
71 const char *program_version = XTABLES_VERSION;
72 const char *program_name = "tc-ipt";
73 struct afinfo afinfo = {
74 .libprefix = "libxt_",
77 void exit_error(enum exittype status, const char *msg, ...)
81 int main(int argc, char **argv) {
87 gcc
-I$INCLUDE $IPTC -o /tmp
/ipttest
/tmp
/ipttest.c
$IPTL -ldl >/dev
/null
2>&1
91 echo "TC_CONFIG_XT_OLD:=y" >>Config
92 echo "using old xtables (no need for xt-internal.h)"
94 rm -f /tmp
/ipttest.c
/tmp
/ipttest
97 check_xt_old_internal_h
()
99 # bail if previous XT checks has already succeded.
100 if grep TC_CONFIG_XT Config
> /dev
/null
105 #check if we need our own internal.h
106 cat >/tmp
/ipttest.c
<<EOF
108 #include "xt-internal.h"
110 unsigned int global_option_offset = 0;
111 const char *program_version = XTABLES_VERSION;
112 const char *program_name = "tc-ipt";
113 struct afinfo afinfo = {
114 .libprefix = "libxt_",
117 void exit_error(enum exittype status, const char *msg, ...)
121 int main(int argc, char **argv) {
127 gcc
-I$INCLUDE $IPTC -o /tmp
/ipttest
/tmp
/ipttest.c
$IPTL -ldl >/dev
/null
2>&1
131 echo "using old xtables with xt-internal.h"
132 echo "TC_CONFIG_XT_OLD_H:=y" >>Config
134 rm -f /tmp
/ipttest.c
/tmp
/ipttest
139 if ! grep TC_CONFIG_XT Config
> /dev
/null
141 echo "using iptables"
148 for dir
in /lib
/usr
/lib
/usr
/local
/lib
150 for file in $dir/{xtables
,iptables
}/lib
*t_
*so
; do
151 if [ -f $file ]; then
153 echo "IPT_LIB_DIR:=${file%/*}" >> Config
163 cat >/tmp
/setnstest.c
<<EOF
165 int main(int argc, char **argv)
171 gcc
-I$INCLUDE -o /tmp
/setnstest
/tmp
/setnstest.c
>/dev
/null
2>&1
174 echo "IP_CONFIG_SETNS:=y" >>Config
179 rm -f /tmp
/setnstest.c
/tmp
/setnstest
182 echo "# Generated config based on" $INCLUDE >Config
192 check_xt_old_internal_h
195 echo -n "iptables modules directory: "
198 echo -n "libc has setns: "