]> git.proxmox.com Git - mirror_frr.git/blame - buildtest.sh
Merge pull request #6348 from dslicenc/frr-reload-bfd
[mirror_frr.git] / buildtest.sh
CommitLineData
f6295c29
DL
1#!/bin/bash
2# written 2012-2013 by David Lamparter, placed in Public Domain.
3#
1689cf7e 4# builds some git commit of FRR in some different configurations
f6295c29
DL
5# usage: buildtest.sh [commit [configurations...]]
6
555d1e3a 7basecfg="--prefix=/usr --enable-user=frr --enable-group=frr --enable-vty-group=frr --enable-configfile-mask=0660 --enable-logfile-mask=0640 --enable-vtysh --sysconfdir=/etc/frr --enable-exampledir=/etc/frr/samples --localstatedir=/var/run/frr --libdir=/usr/lib64/frr --enable-rtadv --disable-static --enable-isisd --enable-multipath=0 --enable-pimd --enable-werror"
f6295c29
DL
8
9configs_base="gcc|$basecfg"
10
f6295c29
DL
11configs_ext="gcc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
12configs_snmp="gcc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology --enable-snmp"
13configs_clang="clang|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
14configs_icc="icc|$basecfg --enable-opaque-lsa --enable-ospf-te --enable-ospfclient --enable-isis-topology"
15
80ec006d 16defconfigs="base ext"
f6295c29
DL
17net-snmp-config --version &> /dev/null && defconfigs="$defconfigs snmp"
18clang --version &> /dev/null && defconfigs="$defconfigs clang"
19icc --version &> /dev/null && defconfigs="$defconfigs icc"
20
21echo "enabled configurations: $defconfigs"
22
23cc_gcc="CC=gcc; export CC"
24cc_clang="CC=clang; export CC"
25cc_icc="CC=icc; export CC"
26
27###############################
28
29errfunc() {
30 echo "something went wrong! check $TEMP"
31 exit 1
32}
33
34set -e
35trap errfunc ERR
36
37COMMITREF="$1"
38COMMITISH="`git rev-list --max-count=1 ${COMMITREF:-HEAD}`"
555d1e3a 39TEMP="`mktemp -t -d frrbuild.XXXXXX`"
f6295c29
DL
40BASE="`pwd`"
41CONFIGS="$2"
42
43echo using temporary directory: $TEMP
44echo git commit used:
45git --no-pager log -n 1 --pretty=oneline "$COMMITISH"
46
47cd "$TEMP"
48git clone "$BASE" "source"
49cd "source"
50git checkout -b build "$COMMITISH"
51git clean -d -f -x
52sh bootstrap.sh
53
54cd ..
55
56echo -e "\n\n\n\n\033[33;1mmaking dist tarball\033[m"
57
58mkdir build_dist
59cd build_dist
60../source/configure
61make distdir=sdist dist-gzip
62cd ..
63tar zxvf build_dist/sdist.tar.gz
64
65for cfg in ${CONFIGS:-$defconfigs}; do
66 echo -e "\n\n\n\n\033[33;1mbuilding configuration $cfg\033[m"
67 config="\${configs_$cfg}"
68 eval "config=$config"
69
70 cc="${config%%|*}"
71 args="${config#*|}"
72
73 ccset="\${cc_$cc}"
74 eval "ccset=$ccset"
75 eval "$ccset"
76
77 bdir="build_$cfg"
78 mkdir "$bdir"
79 cd "$bdir"
80 ../sdist/configure $args
81 make -j5
f281ab97 82 make check
f6295c29
DL
83 make DESTDIR="$TEMP/inst_$cfg" install
84 cd ..
85done
86
87echo -e "\n\n\n\neverything seems ok. you may now\n\trm -rf $TEMP"