blob: 75f28f385376dc070170c6288012cf4ec2fc935e [file] [log] [blame]
Max062dfa12017-06-13 18:39:52 +02001#!/bin/sh
Harald Welte8c8027c2017-07-10 15:03:27 +02002# jenkins build helper script for osmo-pcu. This is how we build on jenkins.osmocom.org
3
4if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then
5 echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
6 exit 2
7fi
8
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -04009
10set -ex
11
Neels Hofmeyr0b4da052016-08-10 14:35:51 +020012if [ -z "$MAKE" ]; then
13 echo 'The $MAKE variable is not defined, cannot build'
14 exit 1
15fi
16
Neels Hofmeyr6bae2d12016-08-10 14:42:16 +020017base="$PWD"
18deps="$base/deps"
19inst="$deps/install"
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020020export deps inst
Neels Hofmeyr6bae2d12016-08-10 14:42:16 +020021
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020022mkdir "$deps" || true
Neels Hofmeyr6bae2d12016-08-10 14:42:16 +020023rm -rf "$inst"
Neels Hofmeyr2d912602016-08-10 14:46:49 +020024
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020025# Collect configure options for osmo-pcu
26PCU_CONFIG=""
27if [ "$with_dsp" = sysmo ]; then
28 PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp"
29
30 # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API
31 cd "$deps"
Max062dfa12017-06-13 18:39:52 +020032 osmo-layer1-headers.sh sysmo
33 cd layer1-headers
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020034 api_incl="$inst/include/sysmocom/femtobts/"
35 mkdir -p "$api_incl"
36 cp include/*.h "$api_incl"
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020037 cd "$base"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020038
Max062dfa12017-06-13 18:39:52 +020039elif [ "$with_dsp" = lc15 ]; then
40 PCU_CONFIG="$PCU_CONFIG --enable-lc15bts-phy --with-litecell15=$deps/layer1-headers/inc"
41 cd "$deps"
Max865436d2017-06-22 18:23:09 +020042 osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION"
Max062dfa12017-06-13 18:39:52 +020043 cd "$base"
44
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020045elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then
46 echo "Direct DSP access disabled"
47else
48 echo 'Invalid $with_dsp value:' $with_dsp
49 exit 1
50fi
51
52if [ "$with_vty" = "yes" ]; then
53 PCU_CONFIG="$PCU_CONFIG --enable-vty-tests"
54elif [ -z "$with_vty" -o "$with_vty" = "no" ]; then
55 echo "VTY tests disabled"
56else
57 echo 'Invalid $with_vty value:' $with_vty
58 exit 1
59fi
60
61# Build deps
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020062osmo-build-dep.sh libosmocore
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040063
Neels Hofmeyr20827372017-03-01 15:48:39 +010064"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
65
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020066export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
Neels Hofmeyr2d912602016-08-10 14:46:49 +020067export LD_LIBRARY_PATH="$inst/lib"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020068
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020069set +x
70echo
71echo
72echo
73echo " =============================== osmo-pcu ==============================="
74echo
75set -x
76
Neels Hofmeyr2d912602016-08-10 14:46:49 +020077autoreconf --install --force
78./configure $PCU_CONFIG
79$MAKE $PARALLEL_MAKE
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020080DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \
81 $MAKE distcheck \
82 || cat-testlogs.sh