Holger Hans Peter Freyther | 81eb10c | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Harald Welte | 6b0701c | 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 |
| 3 | |
| 4 | if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then |
| 5 | echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" |
| 6 | exit 2 |
| 7 | fi |
| 8 | |
Holger Hans Peter Freyther | 81eb10c | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 9 | |
| 10 | set -ex |
| 11 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 12 | base="$PWD" |
| 13 | deps="$base/deps" |
| 14 | inst="$deps/install" |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 15 | export deps inst |
Holger Hans Peter Freyther | 81eb10c | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 16 | |
Neels Hofmeyr | 4cd0b59 | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 17 | osmo-clean-workspace.sh |
| 18 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 19 | mkdir "$deps" || true |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 20 | |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 21 | osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 22 | |
Neels Hofmeyr | c37f338 | 2017-08-26 21:19:35 +0200 | [diff] [blame] | 23 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
Neels Hofmeyr | 69cdbe6 | 2017-03-01 15:06:16 +0100 | [diff] [blame] | 24 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 25 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 26 | export LD_LIBRARY_PATH="$inst/lib" |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 27 | |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 28 | osmo-build-dep.sh libosmo-abis |
Neels Hofmeyr | 3905e70 | 2017-03-31 14:03:39 +0200 | [diff] [blame] | 29 | osmo-build-dep.sh libosmo-netif |
Max | b83d125 | 2017-09-28 16:37:48 +0200 | [diff] [blame] | 30 | osmo-build-dep.sh osmo-ggsn |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 31 | |
Pau Espin Pedrol | bc89ed0 | 2018-06-20 23:48:00 +0200 | [diff] [blame] | 32 | enable_werror="" |
Neels Hofmeyr | 58996b7 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 33 | if [ "x$IU" = "x--enable-iu" ]; then |
Max | b9b6240 | 2017-10-26 15:15:53 +0200 | [diff] [blame] | 34 | osmo-build-dep.sh libosmo-sccp |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 35 | osmo-build-dep.sh libasn1c |
| 36 | #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh |
Philipp Maier | 68760a8 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 37 | osmo-build-dep.sh osmo-iuh |
Pau Espin Pedrol | bc89ed0 | 2018-06-20 23:48:00 +0200 | [diff] [blame] | 38 | else |
| 39 | enable_werror="--enable-werror" |
Neels Hofmeyr | 58996b7 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 40 | fi |
| 41 | |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 42 | set +x |
| 43 | echo |
| 44 | echo |
| 45 | echo |
Neels Hofmeyr | 91d2c59 | 2017-09-28 16:20:34 +0200 | [diff] [blame] | 46 | echo " =============================== osmo-sgsn ===============================" |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 47 | echo |
| 48 | set -x |
| 49 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 50 | cd "$base" |
Holger Hans Peter Freyther | 81eb10c | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 51 | autoreconf --install --force |
Pau Espin Pedrol | d67e07f | 2018-06-20 23:55:22 +0200 | [diff] [blame] | 52 | ./configure --enable-sanitize $enable_werror $IU --enable-external-tests |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 53 | $MAKE $PARALLEL_MAKE |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 54 | LD_LIBRARY_PATH="$inst/lib" $MAKE check \ |
| 55 | || cat-testlogs.sh |
Neels Hofmeyr | c07d635 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 56 | LD_LIBRARY_PATH="$inst/lib" \ |
Pau Espin Pedrol | d67e07f | 2018-06-20 23:55:22 +0200 | [diff] [blame] | 57 | DISTCHECK_CONFIGURE_FLAGS="$enable_werror $IU --enable-external-tests" \ |
Neels Hofmeyr | c07d635 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 58 | $MAKE distcheck \ |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 59 | || cat-testlogs.sh |
Neels Hofmeyr | 4cd0b59 | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 60 | |
| 61 | osmo-clean-workspace.sh |