2016-04-13 23:05:52 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
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
|
|
|
|
2016-10-09 22:55:12 +00:00
|
|
|
mkdir "$deps" || true
|
2016-08-10 12:42:16 +00:00
|
|
|
rm -rf "$inst"
|
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
|
|
|
|
PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp"
|
|
|
|
|
|
|
|
# For direct sysmo DSP access, provide the SysmoBTS Layer 1 API
|
|
|
|
cd "$deps"
|
|
|
|
if [ ! -d layer1-api ]; then
|
|
|
|
git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api
|
|
|
|
fi
|
|
|
|
cd layer1-api
|
|
|
|
git fetch origin
|
|
|
|
git reset --hard origin/master
|
|
|
|
api_incl="$inst/include/sysmocom/femtobts/"
|
|
|
|
mkdir -p "$api_incl"
|
|
|
|
cp include/*.h "$api_incl"
|
2016-10-09 22:55:12 +00:00
|
|
|
cd "$base"
|
2016-08-10 13:29:31 +00:00
|
|
|
|
|
|
|
elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then
|
|
|
|
echo "Direct DSP access disabled"
|
|
|
|
else
|
|
|
|
echo 'Invalid $with_dsp value:' $with_dsp
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$with_vty" = "yes" ]; then
|
|
|
|
PCU_CONFIG="$PCU_CONFIG --enable-vty-tests"
|
|
|
|
elif [ -z "$with_vty" -o "$with_vty" = "no" ]; then
|
|
|
|
echo "VTY tests disabled"
|
|
|
|
else
|
|
|
|
echo 'Invalid $with_vty value:' $with_vty
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Build deps
|
2016-10-09 22:55:12 +00:00
|
|
|
osmo-build-dep.sh libosmocore
|
2016-04-13 23:05:52 +00:00
|
|
|
|
2017-03-01 14:48:39 +00:00
|
|
|
"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
|
|
|
|
|
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
|
2016-10-09 22:55:12 +00:00
|
|
|
DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \
|
|
|
|
$MAKE distcheck \
|
|
|
|
|| cat-testlogs.sh
|