Max | 062dfa1 | 2017-06-13 18:39:52 +0200 | [diff] [blame] | 1 | #!/bin/sh |
Harald Welte | 8c8027c | 2017-07-10 15:03:27 +0200 | [diff] [blame] | 2 | # jenkins build helper script for osmo-pcu. 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 | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 9 | |
| 10 | set -ex |
| 11 | |
Neels Hofmeyr | 0b4da05 | 2016-08-10 14:35:51 +0200 | [diff] [blame] | 12 | if [ -z "$MAKE" ]; then |
| 13 | echo 'The $MAKE variable is not defined, cannot build' |
| 14 | exit 1 |
| 15 | fi |
| 16 | |
Neels Hofmeyr | 6bae2d1 | 2016-08-10 14:42:16 +0200 | [diff] [blame] | 17 | base="$PWD" |
| 18 | deps="$base/deps" |
| 19 | inst="$deps/install" |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 20 | export deps inst |
Neels Hofmeyr | 6bae2d1 | 2016-08-10 14:42:16 +0200 | [diff] [blame] | 21 | |
Neels Hofmeyr | 49beba4 | 2017-10-27 22:54:44 +0200 | [diff] [blame] | 22 | osmo-clean-workspace.sh |
| 23 | |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 24 | mkdir "$deps" || true |
Neels Hofmeyr | 2d91260 | 2016-08-10 14:46:49 +0200 | [diff] [blame] | 25 | |
Neels Hofmeyr | 7fd177b | 2016-08-10 15:29:31 +0200 | [diff] [blame] | 26 | # Collect configure options for osmo-pcu |
| 27 | PCU_CONFIG="" |
| 28 | if [ "$with_dsp" = sysmo ]; then |
| 29 | PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp" |
| 30 | |
| 31 | # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API |
| 32 | cd "$deps" |
Max | 062dfa1 | 2017-06-13 18:39:52 +0200 | [diff] [blame] | 33 | osmo-layer1-headers.sh sysmo |
| 34 | cd layer1-headers |
Neels Hofmeyr | 7fd177b | 2016-08-10 15:29:31 +0200 | [diff] [blame] | 35 | api_incl="$inst/include/sysmocom/femtobts/" |
| 36 | mkdir -p "$api_incl" |
| 37 | cp include/*.h "$api_incl" |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 38 | cd "$base" |
Neels Hofmeyr | 7fd177b | 2016-08-10 15:29:31 +0200 | [diff] [blame] | 39 | |
Max | 062dfa1 | 2017-06-13 18:39:52 +0200 | [diff] [blame] | 40 | elif [ "$with_dsp" = lc15 ]; then |
| 41 | PCU_CONFIG="$PCU_CONFIG --enable-lc15bts-phy --with-litecell15=$deps/layer1-headers/inc" |
| 42 | cd "$deps" |
Max | 865436d | 2017-06-22 18:23:09 +0200 | [diff] [blame] | 43 | osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" |
Max | 062dfa1 | 2017-06-13 18:39:52 +0200 | [diff] [blame] | 44 | cd "$base" |
| 45 | |
Neels Hofmeyr | 7fd177b | 2016-08-10 15:29:31 +0200 | [diff] [blame] | 46 | elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then |
| 47 | echo "Direct DSP access disabled" |
| 48 | else |
| 49 | echo 'Invalid $with_dsp value:' $with_dsp |
| 50 | exit 1 |
| 51 | fi |
| 52 | |
| 53 | if [ "$with_vty" = "yes" ]; then |
| 54 | PCU_CONFIG="$PCU_CONFIG --enable-vty-tests" |
| 55 | elif [ -z "$with_vty" -o "$with_vty" = "no" ]; then |
| 56 | echo "VTY tests disabled" |
| 57 | else |
| 58 | echo 'Invalid $with_vty value:' $with_vty |
| 59 | exit 1 |
| 60 | fi |
| 61 | |
Max | 10e37a5 | 2017-08-24 14:23:12 +0200 | [diff] [blame] | 62 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
| 63 | |
Neels Hofmeyr | 7fd177b | 2016-08-10 15:29:31 +0200 | [diff] [blame] | 64 | # Build deps |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 65 | osmo-build-dep.sh libosmocore |
Holger Hans Peter Freyther | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 66 | |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 67 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
Neels Hofmeyr | 2d91260 | 2016-08-10 14:46:49 +0200 | [diff] [blame] | 68 | export LD_LIBRARY_PATH="$inst/lib" |
Neels Hofmeyr | 7fd177b | 2016-08-10 15:29:31 +0200 | [diff] [blame] | 69 | |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 70 | set +x |
| 71 | echo |
| 72 | echo |
| 73 | echo |
| 74 | echo " =============================== osmo-pcu ===============================" |
| 75 | echo |
| 76 | set -x |
| 77 | |
Neels Hofmeyr | 2d91260 | 2016-08-10 14:46:49 +0200 | [diff] [blame] | 78 | autoreconf --install --force |
| 79 | ./configure $PCU_CONFIG |
| 80 | $MAKE $PARALLEL_MAKE |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 81 | DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \ |
| 82 | $MAKE distcheck \ |
| 83 | || cat-testlogs.sh |
Neels Hofmeyr | 49beba4 | 2017-10-27 22:54:44 +0200 | [diff] [blame] | 84 | |
| 85 | osmo-clean-workspace.sh |