blob: 1a58268dabf2ebd458eea6a4bd888578f66af961 [file] [log] [blame]
Holger Hans Peter Freyther81eb10c2016-04-13 19:03:38 -04001#!/usr/bin/env bash
Oliver Smith383baca2021-02-01 10:20:52 +01002# This is how we build on jenkins.osmocom.org
Oliver Smithd13baf62018-11-30 16:27:06 +01003#
4# environment variables:
Oliver Smithd13baf62018-11-30 16:27:06 +01005# * 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 Welte6b0701c2017-07-10 15:00:00 +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
Holger Hans Peter Freyther81eb10c2016-04-13 19:03:38 -040014
15set -ex
16
Neels Hofmeyra335ee32016-07-11 19:39:51 +020017base="$PWD"
18deps="$base/deps"
19inst="$deps/install"
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020020export deps inst
Holger Hans Peter Freyther81eb10c2016-04-13 19:03:38 -040021
Neels Hofmeyr4cd0b592017-10-27 22:54:46 +020022osmo-clean-workspace.sh
23
Neels Hofmeyra335ee32016-07-11 19:39:51 +020024mkdir "$deps" || true
Neels Hofmeyra335ee32016-07-11 19:39:51 +020025
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020026osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false
Neels Hofmeyra335ee32016-07-11 19:39:51 +020027
Neels Hofmeyrc37f3382017-08-26 21:19:35 +020028verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
Neels Hofmeyr69cdbe62017-03-01 15:06:16 +010029
Neels Hofmeyra335ee32016-07-11 19:39:51 +020030export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020031export LD_LIBRARY_PATH="$inst/lib"
Oliver Smithd13baf62018-11-30 16:27:06 +010032export PATH="$inst/bin:$PATH"
Neels Hofmeyra335ee32016-07-11 19:39:51 +020033
Oliver Smithd13baf62018-11-30 16:27:06 +010034# Additional configure options and depends
35CONFIG=""
36if [ "$WITH_MANUALS" = "1" ]; then
Oliver Smithd13baf62018-11-30 16:27:06 +010037 CONFIG="--enable-manuals"
38fi
39
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020040set +x
41echo
42echo
43echo
Oliver Smith383baca2021-02-01 10:20:52 +010044echo " =============================== osmo-gbproxy ==============================="
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020045echo
46set -x
47
Neels Hofmeyra335ee32016-07-11 19:39:51 +020048cd "$base"
Holger Hans Peter Freyther81eb10c2016-04-13 19:03:38 -040049autoreconf --install --force
Oliver Smith383baca2021-02-01 10:20:52 +010050./configure --enable-sanitize --enable-werror --enable-external-tests $CONFIG
Neels Hofmeyra335ee32016-07-11 19:39:51 +020051$MAKE $PARALLEL_MAKE
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020052LD_LIBRARY_PATH="$inst/lib" $MAKE check \
53 || cat-testlogs.sh
Neels Hofmeyrc07d6352017-07-20 17:57:37 +020054LD_LIBRARY_PATH="$inst/lib" \
Oliver Smith383baca2021-02-01 10:20:52 +010055 DISTCHECK_CONFIGURE_FLAGS="--enable-werror --enable-external-tests $CONFIG" \
Pau Espin Pedrold8645a02020-10-12 19:34:04 +020056 $MAKE $PARALLEL_MAKE distcheck \
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020057 || cat-testlogs.sh
Neels Hofmeyr4cd0b592017-10-27 22:54:46 +020058
Oliver Smithd13baf62018-11-30 16:27:06 +010059if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
60 make -C "$base/doc/manuals" publish
61fi
62
Pau Espin Pedrold8645a02020-10-12 19:34:04 +020063$MAKE $PARALLEL_MAKE maintainer-clean
Neels Hofmeyr4cd0b592017-10-27 22:54:46 +020064osmo-clean-workspace.sh