]> git.proxmox.com Git - mirror_iproute2.git/blame - configure
Test for HTB version match
[mirror_iproute2.git] / configure
CommitLineData
449bf1f3
SH
1#! /bin/bash
2# This is not an autconf generated configure
3#
4INCLUDE=${1:-"/usr/include"}
5
6echo "# Generated config based on" $INCLUDE >Config
7
8echo "TC"
9PKT_SCHED=$INCLUDE/linux/pkt_sched.h
10if [ ! -r $PKT_SCHED ];
11then
12 echo " can't find file" $PKT_SCHED
13 exit 1
14fi
15
6202b4c1 16echo -n " netem scheduler... "
2979d52f
SH
17cat >/tmp/netemtest.c <<EOF
18#include <asm/types.h>
19#include <linux/pkt_sched.h>
20int main(int argc, char **argv) {
21 static struct tc_netem_qopt qopt;
22 exit(qopt.latency | qopt.limit | qopt.loss | qopt.gap | qopt.duplicate | qopt.jitter);
23}
24EOF
25gcc -I$INCLUDE -c /tmp/netemtest.c >/dev/null 2>&1
26if [ $? -eq 0 ]
27then
c830d77b 28 echo "TC_CONFIG_NETEM:=y" >>Config
449bf1f3
SH
29 echo y
30else
31 echo n
32fi
2979d52f 33rm -f /tmp/netemtest.c /tmp/netemtest.o
449bf1f3
SH
34
35echo -n " ATM... "
c830d77b
SH
36cat >/tmp/atmtest.c <<EOF
37#include <atm.h>
38int main(int argc, char **argv) {
39 struct atm_qos qos;
40 (void) text2qos("aal5,ubr:sdu=9180,rx:none",&qos,0);
41 return 0;
42}
43EOF
2979d52f 44gcc -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1
c830d77b 45if [ $? -eq 0 ]
449bf1f3 46then
c830d77b 47 echo "TC_CONFIG_ATM:=y" >>Config
449bf1f3
SH
48 echo y
49else
50 echo n
51fi
2979d52f 52rm -f /tmp/atmtest.c /tmp/atmtest
449bf1f3 53
3876b3c3
SH
54echo -n " HTB... "
55DEF_HTB=`grep '^#define HTB_TC_VER' tc/q_htb.c`
56cat >/tmp/htbtest.c <<EOF
57#include <stdio.h>
58#include <asm/types.h>
59#include <linux/pkt_sched.h>
60$DEF_HTB
61int main(int argc, char **argv) {
62 if (HTB_TC_VER >>16 != TC_HTB_PROTOVER) {
63 fprintf(stderr, "different kernel and TC HTB versions\n");
64 return 1;
65 }
66 return 0;
67}
68EOF
69gcc -I$INCLUDE -o /tmp/htbtest /tmp/htbtest.c
70if [ $? -eq 0 -a /tmp/htbtest ]
71then
72 echo "TC_CONFIG_HTB:=y" >>Config
73 echo y
74else
75 echo n
76fi
77rm -f /tmp/htbtest /tmp/htbtest.c
78
449bf1f3
SH
79# See if we know about TCP Vegas
80echo "SS"
81echo -n " TCP Vegas... "
3876b3c3 82if grep -q TCPDIAG_VEGASINFO $INCLUDE/linux/tcp_diag.h >/dev/null 2>&1
449bf1f3 83then
c830d77b 84 echo "SS_CONFIG_VEGAS:=y" >>Config
449bf1f3
SH
85 echo y
86else
87 echo n
88fi
89
90echo -n " TCP DRS... "
91if grep -q tcpi_rcv_space $INCLUDE/linux/tcp.h
92then
c830d77b 93 echo "SS_CONFIG_DRS:=y" >>Config
449bf1f3
SH
94 echo y
95else
96 echo n
97fi
98
99