blob: 652913ff10cd8b18ec486be77912d79620d23909 [file] [log] [blame]
Neels Hofmeyrd46ea132017-04-08 15:56:31 +02001#!/bin/sh
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +02002set -x -e
3
4base="$PWD"
Neels Hofmeyrd46ea132017-04-08 15:56:31 +02005prefix="$base/inst-osmo-bts-trx"
6
7rm -f "$base/osmo-bts-trx*.tgz"
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +02008
9deps="
10libosmocore
11libosmo-abis
12osmo-trx
13osmo-bts
14"
15
16have_repo() {
17 repo="$1"
18 cd "$base"
Neels Hofmeyr07650982017-05-12 16:24:16 +020019 if [ ! -d "$repo" ]; then
20 git clone "git://git.osmocom.org/$repo" "$repo"
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020021 fi
22 cd "$repo"
23 git clean -dxf
Neels Hofmeyr07650982017-05-12 16:24:16 +020024 git fetch origin
25 git reset --hard origin/master
26 git rev-parse HEAD
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020027 cd "$base"
28}
29
30# for gsm_data_shared.*
31have_repo openbsc
32
33
34rm -rf "$prefix"
35mkdir -p "$prefix"
36
37export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
38export LD_LIBRARY_PATH="$prefix/lib"
39
40for dep in $deps; do
41 have_repo "$dep"
42 cd "$dep"
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020043 rm -rf *
44 git checkout .
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020045
46 echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-trx_osmo-trx_git_hashes.txt"
47
48 autoreconf -fi
49
50 config_opts=""
51
52 case "$repo" in
53 'osmo-bts') config_opts="--enable-trx --with-openbsc=$base/openbsc/openbsc/include" ;;
54 'osmo-trx') config_opts="--without-sse" ;;
55 esac
56
57 ./configure --prefix="$prefix" $config_opts
58 make -j8
59 make install
60done
61
62# build the archive that is going to be copied to the tester
Neels Hofmeyrc59e0792017-05-14 01:57:25 +020063rm "$base"/*.tgz "$base"/*.md5 || true
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020064cd "$prefix"
Neels Hofmeyrc59e0792017-05-14 01:57:25 +020065this="osmo-bts-trx.build-${BUILD_NUMBER}"
66tar="${this}.tgz"
67tar czf "$base/$tar" *
68cd "$base"
69md5sum "$tar" > "${this}.md5"