blob: 37a779c4b9ff2e65cfd8bfe1f3e5baf72e007469 [file] [log] [blame]
Harald Weltec7b5c7a2018-10-14 20:42:56 +02001#!/bin/sh
2# jenkins build helper script for libosmo-abis. This is how we build on jenkins.osmocom.org
Harald Welte753d2b52020-03-04 17:51: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 Weltec7b5c7a2018-10-14 20:42:56 +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
14set -ex
15
16base="$PWD"
17deps="$base/deps"
18inst="$deps/install"
19export deps inst
20
21osmo-clean-workspace.sh
22
23mkdir "$deps" || true
24
Harald Welte8c1ca1b2019-12-17 13:26:42 +010025verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]" -not -path "./deps/*")
Harald Weltec7b5c7a2018-10-14 20:42:56 +020026
Harald Welte72f702c2018-10-15 01:51:22 +020027export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
28export LD_LIBRARY_PATH="$inst/lib"
Harald Welte753d2b52020-03-04 17:51:29 +010029export PATH="$inst/bin:$PATH"
Harald Welte72f702c2018-10-15 01:51:22 +020030
Harald Weltec7b5c7a2018-10-14 20:42:56 +020031osmo-build-dep.sh libosmocore "" --disable-doxygen
Harald Welte80a83cc2018-10-15 01:48:28 +020032osmo-build-dep.sh libosmo-abis
33osmo-build-dep.sh libosmo-netif
Harald Weltefd5dafc2019-12-15 21:14:14 +010034osmo-build-dep.sh simtrace2
Harald Weltec7b5c7a2018-10-14 20:42:56 +020035
Harald Welte753d2b52020-03-04 17:51:29 +010036# Additional configure options and depends
37CONFIG=""
38if [ "$WITH_MANUALS" = "1" ]; then
Harald Welte753d2b52020-03-04 17:51:29 +010039 CONFIG="--enable-manuals"
40fi
41
Harald Weltec7b5c7a2018-10-14 20:42:56 +020042set +x
43echo
44echo
45echo
Harald Welte61df6c32018-10-15 01:51:53 +020046echo " =============================== osmo-remsim ==============================="
Harald Weltec7b5c7a2018-10-14 20:42:56 +020047echo
48set -x
49
Harald Welte753d2b52020-03-04 17:51:29 +010050cd "$base"
Harald Weltec7b5c7a2018-10-14 20:42:56 +020051autoreconf --install --force
Harald Welte753d2b52020-03-04 17:51:29 +010052./configure --enable-sanitize --enable-werror $CONFIG
Harald Weltec7b5c7a2018-10-14 20:42:56 +020053$MAKE $PARALLEL_MAKE
Harald Welte753d2b52020-03-04 17:51:29 +010054LD_LIBRARY_PATH="$inst/lib" \
55 DISTCHCK_CONFIGURE_FLAGS="--enable-werror $CONFIG" \
56 $MAKE distcheck \
Harald Weltec7b5c7a2018-10-14 20:42:56 +020057 || cat-testlogs.sh
Harald Weltec7b5c7a2018-10-14 20:42:56 +020058
Harald Welte753d2b52020-03-04 17:51:29 +010059if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
60 make -C "$base/doc/manuals" publish
61fi
62
63$MAKE maintainer-clean
Harald Weltec7b5c7a2018-10-14 20:42:56 +020064osmo-clean-workspace.sh