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-rtadv --disable-static --enable-isisd --enable-multipath=0 --enable-pimd"
9 configs_base="gcc|$basecfg"
11 configs_ext="gcc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
12 configs_snmp="gcc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology --enable-snmp"
13 configs_clang="clang|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
14 configs_icc="icc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
17 net-snmp-config --version &> /dev/null && defconfigs="$defconfigs snmp"
18 clang --version &> /dev/null && defconfigs="$defconfigs clang"
19 icc --version &> /dev/null && defconfigs="$defconfigs icc"
21 echo "enabled configurations: $defconfigs"
23 cc_gcc="CC=gcc; export CC"
24 cc_clang="CC=clang; export CC"
25 cc_icc="CC=icc; export CC"
27 ###############################
30 echo "something went wrong! check $TEMP"
38 COMMITISH="`git rev-list --max-count=1 ${COMMITREF:-HEAD}`"
39 TEMP="`mktemp -t -d quaggabuild.XXXXXX`"
43 echo using temporary directory: $TEMP
45 git --no-pager log -n 1 --pretty=oneline "$COMMITISH"
48 git clone "$BASE" "source"
50 git checkout -b build "$COMMITISH"
56 echo -e "\n\n\n\n\033[33;1mmaking dist tarball\033[m"
61 make distdir=sdist dist-gzip
63 tar zxvf build_dist/sdist.tar.gz
65 for cfg in ${CONFIGS:-$defconfigs}; do
66 echo -e "\n\n\n\n\033[33;1mbuilding configuration $cfg\033[m"
67 config="\${configs_$cfg}"
80 ../sdist/configure $args
83 make DESTDIR="$TEMP/inst_$cfg" install
87 echo -e "\n\n\n\neverything seems ok. you may now\n\trm -rf $TEMP"