blob: 142edddfacdfc90a2891c8778006069af243c63c [file] [log] [blame]
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +02001set -e -x
2
3deps="
4libosmocore
5libosmo-abis
6osmo-bts
7"
8
9base="$PWD"
10
11have_repo() {
12 repo="$1"
13 cd "$base"
14 if [ ! -e "$repo" ]; then
15 set +x
16 echo "MISSING REPOSITORY: $repo"
17 echo "should be provided by the jenkins workspace"
18 exit 1
19 fi
20 cd "$repo"
21 git clean -dxf
22 cd "$base"
23}
24
25for dep in $deps; do
26 have_repo "$dep"
27done
28
29# for gsm_data_shared.h
30have_repo openbsc
31
32. /opt/poky/1.5.4/environment-setup-armv5te-poky-linux-gnueabi
33
34export DESTDIR=/opt/poky/1.5.4/sysroots/armv5te-poky-linux-gnueabi
35
36prefix_base="/usr/local/jenkins-build"
37prefix_base_real="$DESTDIR$prefix_base"
38rm -rf "$prefix_base_real"
39
40prefix="$prefix_base/inst-osmo-bts-sysmo"
41prefix_real="$DESTDIR$prefix"
42mkdir -p "$prefix_real"
43
44for dep in $deps; do
45 cd "$base/$dep"
46
47 echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/osmo-bts-sysmo_git_hashes.txt"
48
49 autoreconf -fi
50
51 config_opts=""
52 case "$dep" in
53 'libosmocore') config_opts="--disable-pcsc" ;;
54 'osmo-bts') config_opts="--enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include" ;;
55 esac
56
57 ./configure --prefix="$prefix" $CONFIGURE_FLAGS $config_opts
58 make -j8
59 make install
60done
61
62# build the archive that is going to be copied to the tester and then to the BTS
63tar_name="osmo-bts-sysmo-build-"
64if ls "$base/$tar_name"* ; then
65 rm -f "$base/$tar_name"*
66fi
67cd "$prefix_base_real"
68tar cvzf "$base/$tar_name${BUILD_NUMBER}.tgz" *