Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Harald Welte | d4ee592 | 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 | 6802374 | 2018-11-29 14:20:29 +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 | d4ee592 | 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 | 8863f7a | 2017-10-27 20:14:29 +0200 | [diff] [blame] | 22 | osmo-clean-workspace.sh |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 23 | |
Neels Hofmeyr | 8863f7a | 2017-10-27 20:14:29 +0200 | [diff] [blame] | 24 | mkdir "$deps" || true |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 25 | osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 26 | |
Neels Hofmeyr | 1a232bd | 2017-08-26 21:19:35 +0200 | [diff] [blame] | 27 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
Neels Hofmeyr | ac27a99 | 2017-03-01 15:06:16 +0100 | [diff] [blame] | 28 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 29 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 30 | export LD_LIBRARY_PATH="$inst/lib" |
Oliver Smith | 6802374 | 2018-11-29 14:20:29 +0100 | [diff] [blame] | 31 | export PATH="$inst/bin:$PATH" |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 32 | |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 33 | osmo-build-dep.sh libosmo-abis |
Neels Hofmeyr | 4aa75e7 | 2017-03-31 14:03:39 +0200 | [diff] [blame] | 34 | osmo-build-dep.sh libosmo-netif |
Neels Hofmeyr | 9759374 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 35 | |
Oliver Smith | 6802374 | 2018-11-29 14:20:29 +0100 | [diff] [blame] | 36 | # Additional configure options and depends |
| 37 | CONFIG="" |
| 38 | if [ "$WITH_MANUALS" = "1" ]; then |
| 39 | osmo-build-dep.sh osmo-gsm-manuals |
| 40 | CONFIG="--enable-manuals" |
| 41 | fi |
| 42 | |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 43 | set +x |
| 44 | echo |
| 45 | echo |
| 46 | echo |
Neels Hofmeyr | e9920f2 | 2017-07-10 15:07:22 +0200 | [diff] [blame] | 47 | echo " =============================== osmo-mgw ===============================" |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 48 | echo |
| 49 | set -x |
| 50 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 51 | cd "$base" |
Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 52 | autoreconf --install --force |
Oliver Smith | 6802374 | 2018-11-29 14:20:29 +0100 | [diff] [blame] | 53 | ./configure --enable-vty-tests --enable-external-tests --enable-werror $CONFIG |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 54 | $MAKE $PARALLEL_MAKE |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 55 | LD_LIBRARY_PATH="$inst/lib" $MAKE check \ |
| 56 | || cat-testlogs.sh |
Neels Hofmeyr | 0bc77b1 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 57 | LD_LIBRARY_PATH="$inst/lib" \ |
Oliver Smith | 6802374 | 2018-11-29 14:20:29 +0100 | [diff] [blame] | 58 | DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests $CONFIG" \ |
Pau Espin Pedrol | 3840496 | 2020-10-12 19:34:58 +0200 | [diff] [blame] | 59 | $MAKE $PARALLEL_MAKE distcheck \ |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 60 | || cat-testlogs.sh |
Neels Hofmeyr | 8863f7a | 2017-10-27 20:14:29 +0200 | [diff] [blame] | 61 | |
Oliver Smith | 6802374 | 2018-11-29 14:20:29 +0100 | [diff] [blame] | 62 | if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then |
| 63 | make -C "$base/doc/manuals" publish |
| 64 | fi |
| 65 | |
Pau Espin Pedrol | 3840496 | 2020-10-12 19:34:58 +0200 | [diff] [blame] | 66 | $MAKE $PARALLEL_MAKE maintainer-clean |
Neels Hofmeyr | 8863f7a | 2017-10-27 20:14:29 +0200 | [diff] [blame] | 67 | osmo-clean-workspace.sh |