2017-09-05 20:35:10 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org
|
2018-11-29 13:16:27 +00:00
|
|
|
#
|
|
|
|
# environment variables:
|
|
|
|
# * GTP: configure GTP tunneling Linux kernel (values: "--enable-gtp-linux" or "--disable-gtp-linux")
|
|
|
|
# * WITH_MANUALS: build manual PDFs if set to "1"
|
|
|
|
# * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1")
|
|
|
|
#
|
2017-09-05 20:35:10 +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
|
|
|
|
|
2016-04-13 23:02:13 +00:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2017-09-05 20:35:10 +00:00
|
|
|
base="$PWD"
|
|
|
|
deps="$base/deps"
|
|
|
|
inst="$deps/install"
|
|
|
|
export deps inst
|
2017-08-25 15:37:36 +00:00
|
|
|
|
2017-10-27 20:54:29 +00:00
|
|
|
osmo-clean-workspace.sh
|
|
|
|
|
2017-09-05 20:35:10 +00:00
|
|
|
mkdir "$deps" || true
|
2016-04-13 23:02:13 +00:00
|
|
|
|
2017-12-14 14:26:57 +00:00
|
|
|
if [ "x$GTP" == "x--enable-gtp-linux" ]; then
|
|
|
|
osmo-build-dep.sh libgtpnl
|
|
|
|
fi
|
2017-09-05 20:35:10 +00:00
|
|
|
osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false
|
|
|
|
|
|
|
|
verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
|
|
|
|
|
|
|
|
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
|
|
|
|
export LD_LIBRARY_PATH="$inst/lib"
|
2018-11-29 13:16:27 +00:00
|
|
|
export PATH="$inst/bin:$PATH"
|
|
|
|
|
|
|
|
# Additional configure options and depends
|
|
|
|
CONFIG=""
|
|
|
|
if [ "$WITH_MANUALS" = "1" ]; then
|
|
|
|
CONFIG="--enable-manuals"
|
|
|
|
fi
|
2016-04-13 23:02:13 +00:00
|
|
|
|
2017-09-05 20:35:10 +00:00
|
|
|
set +x
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
2017-09-15 10:16:53 +00:00
|
|
|
echo " =============================== OsmoGGSN ==============================="
|
2017-09-05 20:35:10 +00:00
|
|
|
echo
|
|
|
|
set -x
|
2017-03-01 14:40:08 +00:00
|
|
|
|
2017-09-05 20:35:10 +00:00
|
|
|
cd "$base"
|
2016-04-13 23:02:13 +00:00
|
|
|
autoreconf --install --force
|
2018-11-29 13:16:27 +00:00
|
|
|
./configure --enable-sanitize --enable-werror $GTP $CONFIG
|
2017-09-05 20:35:10 +00:00
|
|
|
$MAKE $PARALLEL_MAKE
|
2020-10-12 17:32:31 +00:00
|
|
|
DISTCHECK_CONFIGURE_FLAGS="$CONFIG" $MAKE $PARALLEL_MAKE distcheck
|
2018-11-29 13:16:27 +00:00
|
|
|
|
|
|
|
if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
|
|
|
|
make -C "$base/doc/manuals" publish
|
|
|
|
fi
|
2017-10-27 20:54:29 +00:00
|
|
|
|
2020-10-12 17:32:31 +00:00
|
|
|
$MAKE $PARALLEL_MAKE maintainer-clean
|
2017-10-27 20:54:29 +00:00
|
|
|
osmo-clean-workspace.sh
|