blob: 2c03c091e588605162e792cef29df46fa0b31ed0 [file] [log] [blame]
Harald Weltee57cbe22017-09-05 22:35:10 +02001#!/usr/bin/env bash
2# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org
Oliver Smith33c537e2018-11-29 14:16:27 +01003#
4# environment variables:
5# * GTP: configure GTP tunneling Linux kernel (values: "--enable-gtp-linux" or "--disable-gtp-linux")
6# * WITH_MANUALS: build manual PDFs if set to "1"
7# * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1")
8#
Harald Weltee57cbe22017-09-05 22:35:10 +02009
10if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then
11 echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
12 exit 2
13fi
14
Holger Hans Peter Freytherb29ff1d2016-04-13 19:02:13 -040015
16set -ex
17
Harald Weltee57cbe22017-09-05 22:35:10 +020018base="$PWD"
19deps="$base/deps"
20inst="$deps/install"
21export deps inst
22
Neels Hofmeyr29caaab2017-10-27 22:54:29 +020023osmo-clean-workspace.sh
24
Harald Weltee57cbe22017-09-05 22:35:10 +020025mkdir "$deps" || true
Harald Weltee57cbe22017-09-05 22:35:10 +020026
Pau Espin Pedrol077b9032017-12-14 15:26:57 +010027if [ "x$GTP" == "x--enable-gtp-linux" ]; then
28 osmo-build-dep.sh libgtpnl
29fi
Harald Weltee57cbe22017-09-05 22:35:10 +020030osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false
31
Maxb87da752017-08-25 17:37:36 +020032verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
33
Harald Weltee57cbe22017-09-05 22:35:10 +020034export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
35export LD_LIBRARY_PATH="$inst/lib"
Oliver Smith33c537e2018-11-29 14:16:27 +010036export PATH="$inst/bin:$PATH"
37
38# Additional configure options and depends
39CONFIG=""
40if [ "$WITH_MANUALS" = "1" ]; then
41 osmo-build-dep.sh osmo-gsm-manuals
42 CONFIG="--enable-manuals"
43fi
Holger Hans Peter Freytherb29ff1d2016-04-13 19:02:13 -040044
Harald Weltee57cbe22017-09-05 22:35:10 +020045set +x
46echo
47echo
48echo
Maxea70f362017-09-15 12:16:53 +020049echo " =============================== OsmoGGSN ==============================="
Harald Weltee57cbe22017-09-05 22:35:10 +020050echo
51set -x
52
53cd "$base"
Holger Hans Peter Freytherb29ff1d2016-04-13 19:02:13 -040054autoreconf --install --force
Oliver Smith33c537e2018-11-29 14:16:27 +010055./configure --enable-sanitize --enable-werror $GTP $CONFIG
Harald Weltee57cbe22017-09-05 22:35:10 +020056$MAKE $PARALLEL_MAKE
Oliver Smith33c537e2018-11-29 14:16:27 +010057DISTCHECK_CONFIGURE_FLAGS="$CONFIG" $MAKE distcheck
58
59if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
60 make -C "$base/doc/manuals" publish
61fi
Neels Hofmeyr29caaab2017-10-27 22:54:29 +020062
Oliver Smithad252e72019-07-10 12:25:35 +020063$MAKE maintainer-clean
Neels Hofmeyr29caaab2017-10-27 22:54:29 +020064osmo-clean-workspace.sh