blob: 21f4c684ecbddd840fa97fc833337a703b6bec36 [file] [log] [blame]
Holger Hans Peter Freythera47b4012016-04-13 19:03:38 -04001#!/usr/bin/env bash
Harald Welted4ee5922017-07-10 15:00:00 +02002# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org
Oliver Smith68023742018-11-29 14:20:29 +01003#
4# environment variables:
5# * WITH_MANUALS: build manual PDFs if set to "1"
6# * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1")
7#
Harald Welted4ee5922017-07-10 15:00:00 +02008
9if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then
10 echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
11 exit 2
12fi
13
Holger Hans Peter Freythera47b4012016-04-13 19:03:38 -040014
15set -ex
16
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020017base="$PWD"
18deps="$base/deps"
19inst="$deps/install"
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020020export deps inst
Holger Hans Peter Freythera47b4012016-04-13 19:03:38 -040021
Neels Hofmeyr8863f7a2017-10-27 20:14:29 +020022osmo-clean-workspace.sh
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020023
Neels Hofmeyr8863f7a2017-10-27 20:14:29 +020024mkdir "$deps" || true
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020025osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020026
Neels Hofmeyr1a232bd2017-08-26 21:19:35 +020027verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
Neels Hofmeyrac27a992017-03-01 15:06:16 +010028
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020029export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020030export LD_LIBRARY_PATH="$inst/lib"
Oliver Smith68023742018-11-29 14:20:29 +010031export PATH="$inst/bin:$PATH"
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020032
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020033osmo-build-dep.sh libosmo-abis
Neels Hofmeyr4aa75e72017-03-31 14:03:39 +020034osmo-build-dep.sh libosmo-netif
Neels Hofmeyr97593742016-07-11 19:44:58 +020035
Oliver Smith68023742018-11-29 14:20:29 +010036# Additional configure options and depends
37CONFIG=""
38if [ "$WITH_MANUALS" = "1" ]; then
Oliver Smith68023742018-11-29 14:20:29 +010039 CONFIG="--enable-manuals"
40fi
41
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020042set +x
43echo
44echo
45echo
Neels Hofmeyre9920f22017-07-10 15:07:22 +020046echo " =============================== osmo-mgw ==============================="
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020047echo
48set -x
49
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020050cd "$base"
Holger Hans Peter Freythera47b4012016-04-13 19:03:38 -040051autoreconf --install --force
Daniel Willmann41ab87f2021-07-23 15:16:43 +020052./configure --enable-sanitize --enable-vty-tests --enable-external-tests --enable-werror $CONFIG
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020053$MAKE $PARALLEL_MAKE
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020054LD_LIBRARY_PATH="$inst/lib" $MAKE check \
55 || cat-testlogs.sh
Neels Hofmeyr0bc77b12017-07-20 17:57:37 +020056LD_LIBRARY_PATH="$inst/lib" \
Oliver Smith68023742018-11-29 14:20:29 +010057 DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests $CONFIG" \
Pau Espin Pedrol38404962020-10-12 19:34:58 +020058 $MAKE $PARALLEL_MAKE distcheck \
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020059 || cat-testlogs.sh
Neels Hofmeyr8863f7a2017-10-27 20:14:29 +020060
Oliver Smith68023742018-11-29 14:20:29 +010061if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
62 make -C "$base/doc/manuals" publish
63fi
64
Pau Espin Pedrol38404962020-10-12 19:34:58 +020065$MAKE $PARALLEL_MAKE maintainer-clean
Neels Hofmeyr8863f7a2017-10-27 20:14:29 +020066osmo-clean-workspace.sh