blob: 51583f8f4b56a75c57f768b6f2535ac41335d928 [file] [log] [blame]
Holger Hans Peter Freyther81eb10c2016-04-13 19:03:38 -04001#!/usr/bin/env bash
Harald Welte6b0701c2017-07-10 15:00:00 +02002# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org
Oliver Smithd13baf62018-11-30 16:27:06 +01003#
4# environment variables:
5# * IU: configure 3G support (values: "--enable-iu", "--disable-iu")
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 Welte6b0701c2017-07-10 15:00:00 +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 Freyther81eb10c2016-04-13 19:03:38 -040015
16set -ex
17
Neels Hofmeyra335ee32016-07-11 19:39:51 +020018base="$PWD"
19deps="$base/deps"
20inst="$deps/install"
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020021export deps inst
Holger Hans Peter Freyther81eb10c2016-04-13 19:03:38 -040022
Neels Hofmeyr4cd0b592017-10-27 22:54:46 +020023osmo-clean-workspace.sh
24
Neels Hofmeyra335ee32016-07-11 19:39:51 +020025mkdir "$deps" || true
Neels Hofmeyra335ee32016-07-11 19:39:51 +020026
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020027osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false
Neels Hofmeyra335ee32016-07-11 19:39:51 +020028
Neels Hofmeyrc37f3382017-08-26 21:19:35 +020029verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
Neels Hofmeyr69cdbe62017-03-01 15:06:16 +010030
Neels Hofmeyra335ee32016-07-11 19:39:51 +020031export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020032export LD_LIBRARY_PATH="$inst/lib"
Oliver Smithd13baf62018-11-30 16:27:06 +010033export PATH="$inst/bin:$PATH"
Neels Hofmeyra335ee32016-07-11 19:39:51 +020034
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020035osmo-build-dep.sh libosmo-abis
Neels Hofmeyr3905e702017-03-31 14:03:39 +020036osmo-build-dep.sh libosmo-netif
Maxb83d1252017-09-28 16:37:48 +020037osmo-build-dep.sh osmo-ggsn
Harald Welted8f89452018-09-16 07:53:41 +020038osmo-build-dep.sh osmo-hlr
Neels Hofmeyra335ee32016-07-11 19:39:51 +020039
Pau Espin Pedrolbc89ed02018-06-20 23:48:00 +020040enable_werror=""
Neels Hofmeyr58996b72016-07-11 19:44:58 +020041if [ "x$IU" = "x--enable-iu" ]; then
Maxb9b62402017-10-26 15:15:53 +020042 osmo-build-dep.sh libosmo-sccp
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020043 osmo-build-dep.sh libasn1c
44 #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh
Philipp Maier68760a82017-04-09 12:32:51 +020045 osmo-build-dep.sh osmo-iuh
Pau Espin Pedrolbc89ed02018-06-20 23:48:00 +020046else
47 enable_werror="--enable-werror"
Neels Hofmeyr58996b72016-07-11 19:44:58 +020048fi
49
Oliver Smithd13baf62018-11-30 16:27:06 +010050# Additional configure options and depends
51CONFIG=""
52if [ "$WITH_MANUALS" = "1" ]; then
53 osmo-build-dep.sh osmo-gsm-manuals
54 CONFIG="--enable-manuals"
55fi
56
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020057set +x
58echo
59echo
60echo
Neels Hofmeyr91d2c592017-09-28 16:20:34 +020061echo " =============================== osmo-sgsn ==============================="
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020062echo
63set -x
64
Neels Hofmeyra335ee32016-07-11 19:39:51 +020065cd "$base"
Holger Hans Peter Freyther81eb10c2016-04-13 19:03:38 -040066autoreconf --install --force
Oliver Smithd13baf62018-11-30 16:27:06 +010067./configure --enable-sanitize $enable_werror $IU --enable-external-tests $CONFIG
Neels Hofmeyra335ee32016-07-11 19:39:51 +020068$MAKE $PARALLEL_MAKE
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020069LD_LIBRARY_PATH="$inst/lib" $MAKE check \
70 || cat-testlogs.sh
Neels Hofmeyrc07d6352017-07-20 17:57:37 +020071LD_LIBRARY_PATH="$inst/lib" \
Oliver Smithd13baf62018-11-30 16:27:06 +010072 DISTCHECK_CONFIGURE_FLAGS="$enable_werror $IU --enable-external-tests $CONFIG" \
Neels Hofmeyrc07d6352017-07-20 17:57:37 +020073 $MAKE distcheck \
Neels Hofmeyrb88a18c2016-10-07 00:58:22 +020074 || cat-testlogs.sh
Neels Hofmeyr4cd0b592017-10-27 22:54:46 +020075
Oliver Smithd13baf62018-11-30 16:27:06 +010076if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
77 make -C "$base/doc/manuals" publish
78fi
79
Oliver Smith54138652019-07-10 13:24:35 +020080$MAKE maintainer-clean
Neels Hofmeyr4cd0b592017-10-27 22:54:46 +020081osmo-clean-workspace.sh