Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Harald Welte | e2e41c1 | 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 | 42a6c39 | 2018-11-29 14:31:32 +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 | e2e41c1 | 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 | 7f5ab9e | 2017-10-27 22:54:40 +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 | 6ecdbc9 | 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 | 42a6c39 | 2018-11-29 14:31:32 +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 |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 37 | osmo-build-dep.sh libosmo-sccp |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 38 | PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 |
Neels Hofmeyr | cf6a487 | 2017-09-03 22:47:51 +0200 | [diff] [blame] | 39 | osmo-build-dep.sh osmo-mgw |
Harald Welte | 1ea6baf | 2018-07-31 19:40:52 +0200 | [diff] [blame] | 40 | osmo-build-dep.sh osmo-hlr |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 41 | |
Pau Espin Pedrol | caf2fe5 | 2018-06-20 23:39:13 +0200 | [diff] [blame] | 42 | enable_werror="" |
Neels Hofmeyr | 9759374 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 43 | if [ "x$IU" = "x--enable-iu" ]; then |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 44 | osmo-build-dep.sh libasn1c |
| 45 | #osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 46 | osmo-build-dep.sh osmo-iuh |
Pau Espin Pedrol | caf2fe5 | 2018-06-20 23:39:13 +0200 | [diff] [blame] | 47 | else |
| 48 | enable_werror="--enable-werror" |
Neels Hofmeyr | 9759374 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 49 | fi |
| 50 | |
Oliver Smith | 42a6c39 | 2018-11-29 14:31:32 +0100 | [diff] [blame] | 51 | # Additional configure options and depends |
| 52 | CONFIG="" |
| 53 | if [ "$WITH_MANUALS" = "1" ]; then |
| 54 | osmo-build-dep.sh osmo-gsm-manuals |
| 55 | CONFIG="--enable-manuals" |
| 56 | fi |
| 57 | |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 58 | set +x |
| 59 | echo |
| 60 | echo |
| 61 | echo |
Neels Hofmeyr | f29ff88 | 2017-07-12 23:37:05 +0200 | [diff] [blame] | 62 | echo " =============================== osmo-msc ===============================" |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 63 | echo |
| 64 | set -x |
| 65 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 66 | cd "$base" |
Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 67 | autoreconf --install --force |
Oliver Smith | 42a6c39 | 2018-11-29 14:31:32 +0100 | [diff] [blame] | 68 | ./configure --enable-sanitize $enable_werror --enable-smpp $IU --enable-external-tests $CONFIG |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 69 | $MAKE $PARALLEL_MAKE |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 70 | LD_LIBRARY_PATH="$inst/lib" $MAKE check \ |
| 71 | || cat-testlogs.sh |
Neels Hofmeyr | 53edff3 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 72 | LD_LIBRARY_PATH="$inst/lib" \ |
Oliver Smith | 42a6c39 | 2018-11-29 14:31:32 +0100 | [diff] [blame] | 73 | DISTCHECK_CONFIGURE_FLAGS="$enable_werror --enable-smpp $IU --enable-external-tests $CONFIG" \ |
Neels Hofmeyr | 53edff3 | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 74 | $MAKE distcheck \ |
Neels Hofmeyr | f1a56de | 2016-10-07 00:58:22 +0200 | [diff] [blame] | 75 | || cat-testlogs.sh |
Neels Hofmeyr | 7f5ab9e | 2017-10-27 22:54:40 +0200 | [diff] [blame] | 76 | |
Oliver Smith | 42a6c39 | 2018-11-29 14:31:32 +0100 | [diff] [blame] | 77 | if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then |
| 78 | make -C "$base/doc/manuals" publish |
| 79 | fi |
| 80 | |
Oliver Smith | aa0a295 | 2019-07-10 12:30:22 +0200 | [diff] [blame] | 81 | $MAKE maintainer-clean |
Neels Hofmeyr | 7f5ab9e | 2017-10-27 22:54:40 +0200 | [diff] [blame] | 82 | osmo-clean-workspace.sh |