Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 1 | #!/bin/sh |
Harald Welte | 0b1b6b1 | 2017-07-10 15:05:03 +0200 | [diff] [blame] | 2 | # jenkins build helper script for osmo-hlr. This is how we build on jenkins.osmocom.org |
Oliver Smith | 4b8be4d | 2018-11-28 14:57:25 +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 | 0b1b6b1 | 2017-07-10 15:05:03 +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 | |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 14 | |
| 15 | set -ex |
| 16 | |
| 17 | base="$PWD" |
| 18 | deps="$base/deps" |
| 19 | inst="$deps/install" |
| 20 | export deps inst |
| 21 | |
Neels Hofmeyr | c6a6d26 | 2017-10-27 22:54:31 +0200 | [diff] [blame] | 22 | osmo-clean-workspace.sh |
| 23 | |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 24 | mkdir "$deps" || true |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 25 | |
Max | 05c8b46 | 2017-08-25 17:47:42 +0200 | [diff] [blame] | 26 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
| 27 | |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 28 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
| 29 | export LD_LIBRARY_PATH="$inst/lib" |
Oliver Smith | 4b8be4d | 2018-11-28 14:57:25 +0100 | [diff] [blame] | 30 | export PATH="$inst/bin:$PATH" |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 31 | |
| 32 | osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 33 | osmo-build-dep.sh libosmo-abis |
| 34 | |
Oliver Smith | 4b8be4d | 2018-11-28 14:57:25 +0100 | [diff] [blame] | 35 | # Additional configure options and depends |
| 36 | CONFIG="" |
| 37 | if [ "$WITH_MANUALS" = "1" ]; then |
| 38 | osmo-build-dep.sh osmo-gsm-manuals |
| 39 | CONFIG="--enable-manuals" |
| 40 | fi |
| 41 | |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 42 | set +x |
| 43 | echo |
| 44 | echo |
| 45 | echo |
| 46 | echo " =============================== osmo-hlr ===============================" |
| 47 | echo |
| 48 | set -x |
| 49 | |
| 50 | cd "$base" |
| 51 | autoreconf --install --force |
Oliver Smith | f0e90e6 | 2020-01-30 09:55:00 +0100 | [diff] [blame] | 52 | ./configure \ |
| 53 | --enable-sanitize \ |
| 54 | --enable-external-tests \ |
| 55 | --enable-mslookup-client-mdns-test \ |
| 56 | --enable-werror \ |
| 57 | $CONFIG |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 58 | $MAKE $PARALLEL_MAKE |
Max | 33eeeef | 2017-11-23 16:56:24 +0100 | [diff] [blame] | 59 | $MAKE check || cat-testlogs.sh |
Oliver Smith | 4b8be4d | 2018-11-28 14:57:25 +0100 | [diff] [blame] | 60 | DISTCHECK_CONFIGURE_FLAGS="$CONFIG" $MAKE distcheck || cat-testlogs.sh |
| 61 | |
| 62 | if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then |
| 63 | make -C "$base/doc/manuals" publish |
| 64 | fi |
Neels Hofmeyr | c6a6d26 | 2017-10-27 22:54:31 +0200 | [diff] [blame] | 65 | |
Oliver Smith | 78abea6 | 2019-07-10 12:28:24 +0200 | [diff] [blame] | 66 | $MAKE maintainer-clean |
Neels Hofmeyr | c6a6d26 | 2017-10-27 22:54:31 +0200 | [diff] [blame] | 67 | osmo-clean-workspace.sh |