2017-09-04 18:42:55 +00:00
|
|
|
#!/bin/sh -ex
|
2018-12-07 14:00:46 +00:00
|
|
|
# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org
|
|
|
|
#
|
|
|
|
# environment variables:
|
|
|
|
# * MGCP: configure transcoding for MGCP (values: "--enable-mgcp-transcoding", "--disable-mgcp-transcoding")
|
|
|
|
# * SMPP: configure the SMPP interface (values: "--enable-smpp", "--disable-smpp")
|
|
|
|
# * WITH_MANUALS: build manual PDFs if set to "1"
|
|
|
|
# * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1")
|
|
|
|
#
|
2017-07-10 13:00:00 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
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
|
2017-07-10 13:00:00 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
base="$PWD"
|
|
|
|
deps="$base/deps"
|
|
|
|
inst="$deps/install"
|
|
|
|
export deps inst
|
2016-04-13 23:03:38 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
osmo-clean-workspace.sh
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
mkdir -p "$deps"
|
|
|
|
rm -rf "$inst"
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
#
|
|
|
|
# Build deps
|
|
|
|
#
|
|
|
|
osmo-build-dep.sh libosmocore master ac_cv_path_DOXYGEN=false
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
|
2017-09-04 18:42:55 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
|
|
|
|
export LD_LIBRARY_PATH="$inst/lib"
|
|
|
|
export PATH="$inst/bin:$PATH"
|
2017-09-04 18:42:55 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
osmo-build-dep.sh libosmo-abis
|
|
|
|
osmo-build-dep.sh libosmo-netif
|
|
|
|
osmo-build-dep.sh libosmo-sccp "$sccp_branch"
|
|
|
|
PARALLEL_MAKE=-j1 osmo-build-dep.sh libsmpp34
|
2017-09-04 18:42:55 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
#
|
|
|
|
# Build project
|
|
|
|
#
|
|
|
|
cd "$base/openbsc"
|
|
|
|
autoreconf --install --force
|
2017-04-10 18:57:09 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
./configure "$SMPP" "$MGCP" \
|
|
|
|
--enable-osmo-bsc \
|
|
|
|
--enable-nat \
|
|
|
|
--enable-vty-tests \
|
|
|
|
--enable-external-tests
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
"$MAKE" $PARALLEL_MAKE
|
|
|
|
"$MAKE" check || cat-testlogs.sh
|
|
|
|
"$MAKE" distcheck || cat-testlogs.sh
|
|
|
|
"$MAKE" maintainer-clean
|
2017-10-27 20:54:18 +00:00
|
|
|
|
2023-01-18 09:26:05 +00:00
|
|
|
#
|
2018-12-07 14:00:46 +00:00
|
|
|
# Build and publish manuals
|
2023-01-18 09:26:05 +00:00
|
|
|
#
|
2018-12-07 14:00:46 +00:00
|
|
|
if [ "$WITH_MANUALS" = "1" ]; then
|
|
|
|
# Build all manuals first
|
|
|
|
for dir in "$base"/manuals/*/; do
|
|
|
|
make -C "$dir"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Run 'make check' for the OsmoNITB manuals.
|
|
|
|
# The other dirs only have VTY references, so there is no 'make check' target for them.
|
|
|
|
make -C "$base/manuals/OsmoNITB" check
|
|
|
|
|
|
|
|
# Publish all at once
|
|
|
|
if [ "$PUBLISH" = "1" ]; then
|
|
|
|
for dir in "$base"/manuals/*/; do
|
|
|
|
make -C "$dir" publish
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2017-10-27 20:54:18 +00:00
|
|
|
osmo-clean-workspace.sh
|