2 # written 2012-2013 by David Lamparter, placed in Public Domain.
4 # builds some git commit of Quagga in some different configurations
5 # usage: buildtest.sh [commit [configurations...]]
7 basecfg
="--prefix=/usr --enable-user=quagga --enable-group=quagga --enable-vty-group=quagga --enable-configfile-mask=0660 --enable-logfile-mask=0640 --enable-vtysh --sysconfdir=/etc/quagga --enable-exampledir=/etc/quagga/samples --localstatedir=/var/run/quagga --libdir=/usr/lib64/quagga --enable-ipv6 --enable-ripngd --enable-ospf6d --enable-rtadv --disable-static --enable-isisd --enable-multipath=0 --enable-pimd --enable-werror"
9 configs_base
="gcc|$basecfg"
11 configs_nov6
="gcc|$basecfg"
12 configs_nov6
="${configs_nov6/enable-ipv6/disable-ipv6}"
13 configs_nov6
="${configs_nov6/enable-ospf6d/disable-ospf6d}"
14 configs_nov6
="${configs_nov6/enable-ripngd/disable-ripngd}"
16 configs_ext
="gcc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
17 configs_snmp
="gcc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology --enable-snmp"
18 configs_clang
="clang|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
19 configs_icc
="icc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
21 defconfigs
="base nov6 ext"
22 net-snmp-config
--version &> /dev
/null
&& defconfigs
="$defconfigs snmp"
23 clang
--version &> /dev
/null
&& defconfigs
="$defconfigs clang"
24 icc
--version &> /dev
/null
&& defconfigs
="$defconfigs icc"
26 echo "enabled configurations: $defconfigs"
28 cc_gcc
="CC=gcc; export CC"
29 cc_clang
="CC=clang; export CC"
30 cc_icc
="CC=icc; export CC"
32 ###############################
35 echo "something went wrong! check $TEMP"
43 COMMITISH
="`git rev-list --max-count=1 ${COMMITREF:-HEAD}`"
44 TEMP
="`mktemp -t -d quaggabuild.XXXXXX`"
48 echo using temporary directory
: $TEMP
50 git
--no-pager log
-n 1 --pretty=oneline
"$COMMITISH"
53 git clone
"$BASE" "source"
55 git checkout
-b build
"$COMMITISH"
61 echo -e "\n\n\n\n\033[33;1mmaking dist tarball\033[m"
66 make distdir
=sdist dist-gzip
68 tar zxvf build_dist
/sdist.
tar.gz
70 for cfg
in ${CONFIGS:-$defconfigs}; do
71 echo -e "\n\n\n\n\033[33;1mbuilding configuration $cfg\033[m"
72 config
="\${configs_$cfg}"
85 ..
/sdist
/configure
$args
88 make DESTDIR
="$TEMP/inst_$cfg" install
92 echo -e "\n\n\n\neverything seems ok. you may now\n\trm -rf $TEMP"