blob: be8dadcf7a592ef2f13e0cec5e71e6263c86252f [file] [log] [blame]
Holger Hans Peter Freythera47b4012016-04-13 19:03:38 -04001#!/usr/bin/env bash
Harald Weltee2e41c12017-07-10 15:00:00 +02002# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org
Oliver Smith42a6c392018-11-29 14:31:32 +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 Weltee2e41c12017-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 Freythera47b4012016-04-13 19:03:38 -040015
16set -ex
17
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020018base="$PWD"
19deps="$base/deps"
20inst="$deps/install"
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020021export deps inst
Holger Hans Peter Freythera47b4012016-04-13 19:03:38 -040022
Neels Hofmeyr7f5ab9e2017-10-27 22:54:40 +020023osmo-clean-workspace.sh
24
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020025mkdir "$deps" || true
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020026
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020027osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020028
Neels Hofmeyr6ecdbc92017-08-26 21:19:35 +020029verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
Neels Hofmeyrac27a992017-03-01 15:06:16 +010030
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020031export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020032export LD_LIBRARY_PATH="$inst/lib"
Oliver Smith42a6c392018-11-29 14:31:32 +010033export PATH="$inst/bin:$PATH"
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020034
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020035osmo-build-dep.sh libosmo-abis
Neels Hofmeyr4aa75e72017-03-31 14:03:39 +020036osmo-build-dep.sh libosmo-netif
Philipp Maierfbf66102017-04-09 12:32:51 +020037osmo-build-dep.sh libosmo-sccp
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020038PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34
Neels Hofmeyrcf6a4872017-09-03 22:47:51 +020039osmo-build-dep.sh osmo-mgw
Harald Welte1ea6baf2018-07-31 19:40:52 +020040osmo-build-dep.sh osmo-hlr
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020041
Pau Espin Pedrolcaf2fe52018-06-20 23:39:13 +020042enable_werror=""
Neels Hofmeyr97593742016-07-11 19:44:58 +020043if [ "x$IU" = "x--enable-iu" ]; then
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020044 osmo-build-dep.sh libasn1c
45 #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh
Philipp Maierfbf66102017-04-09 12:32:51 +020046 osmo-build-dep.sh osmo-iuh
Pau Espin Pedrolcaf2fe52018-06-20 23:39:13 +020047else
48 enable_werror="--enable-werror"
Neels Hofmeyr97593742016-07-11 19:44:58 +020049fi
50
Oliver Smith42a6c392018-11-29 14:31:32 +010051# Additional configure options and depends
52CONFIG=""
53if [ "$WITH_MANUALS" = "1" ]; then
54 osmo-build-dep.sh osmo-gsm-manuals
55 CONFIG="--enable-manuals"
56fi
57
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020058set +x
59echo
60echo
61echo
Neels Hofmeyrf29ff882017-07-12 23:37:05 +020062echo " =============================== osmo-msc ==============================="
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020063echo
64set -x
65
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020066cd "$base"
Holger Hans Peter Freythera47b4012016-04-13 19:03:38 -040067autoreconf --install --force
Oliver Smith42a6c392018-11-29 14:31:32 +010068./configure --enable-sanitize $enable_werror --enable-smpp $IU --enable-external-tests $CONFIG
Neels Hofmeyra3d93ed2016-07-11 19:39:51 +020069$MAKE $PARALLEL_MAKE
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020070LD_LIBRARY_PATH="$inst/lib" $MAKE check \
71 || cat-testlogs.sh
Neels Hofmeyr53edff32017-07-20 17:57:37 +020072LD_LIBRARY_PATH="$inst/lib" \
Oliver Smith42a6c392018-11-29 14:31:32 +010073 DISTCHECK_CONFIGURE_FLAGS="$enable_werror --enable-smpp $IU --enable-external-tests $CONFIG" \
Neels Hofmeyr53edff32017-07-20 17:57:37 +020074 $MAKE distcheck \
Neels Hofmeyrf1a56de2016-10-07 00:58:22 +020075 || cat-testlogs.sh
Neels Hofmeyr7f5ab9e2017-10-27 22:54:40 +020076
Oliver Smith42a6c392018-11-29 14:31:32 +010077if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
78 make -C "$base/doc/manuals" publish
79fi
80
Neels Hofmeyr7f5ab9e2017-10-27 22:54:40 +020081osmo-clean-workspace.sh