blob: fb529a4c14be6bec20f298cd69c52dabe824e3d2 [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 Hofmeyr49beba42017-10-27 22:54:44 +020022osmo-clean-workspace.sh
23
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020024mkdir "$deps" || true
Neels Hofmeyr2d912602016-08-10 14:46:49 +020025
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020026# Collect configure options for osmo-pcu
27PCU_CONFIG=""
28if [ "$with_dsp" = sysmo ]; then
29 PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp"
30
31 # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API
32 cd "$deps"
Max062dfa12017-06-13 18:39:52 +020033 osmo-layer1-headers.sh sysmo
34 cd layer1-headers
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020035 api_incl="$inst/include/sysmocom/femtobts/"
36 mkdir -p "$api_incl"
37 cp include/*.h "$api_incl"
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020038 cd "$base"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020039
Max062dfa12017-06-13 18:39:52 +020040elif [ "$with_dsp" = lc15 ]; then
41 PCU_CONFIG="$PCU_CONFIG --enable-lc15bts-phy --with-litecell15=$deps/layer1-headers/inc"
42 cd "$deps"
Max865436d2017-06-22 18:23:09 +020043 osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION"
Max062dfa12017-06-13 18:39:52 +020044 cd "$base"
45
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020046elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then
47 echo "Direct DSP access disabled"
48else
49 echo 'Invalid $with_dsp value:' $with_dsp
50 exit 1
51fi
52
53if [ "$with_vty" = "yes" ]; then
54 PCU_CONFIG="$PCU_CONFIG --enable-vty-tests"
55elif [ -z "$with_vty" -o "$with_vty" = "no" ]; then
56 echo "VTY tests disabled"
57else
58 echo 'Invalid $with_vty value:' $with_vty
59 exit 1
60fi
61
Max10e37a52017-08-24 14:23:12 +020062verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
63
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020064# Build deps
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020065osmo-build-dep.sh libosmocore
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040066
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020067export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
Neels Hofmeyr2d912602016-08-10 14:46:49 +020068export LD_LIBRARY_PATH="$inst/lib"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020069
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020070set +x
71echo
72echo
73echo
74echo " =============================== osmo-pcu ==============================="
75echo
76set -x
77
Neels Hofmeyr2d912602016-08-10 14:46:49 +020078autoreconf --install --force
79./configure $PCU_CONFIG
80$MAKE $PARALLEL_MAKE
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020081DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \
82 $MAKE distcheck \
83 || cat-testlogs.sh
Neels Hofmeyr49beba42017-10-27 22:54:44 +020084
85osmo-clean-workspace.sh