2016-04-13 23:03:38 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-07-10 13:00:00 +00:00
|
|
|
# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org
|
2018-11-30 15:27:06 +00:00
|
|
|
#
|
|
|
|
# environment variables:
|
|
|
|
# * IU: configure 3G support (values: "--enable-iu", "--disable-iu")
|
|
|
|
# * 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
|
|
|
|
|
|
|
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:03:38 +00:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2016-07-11 17:39:51 +00:00
|
|
|
base="$PWD"
|
|
|
|
deps="$base/deps"
|
|
|
|
inst="$deps/install"
|
2016-10-06 22:58:22 +00:00
|
|
|
export deps inst
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2017-10-27 20:54:46 +00:00
|
|
|
osmo-clean-workspace.sh
|
|
|
|
|
2016-07-11 17:39:51 +00:00
|
|
|
mkdir "$deps" || true
|
|
|
|
|
2016-10-06 22:58:22 +00:00
|
|
|
osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2017-08-26 19:19:35 +00:00
|
|
|
verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
|
2017-03-01 14:06:16 +00:00
|
|
|
|
2016-07-11 17:39:51 +00:00
|
|
|
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
|
2016-10-06 22:58:22 +00:00
|
|
|
export LD_LIBRARY_PATH="$inst/lib"
|
2018-11-30 15:27:06 +00:00
|
|
|
export PATH="$inst/bin:$PATH"
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2016-10-06 22:58:22 +00:00
|
|
|
osmo-build-dep.sh libosmo-abis
|
2017-03-31 12:03:39 +00:00
|
|
|
osmo-build-dep.sh libosmo-netif
|
2017-09-28 14:37:48 +00:00
|
|
|
osmo-build-dep.sh osmo-ggsn
|
2018-09-16 05:53:41 +00:00
|
|
|
osmo-build-dep.sh osmo-hlr
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2016-07-11 17:44:58 +00:00
|
|
|
if [ "x$IU" = "x--enable-iu" ]; then
|
2017-10-26 13:15:53 +00:00
|
|
|
osmo-build-dep.sh libosmo-sccp
|
2016-10-06 22:58:22 +00:00
|
|
|
osmo-build-dep.sh libasn1c
|
|
|
|
#osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh
|
2017-04-09 10:32:51 +00:00
|
|
|
osmo-build-dep.sh osmo-iuh
|
2016-07-11 17:44:58 +00:00
|
|
|
fi
|
|
|
|
|
2018-11-30 15:27:06 +00:00
|
|
|
# Additional configure options and depends
|
|
|
|
CONFIG=""
|
|
|
|
if [ "$WITH_MANUALS" = "1" ]; then
|
|
|
|
CONFIG="--enable-manuals"
|
|
|
|
fi
|
|
|
|
|
2016-10-06 22:58:22 +00:00
|
|
|
set +x
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
2017-09-28 14:20:34 +00:00
|
|
|
echo " =============================== osmo-sgsn ==============================="
|
2016-10-06 22:58:22 +00:00
|
|
|
echo
|
|
|
|
set -x
|
|
|
|
|
2016-07-11 17:39:51 +00:00
|
|
|
cd "$base"
|
2016-04-13 23:03:38 +00:00
|
|
|
autoreconf --install --force
|
2022-11-15 12:01:25 +00:00
|
|
|
./configure --enable-sanitize --enable-werror $IU --enable-external-tests $CONFIG
|
2016-07-11 17:39:51 +00:00
|
|
|
$MAKE $PARALLEL_MAKE
|
2016-10-06 22:58:22 +00:00
|
|
|
LD_LIBRARY_PATH="$inst/lib" $MAKE check \
|
|
|
|
|| cat-testlogs.sh
|
2017-07-20 15:57:37 +00:00
|
|
|
LD_LIBRARY_PATH="$inst/lib" \
|
2022-11-15 12:01:25 +00:00
|
|
|
DISTCHECK_CONFIGURE_FLAGS="--enable-werror $IU --enable-external-tests $CONFIG" \
|
2020-10-12 17:34:04 +00:00
|
|
|
$MAKE $PARALLEL_MAKE distcheck \
|
2016-10-06 22:58:22 +00:00
|
|
|
|| cat-testlogs.sh
|
2017-10-27 20:54:46 +00:00
|
|
|
|
2018-11-30 15:27:06 +00:00
|
|
|
if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
|
|
|
|
make -C "$base/doc/manuals" publish
|
|
|
|
fi
|
|
|
|
|
2020-10-12 17:34:04 +00:00
|
|
|
$MAKE $PARALLEL_MAKE maintainer-clean
|
2017-10-27 20:54:46 +00:00
|
|
|
osmo-clean-workspace.sh
|