blob: 25271270438c62731d8918f49bfa7ad11313dcae [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
Max186206c2018-01-15 16:43:22 +010029 PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp --with-sysmobts=$inst/include/"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020030
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
Max186206c2018-01-15 16:43:22 +010034 mkdir -p "$inst/include/sysmocom/femtobts"
35 ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020036 cd "$base"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020037
Max062dfa12017-06-13 18:39:52 +020038elif [ "$with_dsp" = lc15 ]; then
39 PCU_CONFIG="$PCU_CONFIG --enable-lc15bts-phy --with-litecell15=$deps/layer1-headers/inc"
40 cd "$deps"
Max865436d2017-06-22 18:23:09 +020041 osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION"
Max062dfa12017-06-13 18:39:52 +020042 cd "$base"
43
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020044elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then
Max406a1f02017-12-21 17:34:19 +010045 echo "Direct DSP access disabled, sanitizer enabled"
46 PCU_CONFIG="$PCU_CONFIG --enable-sanitize"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020047else
48 echo 'Invalid $with_dsp value:' $with_dsp
49 exit 1
50fi
51
Max3e659ea2018-01-12 16:30:10 +010052if [ "$with_vty" = "True" ]; then
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020053 PCU_CONFIG="$PCU_CONFIG --enable-vty-tests"
Max3e659ea2018-01-12 16:30:10 +010054elif [ -z "$with_vty" -o "$with_vty" = "False" ]; then
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020055 echo "VTY tests disabled"
56else
57 echo 'Invalid $with_vty value:' $with_vty
58 exit 1
59fi
60
Max10e37a52017-08-24 14:23:12 +020061verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
62
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020063# Build deps
Max4cb6e042018-01-17 16:14:59 +010064osmo-build-dep.sh libosmocore "" --disable-doxygen
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040065
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
Neels Hofmeyr49beba42017-10-27 22:54:44 +020083
84osmo-clean-workspace.sh