blob: 1dadac3057103f5338ba6753a9cb8d1ee5254599 [file] [log] [blame]
Neels Hofmeyr40d8b012016-12-11 00:27:48 +01001#!/bin/sh
Harald Welte0b1b6b12017-07-10 15:05:03 +02002# jenkins build helper script for osmo-hlr. This is how we build on jenkins.osmocom.org
Oliver Smith4b8be4d2018-11-28 14:57:25 +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 Welte0b1b6b12017-07-10 15:05:03 +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
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010014
15set -ex
16
17base="$PWD"
18deps="$base/deps"
19inst="$deps/install"
20export deps inst
21
Neels Hofmeyrc6a6d262017-10-27 22:54:31 +020022osmo-clean-workspace.sh
23
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010024mkdir "$deps" || true
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010025
Max05c8b462017-08-25 17:47:42 +020026verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
27
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010028export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
29export LD_LIBRARY_PATH="$inst/lib"
Oliver Smith4b8be4d2018-11-28 14:57:25 +010030export PATH="$inst/bin:$PATH"
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010031
32osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010033osmo-build-dep.sh libosmo-abis
34
Oliver Smith4b8be4d2018-11-28 14:57:25 +010035# Additional configure options and depends
36CONFIG=""
37if [ "$WITH_MANUALS" = "1" ]; then
38 osmo-build-dep.sh osmo-gsm-manuals
39 CONFIG="--enable-manuals"
40fi
41
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010042set +x
43echo
44echo
45echo
46echo " =============================== osmo-hlr ==============================="
47echo
48set -x
49
50cd "$base"
51autoreconf --install --force
Oliver Smith4b8be4d2018-11-28 14:57:25 +010052./configure --enable-sanitize --enable-external-tests --enable-werror $CONFIG
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010053$MAKE $PARALLEL_MAKE
Max33eeeef2017-11-23 16:56:24 +010054$MAKE check || cat-testlogs.sh
Oliver Smith4b8be4d2018-11-28 14:57:25 +010055DISTCHECK_CONFIGURE_FLAGS="$CONFIG" $MAKE distcheck || cat-testlogs.sh
56
57if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
58 make -C "$base/doc/manuals" publish
59fi
Neels Hofmeyrc6a6d262017-10-27 22:54:31 +020060
61osmo-clean-workspace.sh