blob: 4565a80f7bea5c5230491a6b2451f83f3ae90c69 [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
Harald Welte81e62272022-11-06 10:31:34 +010010 echo "Error: We need to have scripts/osmo-deps.sh from https://gitea.osmocom.org/osmocom/osmo-ci in PATH !"
Harald Welte645fa462019-11-06 07:58:19 +010011 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
Harald Welte645fa462019-11-06 07:58:19 +010039 CONFIG="--enable-manuals"
40fi
41
42set +x
43echo
44echo
45echo
46echo " =============================== osmo-e1-recorder ==============================="
47echo
48set -x
49
50cd "$base"
51autoreconf --install --force
52./configure --enable-sanitize --enable-external-tests --enable-werror $CONFIG
53$MAKE $PARALLEL_MAKE
54LD_LIBRARY_PATH="$inst/lib" $MAKE check \
55 || cat-testlogs.sh
56LD_LIBRARY_PATH="$inst/lib" \
57 DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests --enable-werror $CONFIG" \
58 $MAKE distcheck \
59 || cat-testlogs.sh
60
Harald Welte54fc2232019-12-04 13:57:24 +010061#if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
62# make -C "$base/doc/manuals" publish
63#fi
Harald Welte645fa462019-11-06 07:58:19 +010064
65$MAKE maintainer-clean
66osmo-clean-workspace.sh