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-babeld"
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}"
15 configs_nov6
="${configs_nov6/enable-babeld/disable-babeld}"
17 configs_ext
="gcc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
18 configs_snmp
="gcc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology --enable-snmp"
19 configs_clang
="clang|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
20 configs_icc
="icc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
22 defconfigs
="base nov6 ext"
23 net-snmp-config
--version &> /dev
/null
&& defconfigs
="$defconfigs snmp"
24 clang
--version &> /dev
/null
&& defconfigs
="$defconfigs clang"
25 icc
--version &> /dev
/null
&& defconfigs
="$defconfigs icc"
27 echo "enabled configurations: $defconfigs"
29 cc_gcc
="CC=gcc; export CC"
30 cc_clang
="CC=clang; export CC"
31 cc_icc
="CC=icc; export CC"
33 ###############################
36 echo "something went wrong! check $TEMP"
44 COMMITISH
="`git rev-list --max-count=1 ${COMMITREF:-HEAD}`"
45 TEMP
="`mktemp -t -d quaggabuild.XXXXXX`"
49 echo using temporary directory
: $TEMP
51 git
--no-pager log
-n 1 --pretty=oneline
"$COMMITISH"
54 git clone
"$BASE" "source"
56 git checkout
-b build
"$COMMITISH"
62 echo -e "\n\n\n\n\033[33;1mmaking dist tarball\033[m"
67 make distdir
=sdist dist-gzip
69 tar zxvf build_dist
/sdist.
tar.gz
71 for cfg
in ${CONFIGS:-$defconfigs}; do
72 echo -e "\n\n\n\n\033[33;1mbuilding configuration $cfg\033[m"
73 config
="\${configs_$cfg}"
86 ..
/sdist
/configure
$args
89 make DESTDIR
="$TEMP/inst_$cfg" install
93 echo -e "\n\n\n\neverything seems ok. you may now\n\trm -rf $TEMP"