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 |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 3 | # |
| 4 | # environment variables: |
| 5 | # * IU: configure 3G support (values: "--enable-iu", "--disable-iu") |
| 6 | # * WITH_MANUALS: build manual PDFs if set to "1" |
| 7 | # * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1") |
| 8 | # |
Harald Welte | 6b0701c | 2017-07-10 15:00:00 +0200 | [diff] [blame] | 9 | |
| 10 | if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then |
| 11 | echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" |
| 12 | exit 2 |
| 13 | fi |
| 14 | |
Holger Hans Peter Freyther | 81eb10c | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 15 | |
| 16 | set -ex |
| 17 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 18 | base="$PWD" |
| 19 | deps="$base/deps" |
| 20 | inst="$deps/install" |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 21 | export deps inst |
Holger Hans Peter Freyther | 81eb10c | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 22 | |
Neels Hofmeyr | 4cd0b59 | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 23 | osmo-clean-workspace.sh |
| 24 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 25 | mkdir "$deps" || true |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 26 | |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 27 | osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 28 | |
Neels Hofmeyr | c37f338 | 2017-08-26 21:19:35 +0200 | [diff] [blame] | 29 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
Neels Hofmeyr | 69cdbe6 | 2017-03-01 15:06:16 +0100 | [diff] [blame] | 30 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 31 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 32 | export LD_LIBRARY_PATH="$inst/lib" |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 33 | export PATH="$inst/bin:$PATH" |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 34 | |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 35 | osmo-build-dep.sh libosmo-abis |
Neels Hofmeyr | 3905e70 | 2017-03-31 14:03:39 +0200 | [diff] [blame] | 36 | osmo-build-dep.sh libosmo-netif |
Max | b83d125 | 2017-09-28 16:37:48 +0200 | [diff] [blame] | 37 | osmo-build-dep.sh osmo-ggsn |
Harald Welte | d8f8945 | 2018-09-16 07:53:41 +0200 | [diff] [blame] | 38 | osmo-build-dep.sh osmo-hlr |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 39 | |
Pau Espin Pedrol | bc89ed0 | 2018-06-20 23:48:00 +0200 | [diff] [blame] | 40 | enable_werror="" |
Neels Hofmeyr | 58996b7 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 41 | if [ "x$IU" = "x--enable-iu" ]; then |
Max | b9b6240 | 2017-10-26 15:15:53 +0200 | [diff] [blame] | 42 | osmo-build-dep.sh libosmo-sccp |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 43 | osmo-build-dep.sh libasn1c |
| 44 | #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] | 45 | osmo-build-dep.sh osmo-iuh |
Pau Espin Pedrol | bc89ed0 | 2018-06-20 23:48:00 +0200 | [diff] [blame] | 46 | else |
| 47 | enable_werror="--enable-werror" |
Neels Hofmeyr | 58996b7 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 48 | fi |
| 49 | |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 50 | # Additional configure options and depends |
| 51 | CONFIG="" |
| 52 | if [ "$WITH_MANUALS" = "1" ]; then |
| 53 | osmo-build-dep.sh osmo-gsm-manuals |
| 54 | CONFIG="--enable-manuals" |
| 55 | fi |
| 56 | |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 57 | set +x |
| 58 | echo |
| 59 | echo |
| 60 | echo |
Neels Hofmeyr | 91d2c59 | 2017-09-28 16:20:34 +0200 | [diff] [blame] | 61 | echo " =============================== osmo-sgsn ===============================" |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 62 | echo |
| 63 | set -x |
| 64 | |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 65 | cd "$base" |
Holger Hans Peter Freyther | 81eb10c | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 66 | autoreconf --install --force |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 67 | ./configure --enable-sanitize $enable_werror $IU --enable-external-tests $CONFIG |
Neels Hofmeyr | a335ee3 | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 68 | $MAKE $PARALLEL_MAKE |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 69 | LD_LIBRARY_PATH="$inst/lib" $MAKE check \ |
| 70 | || cat-testlogs.sh |
Neels Hofmeyr | c07d635 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 71 | LD_LIBRARY_PATH="$inst/lib" \ |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 72 | DISTCHECK_CONFIGURE_FLAGS="$enable_werror $IU --enable-external-tests $CONFIG" \ |
Neels Hofmeyr | c07d635 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 73 | $MAKE distcheck \ |
Neels Hofmeyr | b88a18c | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 74 | || cat-testlogs.sh |
Neels Hofmeyr | 4cd0b59 | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 75 | |
Oliver Smith | d13baf6 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 76 | if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then |
| 77 | make -C "$base/doc/manuals" publish |
| 78 | fi |
| 79 | |
Oliver Smith | 5413865 | 2019-07-10 13:24:35 +0200 | [diff] [blame] | 80 | $MAKE maintainer-clean |
Neels Hofmeyr | 4cd0b59 | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 81 | osmo-clean-workspace.sh |