blob: b88d812875d027641e55e392a07a90d05e657ad4 [file] [log] [blame]
Harald Welteb53e2bf2020-08-21 16:33:42 +02001#!/usr/bin/env bash
2# jenkins build helper script for osmo-smlc. 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-netif
35osmo-build-dep.sh libosmo-sccp
36
37# Additional configure options and depends
38CONFIG=""
39if [ "$WITH_MANUALS" = "1" ]; then
40 osmo-build-dep.sh osmo-gsm-manuals
41 CONFIG="--enable-manuals"
42fi
43
44set +x
45echo
46echo
47echo
48echo " =============================== osmo-smlc ==============================="
49echo
50set -x
51
52cd "$base"
53autoreconf --install --force
54./configure --enable-sanitize --enable-external-tests --enable-werror $CONFIG
55$MAKE $PARALLEL_MAKE
56LD_LIBRARY_PATH="$inst/lib" $MAKE check \
57 || cat-testlogs.sh
58LD_LIBRARY_PATH="$inst/lib" \
59 DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests --enable-werror $CONFIG" \
60 $MAKE distcheck \
61 || cat-testlogs.sh
62
63if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
64 make -C "$base/doc/manuals" publish
65fi
66
67$MAKE maintainer-clean
68osmo-clean-workspace.sh