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