Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Harald Welte | 5f4c357 | 2017-07-10 15:00:00 +0200 | [diff] [blame] | 2 | # jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org |
Oliver Smith | ab9a259 | 2018-11-28 11:33:39 +0100 | [diff] [blame] | 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 | # |
Harald Welte | 5f4c357 | 2017-07-10 15:00:00 +0200 | [diff] [blame] | 8 | |
| 9 | if ! [ -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 |
| 12 | fi |
| 13 | |
Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 14 | |
| 15 | set -ex |
| 16 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 17 | base="$PWD" |
| 18 | deps="$base/deps" |
| 19 | inst="$deps/install" |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 20 | export deps inst |
Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 21 | |
Neels Hofmeyr | c752351 | 2017-10-27 22:54:22 +0200 | [diff] [blame] | 22 | osmo-clean-workspace.sh |
| 23 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 24 | mkdir "$deps" || true |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 25 | |
Max | ad1e3cd | 2017-12-21 15:00:33 +0100 | [diff] [blame] | 26 | osmo-build-dep.sh libosmocore "" '--disable-doxygen --enable-gnutls' |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 27 | |
Neels Hofmeyr | 33c5994 | 2017-08-26 21:19:35 +0200 | [diff] [blame] | 28 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
Neels Hofmeyr | ac27a99 | 2017-03-01 15:06:16 +0100 | [diff] [blame] | 29 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 30 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 31 | export LD_LIBRARY_PATH="$inst/lib" |
Oliver Smith | ab9a259 | 2018-11-28 11:33:39 +0100 | [diff] [blame] | 32 | export PATH="$inst/bin:$PATH" |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 33 | |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 34 | osmo-build-dep.sh libosmo-abis |
Neels Hofmeyr | 4aa75e7 | 2017-03-31 14:03:39 +0200 | [diff] [blame] | 35 | osmo-build-dep.sh libosmo-netif |
Philipp Maier | 39f62bb | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 36 | osmo-build-dep.sh libosmo-sccp |
Neels Hofmeyr | 174e5dc | 2017-09-03 22:45:09 +0200 | [diff] [blame] | 37 | osmo-build-dep.sh osmo-mgw |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 38 | |
Oliver Smith | ab9a259 | 2018-11-28 11:33:39 +0100 | [diff] [blame] | 39 | # Additional configure options and depends |
| 40 | CONFIG="" |
| 41 | if [ "$WITH_MANUALS" = "1" ]; then |
| 42 | osmo-build-dep.sh osmo-gsm-manuals |
| 43 | CONFIG="--enable-manuals" |
| 44 | fi |
| 45 | |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 46 | set +x |
| 47 | echo |
| 48 | echo |
| 49 | echo |
Max | 9cc7044 | 2017-09-23 14:15:46 +0200 | [diff] [blame] | 50 | echo " =============================== osmo-bsc ===============================" |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 51 | echo |
| 52 | set -x |
| 53 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 54 | cd "$base" |
Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 55 | autoreconf --install --force |
Oliver Smith | ab9a259 | 2018-11-28 11:33:39 +0100 | [diff] [blame] | 56 | ./configure --enable-sanitize --enable-external-tests --enable-werror $CONFIG |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 57 | $MAKE $PARALLEL_MAKE |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 58 | LD_LIBRARY_PATH="$inst/lib" $MAKE check \ |
| 59 | || cat-testlogs.sh |
Neels Hofmeyr | 1ea43f8 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 60 | LD_LIBRARY_PATH="$inst/lib" \ |
Oliver Smith | ab9a259 | 2018-11-28 11:33:39 +0100 | [diff] [blame] | 61 | DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests --enable-werror $CONFIG" \ |
Neels Hofmeyr | 1ea43f8 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 62 | $MAKE distcheck \ |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 63 | || cat-testlogs.sh |
Neels Hofmeyr | c752351 | 2017-10-27 22:54:22 +0200 | [diff] [blame] | 64 | |
Oliver Smith | ab9a259 | 2018-11-28 11:33:39 +0100 | [diff] [blame] | 65 | if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then |
| 66 | make -C "$base/doc/manuals" publish |
| 67 | fi |
| 68 | |
Oliver Smith | 14c80fd | 2019-07-11 09:25:49 +0200 | [diff] [blame] | 69 | $MAKE maintainer-clean |
Neels Hofmeyr | c752351 | 2017-10-27 22:54:22 +0200 | [diff] [blame] | 70 | osmo-clean-workspace.sh |