2017-06-13 16:39:52 +00:00
|
|
|
#!/bin/sh
|
2017-07-10 13:03:27 +00:00
|
|
|
# jenkins build helper script for osmo-pcu. This is how we build on jenkins.osmocom.org
|
|
|
|
|
|
|
|
if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then
|
|
|
|
echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2016-04-13 23:05:52 +00:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2016-08-10 12:35:51 +00:00
|
|
|
if [ -z "$MAKE" ]; then
|
|
|
|
echo 'The $MAKE variable is not defined, cannot build'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-08-10 12:42:16 +00:00
|
|
|
base="$PWD"
|
|
|
|
deps="$base/deps"
|
|
|
|
inst="$deps/install"
|
2016-10-09 22:55:12 +00:00
|
|
|
export deps inst
|
2016-08-10 12:42:16 +00:00
|
|
|
|
2017-10-27 20:54:44 +00:00
|
|
|
osmo-clean-workspace.sh
|
|
|
|
|
2016-10-09 22:55:12 +00:00
|
|
|
mkdir "$deps" || true
|
2016-08-10 12:46:49 +00:00
|
|
|
|
2016-08-10 13:29:31 +00:00
|
|
|
# Collect configure options for osmo-pcu
|
|
|
|
PCU_CONFIG=""
|
|
|
|
if [ "$with_dsp" = sysmo ]; then
|
2018-06-20 21:30:36 +00:00
|
|
|
PCU_CONFIG="$PCU_CONFIG --enable-werror --enable-sysmocom-dsp --with-sysmobts=$inst/include/"
|
2016-08-10 13:29:31 +00:00
|
|
|
|
|
|
|
# For direct sysmo DSP access, provide the SysmoBTS Layer 1 API
|
|
|
|
cd "$deps"
|
2017-06-13 16:39:52 +00:00
|
|
|
osmo-layer1-headers.sh sysmo
|
2018-01-15 15:43:22 +00:00
|
|
|
mkdir -p "$inst/include/sysmocom/femtobts"
|
|
|
|
ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
|
2016-10-09 22:55:12 +00:00
|
|
|
cd "$base"
|
2016-08-10 13:29:31 +00:00
|
|
|
|
2017-06-13 16:39:52 +00:00
|
|
|
elif [ "$with_dsp" = lc15 ]; then
|
|
|
|
PCU_CONFIG="$PCU_CONFIG --enable-lc15bts-phy --with-litecell15=$deps/layer1-headers/inc"
|
|
|
|
cd "$deps"
|
2017-06-22 16:23:09 +00:00
|
|
|
osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION"
|
2017-06-13 16:39:52 +00:00
|
|
|
cd "$base"
|
|
|
|
|
2016-08-10 13:29:31 +00:00
|
|
|
elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then
|
2017-12-21 16:34:19 +00:00
|
|
|
echo "Direct DSP access disabled, sanitizer enabled"
|
2018-06-20 21:30:36 +00:00
|
|
|
PCU_CONFIG="$PCU_CONFIG --enable-werror --enable-sanitize"
|
2016-08-10 13:29:31 +00:00
|
|
|
else
|
|
|
|
echo 'Invalid $with_dsp value:' $with_dsp
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-01-12 15:30:10 +00:00
|
|
|
if [ "$with_vty" = "True" ]; then
|
2016-08-10 13:29:31 +00:00
|
|
|
PCU_CONFIG="$PCU_CONFIG --enable-vty-tests"
|
2018-01-12 15:30:10 +00:00
|
|
|
elif [ -z "$with_vty" -o "$with_vty" = "False" ]; then
|
2016-08-10 13:29:31 +00:00
|
|
|
echo "VTY tests disabled"
|
|
|
|
else
|
|
|
|
echo 'Invalid $with_vty value:' $with_vty
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-08-24 12:23:12 +00:00
|
|
|
verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
|
|
|
|
|
2016-08-10 13:29:31 +00:00
|
|
|
# Build deps
|
2018-01-17 15:14:59 +00:00
|
|
|
osmo-build-dep.sh libosmocore "" --disable-doxygen
|
2016-04-13 23:05:52 +00:00
|
|
|
|
2016-10-09 22:55:12 +00:00
|
|
|
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
|
2016-08-10 12:46:49 +00:00
|
|
|
export LD_LIBRARY_PATH="$inst/lib"
|
2016-08-10 13:29:31 +00:00
|
|
|
|
2016-10-09 22:55:12 +00:00
|
|
|
set +x
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo " =============================== osmo-pcu ==============================="
|
|
|
|
echo
|
|
|
|
set -x
|
|
|
|
|
2016-08-10 12:46:49 +00:00
|
|
|
autoreconf --install --force
|
|
|
|
./configure $PCU_CONFIG
|
|
|
|
$MAKE $PARALLEL_MAKE
|
2018-12-04 14:24:54 +00:00
|
|
|
DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \
|
2016-10-09 22:55:12 +00:00
|
|
|
$MAKE distcheck \
|
|
|
|
|| cat-testlogs.sh
|
2017-10-27 20:54:44 +00:00
|
|
|
|
|
|
|
osmo-clean-workspace.sh
|