blob: 49560ca6d840748c51200004c6a9701196dbce3e [file] [log] [blame]
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +02001#!/bin/sh
Neels Hofmeyrd46ea132017-04-08 15:56:31 +02002set -x -e
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +02003
Neels Hofmeyrd46ea132017-04-08 15:56:31 +02004base="$PWD"
5prefix="$base/inst-osmo-bts-octphy"
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +02006
Neels Hofmeyrd46ea132017-04-08 15:56:31 +02007rm -f "$base/osmo-bts-octphy*.tgz"
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +02008
Neels Hofmeyrd46ea132017-04-08 15:56:31 +02009deps="
10libosmocore
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020011libosmo-abis
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020012osmo-bts
13"
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020014
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020015have_repo() {
16 repo="$1"
17 cd "$base"
18 if [ ! -e "$repo" ]; then
19 set +x
20 echo "MISSING REPOSITORY: $repo"
21 echo "should be provided by the jenkins workspace"
22 exit 1
23 fi
24 cd "$repo"
25 git clean -dxf
26 cd "$base"
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020027}
28
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020029# for gsm_data_shared.*
30have_repo openbsc
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020031
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020032# octphy headers
33have_repo octphy-2g-headers
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020034
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020035
36rm -rf "$prefix"
37mkdir -p "$prefix"
38
39export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
40export LD_LIBRARY_PATH="$prefix/lib"
41
42for dep in $deps; do
43 have_repo "$dep"
44 cd "$dep"
45 rm -rf *
46 git checkout .
47
48 echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-octphy_git_hashes.txt"
49
50 autoreconf -fi
51
52 config_opts=""
53
54 case "$repo" in
55 'osmo-bts') config_opts="$config_opts --enable-octphy --with-octsdr-2g=$base/octphy-2g-headers" ;;
56 esac
57
58 ./configure --prefix="$prefix" $config_opts
59 make -j8
60 make install
61done
62
63# build the archive that is going to be copied to the tester
Neels Hofmeyr8bedf8c2017-05-02 17:00:30 +020064rm "$base"/*.tgz || true
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020065cd "$prefix"
66tar czf "$base/osmo-bts-octphy.build-${BUILD_NUMBER}.tgz" *