blob: e44cf0a2fbd6bfc25273e75b25a76ac686140cb5 [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"
19 if [ ! -e "$repo" ]; then
20 set +x
21 echo "MISSING REPOSITORY: $repo"
22 echo "should be provided by the jenkins workspace"
23 exit 1
24 fi
25 cd "$repo"
26 git clean -dxf
27 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 Hofmeyr8bedf8c2017-05-02 17:00:30 +020063rm "$base"/*.tgz || true
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020064cd "$prefix"
65tar czf "$base/osmo-bts-trx.build-${BUILD_NUMBER}.tgz" *