blob: 38bd1a9cf2454b43a57f791bfd4f23781e118397 [file] [log] [blame]
Harald Welte645fa462019-11-06 07:58:19 +01001#!/usr/bin/env bash
2# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org
3#
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#
8
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
14
15set -ex
16
17base="$PWD"
18deps="$base/deps"
19inst="$deps/install"
20export deps inst
21
22osmo-clean-workspace.sh
23
24mkdir "$deps" || true
25
26osmo-build-dep.sh libosmocore "" '--disable-doxygen --enable-gnutls'
27
28verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
29
30export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
31export LD_LIBRARY_PATH="$inst/lib"
32export PATH="$inst/bin:$PATH"
33
34osmo-build-dep.sh libosmo-abis
35
36# 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
43set +x
44echo
45echo
46echo
47echo " =============================== osmo-e1-recorder ==============================="
48echo
49set -x
50
51cd "$base"
52autoreconf --install --force
53./configure --enable-sanitize --enable-external-tests --enable-werror $CONFIG
54$MAKE $PARALLEL_MAKE
55LD_LIBRARY_PATH="$inst/lib" $MAKE check \
56 || cat-testlogs.sh
57LD_LIBRARY_PATH="$inst/lib" \
58 DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests --enable-werror $CONFIG" \
59 $MAKE distcheck \
60 || cat-testlogs.sh
61
62if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
63 make -C "$base/doc/manuals" publish
64fi
65
66$MAKE maintainer-clean
67osmo-clean-workspace.sh