blob: 9777d4bb660ae818987d8ef821562f2954c809cf [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
39 osmo-build-dep.sh osmo-gsm-manuals
40 CONFIG="--enable-manuals"
41fi
42
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020043set +x
44echo
45echo
46echo
Neels Hofmeyre9920f22017-07-10 15:07:22 +020047echo " =============================== osmo-mgw ==============================="
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020048echo
49set -x
50
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020051cd "$base"
Holger Hans Peter Freythera47b4012016-04-13 19:03:38 -040052autoreconf --install --force
Oliver Smith68023742018-11-29 14:20:29 +010053./configure --enable-vty-tests --enable-external-tests --enable-werror $CONFIG
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020054$MAKE $PARALLEL_MAKE
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020055LD_LIBRARY_PATH="$inst/lib" $MAKE check \
56 || cat-testlogs.sh
Neels Hofmeyr0bc77b12017-07-20 17:57:37 +020057LD_LIBRARY_PATH="$inst/lib" \
Oliver Smith68023742018-11-29 14:20:29 +010058 DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests $CONFIG" \
Neels Hofmeyr0bc77b12017-07-20 17:57:37 +020059 $MAKE distcheck \
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020060 || cat-testlogs.sh
Neels Hofmeyr8863f7a2017-10-27 20:14:29 +020061
Oliver Smith68023742018-11-29 14:20:29 +010062if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
63 make -C "$base/doc/manuals" publish
64fi
65
Neels Hofmeyr8863f7a2017-10-27 20:14:29 +020066osmo-clean-workspace.sh