blob: c67a1c389c99a85c3dbe420b846ff1e9d237f1e1 [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
Oliver Smith4b8be4d2018-11-28 14:57:25 +010038 CONFIG="--enable-manuals"
39fi
40
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010041set +x
42echo
43echo
44echo
45echo " =============================== osmo-hlr ==============================="
46echo
47set -x
48
49cd "$base"
50autoreconf --install --force
Oliver Smithf0e90e62020-01-30 09:55:00 +010051./configure \
52 --enable-sanitize \
53 --enable-external-tests \
54 --enable-mslookup-client-mdns-test \
55 --enable-werror \
56 $CONFIG
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010057$MAKE $PARALLEL_MAKE
Max33eeeef2017-11-23 16:56:24 +010058$MAKE check || cat-testlogs.sh
Pau Espin Pedrol89649ea2020-10-12 19:29:36 +020059DISTCHECK_CONFIGURE_FLAGS="$CONFIG" $MAKE $PARALLEL_MAKE distcheck || cat-testlogs.sh
Oliver Smith4b8be4d2018-11-28 14:57:25 +010060
61if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
62 make -C "$base/doc/manuals" publish
63fi
Neels Hofmeyrc6a6d262017-10-27 22:54:31 +020064
Pau Espin Pedrol89649ea2020-10-12 19:29:36 +020065$MAKE $PARALLEL_MAKE maintainer-clean
Neels Hofmeyrc6a6d262017-10-27 22:54:31 +020066osmo-clean-workspace.sh