Holger Hans Peter Freyther | 81eb10c | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Oliver Smith | 383baca | 2021-02-01 10:20:52 +0100 | [diff] [blame^] | 2 | # This is how we build on jenkins.osmocom.org |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 3 | # |
| 4 | # environment variables: |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 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 | 6b0701c | 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 | 81eb10c | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 14 | |
| 15 | set -ex |
| 16 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 17 | base="$PWD" |
| 18 | deps="$base/deps" |
| 19 | inst="$deps/install" |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 20 | export deps inst |
Holger Hans Peter Freyther | 81eb10c | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 21 | |
Neels Hofmeyr | 4cd0b59 | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 22 | osmo-clean-workspace.sh |
| 23 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 24 | mkdir "$deps" || true |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 25 | |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 26 | osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 27 | |
Neels Hofmeyr | c37f338 | 2017-08-26 21:19:35 +0200 | [diff] [blame] | 28 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
Neels Hofmeyr | 69cdbe6 | 2017-03-01 15:06:16 +0100 | [diff] [blame] | 29 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 30 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 31 | export LD_LIBRARY_PATH="$inst/lib" |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 32 | export PATH="$inst/bin:$PATH" |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 33 | |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 34 | # Additional configure options and depends |
| 35 | CONFIG="" |
| 36 | if [ "$WITH_MANUALS" = "1" ]; then |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 37 | CONFIG="--enable-manuals" |
| 38 | fi |
| 39 | |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 40 | set +x |
| 41 | echo |
| 42 | echo |
| 43 | echo |
Oliver Smith | 383baca | 2021-02-01 10:20:52 +0100 | [diff] [blame^] | 44 | echo " =============================== osmo-gbproxy ===============================" |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 45 | echo |
| 46 | set -x |
| 47 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 48 | cd "$base" |
Holger Hans Peter Freyther | 81eb10c | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 49 | autoreconf --install --force |
Oliver Smith | 383baca | 2021-02-01 10:20:52 +0100 | [diff] [blame^] | 50 | ./configure --enable-sanitize --enable-werror --enable-external-tests $CONFIG |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 51 | $MAKE $PARALLEL_MAKE |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 52 | LD_LIBRARY_PATH="$inst/lib" $MAKE check \ |
| 53 | || cat-testlogs.sh |
Neels Hofmeyr | c07d635 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 54 | LD_LIBRARY_PATH="$inst/lib" \ |
Oliver Smith | 383baca | 2021-02-01 10:20:52 +0100 | [diff] [blame^] | 55 | DISTCHECK_CONFIGURE_FLAGS="--enable-werror --enable-external-tests $CONFIG" \ |
Pau Espin Pedrol | d8645a0 | 2020-10-12 19:34:04 +0200 | [diff] [blame] | 56 | $MAKE $PARALLEL_MAKE distcheck \ |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 57 | || cat-testlogs.sh |
Neels Hofmeyr | 4cd0b59 | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 58 | |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 59 | if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then |
| 60 | make -C "$base/doc/manuals" publish |
| 61 | fi |
| 62 | |
Pau Espin Pedrol | d8645a0 | 2020-10-12 19:34:04 +0200 | [diff] [blame] | 63 | $MAKE $PARALLEL_MAKE maintainer-clean |
Neels Hofmeyr | 4cd0b59 | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 64 | osmo-clean-workspace.sh |