Harald Welte | e57cbe2 | 2017-09-05 22:35:10 +0200 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | # jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org |
Oliver Smith | 33c537e | 2018-11-29 14:16:27 +0100 | [diff] [blame] | 3 | # |
| 4 | # environment variables: |
| 5 | # * GTP: configure GTP tunneling Linux kernel (values: "--enable-gtp-linux" or "--disable-gtp-linux") |
| 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 | e57cbe2 | 2017-09-05 22:35:10 +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 | b29ff1d | 2016-04-13 19:02:13 -0400 | [diff] [blame] | 15 | |
| 16 | set -ex |
| 17 | |
Harald Welte | e57cbe2 | 2017-09-05 22:35:10 +0200 | [diff] [blame] | 18 | base="$PWD" |
| 19 | deps="$base/deps" |
| 20 | inst="$deps/install" |
| 21 | export deps inst |
| 22 | |
Neels Hofmeyr | 29caaab | 2017-10-27 22:54:29 +0200 | [diff] [blame] | 23 | osmo-clean-workspace.sh |
| 24 | |
Harald Welte | e57cbe2 | 2017-09-05 22:35:10 +0200 | [diff] [blame] | 25 | mkdir "$deps" || true |
Harald Welte | e57cbe2 | 2017-09-05 22:35:10 +0200 | [diff] [blame] | 26 | |
Pau Espin Pedrol | 077b903 | 2017-12-14 15:26:57 +0100 | [diff] [blame] | 27 | if [ "x$GTP" == "x--enable-gtp-linux" ]; then |
| 28 | osmo-build-dep.sh libgtpnl |
| 29 | fi |
Harald Welte | e57cbe2 | 2017-09-05 22:35:10 +0200 | [diff] [blame] | 30 | osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false |
| 31 | |
Max | b87da75 | 2017-08-25 17:37:36 +0200 | [diff] [blame] | 32 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
| 33 | |
Harald Welte | e57cbe2 | 2017-09-05 22:35:10 +0200 | [diff] [blame] | 34 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
| 35 | export LD_LIBRARY_PATH="$inst/lib" |
Oliver Smith | 33c537e | 2018-11-29 14:16:27 +0100 | [diff] [blame] | 36 | export PATH="$inst/bin:$PATH" |
| 37 | |
| 38 | # Additional configure options and depends |
| 39 | CONFIG="" |
| 40 | if [ "$WITH_MANUALS" = "1" ]; then |
Oliver Smith | 33c537e | 2018-11-29 14:16:27 +0100 | [diff] [blame] | 41 | CONFIG="--enable-manuals" |
| 42 | fi |
Holger Hans Peter Freyther | b29ff1d | 2016-04-13 19:02:13 -0400 | [diff] [blame] | 43 | |
Harald Welte | e57cbe2 | 2017-09-05 22:35:10 +0200 | [diff] [blame] | 44 | set +x |
| 45 | echo |
| 46 | echo |
| 47 | echo |
Max | ea70f36 | 2017-09-15 12:16:53 +0200 | [diff] [blame] | 48 | echo " =============================== OsmoGGSN ===============================" |
Harald Welte | e57cbe2 | 2017-09-05 22:35:10 +0200 | [diff] [blame] | 49 | echo |
| 50 | set -x |
| 51 | |
| 52 | cd "$base" |
Holger Hans Peter Freyther | b29ff1d | 2016-04-13 19:02:13 -0400 | [diff] [blame] | 53 | autoreconf --install --force |
Oliver Smith | 33c537e | 2018-11-29 14:16:27 +0100 | [diff] [blame] | 54 | ./configure --enable-sanitize --enable-werror $GTP $CONFIG |
Harald Welte | e57cbe2 | 2017-09-05 22:35:10 +0200 | [diff] [blame] | 55 | $MAKE $PARALLEL_MAKE |
Pau Espin Pedrol | 3ddf4c6 | 2020-10-12 19:32:31 +0200 | [diff] [blame] | 56 | DISTCHECK_CONFIGURE_FLAGS="$CONFIG" $MAKE $PARALLEL_MAKE distcheck |
Oliver Smith | 33c537e | 2018-11-29 14:16:27 +0100 | [diff] [blame] | 57 | |
| 58 | if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then |
| 59 | make -C "$base/doc/manuals" publish |
| 60 | fi |
Neels Hofmeyr | 29caaab | 2017-10-27 22:54:29 +0200 | [diff] [blame] | 61 | |
Pau Espin Pedrol | 3ddf4c6 | 2020-10-12 19:32:31 +0200 | [diff] [blame] | 62 | $MAKE $PARALLEL_MAKE maintainer-clean |
Neels Hofmeyr | 29caaab | 2017-10-27 22:54:29 +0200 | [diff] [blame] | 63 | osmo-clean-workspace.sh |