blob: ea91719b2e7f102d51bf2146713873d944c4b211 [file] [log] [blame]
osdl.net!shemminger449bf1f2004-06-25 21:14:22 +00001#! /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
osdl.net!shemminger6202b4c2004-07-01 22:22:10 +000016echo -n " netem scheduler... "
osdl.net!shemminger2979d522004-07-30 20:24:59 +000017cat >/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
osdl.net!shemmingerc830d772004-07-02 17:47:53 +000028 echo "TC_CONFIG_NETEM:=y" >>Config
osdl.net!shemminger449bf1f2004-06-25 21:14:22 +000029 echo y
30else
31 echo n
32fi
osdl.net!shemminger2979d522004-07-30 20:24:59 +000033rm -f /tmp/netemtest.c /tmp/netemtest.o
osdl.net!shemminger449bf1f2004-06-25 21:14:22 +000034
35echo -n " ATM... "
osdl.net!shemmingerc830d772004-07-02 17:47:53 +000036cat >/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
osdl.net!shemminger2979d522004-07-30 20:24:59 +000044gcc -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1
osdl.net!shemmingerc830d772004-07-02 17:47:53 +000045if [ $? -eq 0 ]
osdl.net!shemminger449bf1f2004-06-25 21:14:22 +000046then
osdl.net!shemmingerc830d772004-07-02 17:47:53 +000047 echo "TC_CONFIG_ATM:=y" >>Config
osdl.net!shemminger449bf1f2004-06-25 21:14:22 +000048 echo y
49else
50 echo n
51fi
osdl.net!shemminger2979d522004-07-30 20:24:59 +000052rm -f /tmp/atmtest.c /tmp/atmtest
osdl.net!shemminger449bf1f2004-06-25 21:14:22 +000053
54# See if we know about TCP Vegas
55echo "SS"
56echo -n " TCP Vegas... "
57if grep -q TCPDIAG_VEGASINFO $INCLUDE/linux/tcp_diag.h
58then
osdl.net!shemmingerc830d772004-07-02 17:47:53 +000059 echo "SS_CONFIG_VEGAS:=y" >>Config
osdl.net!shemminger449bf1f2004-06-25 21:14:22 +000060 echo y
61else
62 echo n
63fi
64
65echo -n " TCP DRS... "
66if grep -q tcpi_rcv_space $INCLUDE/linux/tcp.h
67then
osdl.net!shemmingerc830d772004-07-02 17:47:53 +000068 echo "SS_CONFIG_DRS:=y" >>Config
osdl.net!shemminger449bf1f2004-06-25 21:14:22 +000069 echo y
70else
71 echo n
72fi
73
74