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 |
Oliver Smith | b5ed023 | 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 | c3e0e4e | 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 | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 15 | |
| 16 | set -ex |
| 17 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 18 | base="$PWD" |
| 19 | deps="$base/deps" |
| 20 | inst="$deps/install" |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 21 | export deps inst |
Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 22 | |
Neels Hofmeyr | 2fc999a | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 23 | osmo-clean-workspace.sh |
| 24 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 25 | mkdir "$deps" || true |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 26 | |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 27 | osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 28 | |
Neels Hofmeyr | 74146bc | 2017-08-26 21:19:35 +0200 | [diff] [blame] | 29 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
Neels Hofmeyr | ac27a99 | 2017-03-01 15:06:16 +0100 | [diff] [blame] | 30 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 31 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 32 | export LD_LIBRARY_PATH="$inst/lib" |
Oliver Smith | b5ed023 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 33 | export PATH="$inst/bin:$PATH" |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 34 | |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 35 | osmo-build-dep.sh libosmo-abis |
Neels Hofmeyr | 4aa75e7 | 2017-03-31 14:03:39 +0200 | [diff] [blame] | 36 | osmo-build-dep.sh libosmo-netif |
Max | b73f265 | 2017-09-28 16:37:48 +0200 | [diff] [blame] | 37 | osmo-build-dep.sh osmo-ggsn |
Harald Welte | f4b2c4c | 2018-09-16 07:53:41 +0200 | [diff] [blame] | 38 | osmo-build-dep.sh osmo-hlr |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 39 | |
Pau Espin Pedrol | 917c987 | 2018-06-20 23:48:00 +0200 | [diff] [blame] | 40 | enable_werror="" |
Neels Hofmeyr | 9759374 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 41 | if [ "x$IU" = "x--enable-iu" ]; then |
Max | 869c360 | 2017-10-26 15:15:53 +0200 | [diff] [blame] | 42 | osmo-build-dep.sh libosmo-sccp |
Neels Hofmeyr | f1a56de | 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 | efe85d3 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 45 | osmo-build-dep.sh osmo-iuh |
Pau Espin Pedrol | 917c987 | 2018-06-20 23:48:00 +0200 | [diff] [blame] | 46 | else |
| 47 | enable_werror="--enable-werror" |
Neels Hofmeyr | 9759374 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 48 | fi |
| 49 | |
Oliver Smith | b5ed023 | 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 | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 57 | set +x |
| 58 | echo |
| 59 | echo |
| 60 | echo |
Neels Hofmeyr | 7d913d8 | 2017-09-28 16:20:34 +0200 | [diff] [blame] | 61 | echo " =============================== osmo-sgsn ===============================" |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 62 | echo |
| 63 | set -x |
| 64 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 65 | cd "$base" |
Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 66 | autoreconf --install --force |
Oliver Smith | b5ed023 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 67 | ./configure --enable-sanitize $enable_werror $IU --enable-external-tests $CONFIG |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 68 | $MAKE $PARALLEL_MAKE |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 69 | LD_LIBRARY_PATH="$inst/lib" $MAKE check \ |
| 70 | || cat-testlogs.sh |
Neels Hofmeyr | f2ff307 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 71 | LD_LIBRARY_PATH="$inst/lib" \ |
Oliver Smith | b5ed023 | 2018-11-30 16:27:06 +0100 | [diff] [blame] | 72 | DISTCHECK_CONFIGURE_FLAGS="$enable_werror $IU --enable-external-tests $CONFIG" \ |
Neels Hofmeyr | f2ff307 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 73 | $MAKE distcheck \ |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 74 | || cat-testlogs.sh |
Neels Hofmeyr | 2fc999a | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 75 | |
Oliver Smith | b5ed023 | 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 | |
Neels Hofmeyr | 2fc999a | 2017-10-27 22:54:46 +0200 | [diff] [blame] | 80 | osmo-clean-workspace.sh |