Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Harald Welte | c3e0e4e | 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 | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 9 | |
| 10 | set -ex |
| 11 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 12 | base="$PWD" |
| 13 | deps="$base/deps" |
| 14 | inst="$deps/install" |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 15 | export deps inst |
Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 16 | |
Neels Hofmeyr | 2fc999a | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 17 | osmo-clean-workspace.sh |
| 18 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 19 | mkdir "$deps" || true |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 20 | |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 21 | osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 22 | |
Neels Hofmeyr | 74146bc | 2017-08-26 21:19:35 +0200 | [diff] [blame] | 23 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
Neels Hofmeyr | ac27a99 | 2017-03-01 15:06:16 +0100 | [diff] [blame] | 24 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 25 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 26 | export LD_LIBRARY_PATH="$inst/lib" |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 27 | |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 28 | osmo-build-dep.sh libosmo-abis |
Neels Hofmeyr | 4aa75e7 | 2017-03-31 14:03:39 +0200 | [diff] [blame] | 29 | osmo-build-dep.sh libosmo-netif |
Max | b73f265 | 2017-09-28 16:37:48 +0200 | [diff] [blame] | 30 | osmo-build-dep.sh osmo-ggsn |
Harald Welte | f4b2c4c | 2018-09-16 07:53:41 +0200 | [diff] [blame] | 31 | osmo-build-dep.sh osmo-hlr |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 32 | |
Pau Espin Pedrol | 917c987 | 2018-06-20 23:48:00 +0200 | [diff] [blame] | 33 | enable_werror="" |
Neels Hofmeyr | 9759374 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 34 | if [ "x$IU" = "x--enable-iu" ]; then |
Max | 869c360 | 2017-10-26 15:15:53 +0200 | [diff] [blame] | 35 | osmo-build-dep.sh libosmo-sccp |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 36 | osmo-build-dep.sh libasn1c |
| 37 | #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh |
Philipp Maier | efe85d3 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 38 | osmo-build-dep.sh osmo-iuh |
Pau Espin Pedrol | 917c987 | 2018-06-20 23:48:00 +0200 | [diff] [blame] | 39 | else |
| 40 | enable_werror="--enable-werror" |
Neels Hofmeyr | 9759374 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 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 | 7d913d8 | 2017-09-28 16:20:34 +0200 | [diff] [blame] | 47 | echo " =============================== osmo-sgsn ===============================" |
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 |
Pau Espin Pedrol | 94998fa | 2018-06-20 23:55:22 +0200 | [diff] [blame] | 53 | ./configure --enable-sanitize $enable_werror $IU --enable-external-tests |
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 | f2ff307 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 57 | LD_LIBRARY_PATH="$inst/lib" \ |
Pau Espin Pedrol | 94998fa | 2018-06-20 23:55:22 +0200 | [diff] [blame] | 58 | DISTCHECK_CONFIGURE_FLAGS="$enable_werror $IU --enable-external-tests" \ |
Neels Hofmeyr | f2ff307 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 59 | $MAKE distcheck \ |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 60 | || cat-testlogs.sh |
Neels Hofmeyr | 2fc999a | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 61 | |
| 62 | osmo-clean-workspace.sh |