blob: 05b96393026c6569c0983818b229adc9c1b7f116 [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
Max406a1f02017-12-21 17:34:19 +010047 echo "Direct DSP access disabled, sanitizer enabled"
48 PCU_CONFIG="$PCU_CONFIG --enable-sanitize"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020049else
50 echo 'Invalid $with_dsp value:' $with_dsp
51 exit 1
52fi
53
54if [ "$with_vty" = "yes" ]; then
55 PCU_CONFIG="$PCU_CONFIG --enable-vty-tests"
56elif [ -z "$with_vty" -o "$with_vty" = "no" ]; then
57 echo "VTY tests disabled"
58else
59 echo 'Invalid $with_vty value:' $with_vty
60 exit 1
61fi
62
Max10e37a52017-08-24 14:23:12 +020063verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
64
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020065# Build deps
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020066osmo-build-dep.sh libosmocore
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040067
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020068export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
Neels Hofmeyr2d912602016-08-10 14:46:49 +020069export LD_LIBRARY_PATH="$inst/lib"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020070
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020071set +x
72echo
73echo
74echo
75echo " =============================== osmo-pcu ==============================="
76echo
77set -x
78
Neels Hofmeyr2d912602016-08-10 14:46:49 +020079autoreconf --install --force
80./configure $PCU_CONFIG
81$MAKE $PARALLEL_MAKE
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020082DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \
83 $MAKE distcheck \
84 || cat-testlogs.sh
Neels Hofmeyr49beba42017-10-27 22:54:44 +020085
86osmo-clean-workspace.sh