blob: 52f7593bcd54b03d7cea44f5362c863ef89b4a40 [file] [log] [blame]
Neels Hofmeyrd46ea132017-04-08 15:56:31 +02001#!/bin/sh
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +02002set -e -x
3
4deps="
5libosmocore
6libosmo-abis
7osmo-bts
8"
9
10base="$PWD"
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020011rm -f "$base/osmo-bts-sysmo.*.tgz"
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020012
13have_repo() {
14 repo="$1"
15 cd "$base"
16 if [ ! -e "$repo" ]; then
17 set +x
18 echo "MISSING REPOSITORY: $repo"
19 echo "should be provided by the jenkins workspace"
20 exit 1
21 fi
22 cd "$repo"
23 git clean -dxf
24 cd "$base"
25}
26
27for dep in $deps; do
28 have_repo "$dep"
29done
30
31# for gsm_data_shared.h
32have_repo openbsc
33
34. /opt/poky/1.5.4/environment-setup-armv5te-poky-linux-gnueabi
35
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020036# Cross-compilation: all installations need to be put in the sysmo SDK sysroot
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020037export DESTDIR=/opt/poky/1.5.4/sysroots/armv5te-poky-linux-gnueabi
38
39prefix_base="/usr/local/jenkins-build"
40prefix_base_real="$DESTDIR$prefix_base"
41rm -rf "$prefix_base_real"
42
43prefix="$prefix_base/inst-osmo-bts-sysmo"
44prefix_real="$DESTDIR$prefix"
45mkdir -p "$prefix_real"
46
47for dep in $deps; do
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020048 cd "$base/$dep"
49 rm -rf *
50 git checkout .
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020051
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020052 echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/osmo-bts-sysmo_git_hashes.txt"
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020053
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020054 autoreconf -fi
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020055
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020056 config_opts=""
57 case "$dep" in
58 'libosmocore') config_opts="--disable-pcsc" ;;
59 'osmo-bts') config_opts="--enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include" ;;
60 esac
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020061
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020062 ./configure --prefix="$prefix" $CONFIGURE_FLAGS $config_opts
63 make -j8
64 make install
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020065done
66
67# build the archive that is going to be copied to the tester and then to the BTS
Neels Hofmeyr8bedf8c2017-05-02 17:00:30 +020068rm "$base"/*.tgz || true
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020069cd "$prefix_real"
Neels Hofmeyr3531a192017-03-28 14:30:28 +020070tar cvzf "$base/osmo-bts-sysmo.build-${BUILD_NUMBER}.tgz" *