Holger Hans Peter Freyther | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -ex |
| 4 | |
Neels Hofmeyr | 0b4da05 | 2016-08-10 14:35:51 +0200 | [diff] [blame] | 5 | if [ -z "$MAKE" ]; then |
| 6 | echo 'The $MAKE variable is not defined, cannot build' |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
Neels Hofmeyr | 6bae2d1 | 2016-08-10 14:42:16 +0200 | [diff] [blame] | 10 | base="$PWD" |
| 11 | deps="$base/deps" |
| 12 | inst="$deps/install" |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 13 | export deps inst |
Neels Hofmeyr | 6bae2d1 | 2016-08-10 14:42:16 +0200 | [diff] [blame] | 14 | |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 15 | mkdir "$deps" || true |
Neels Hofmeyr | 6bae2d1 | 2016-08-10 14:42:16 +0200 | [diff] [blame] | 16 | rm -rf "$inst" |
Neels Hofmeyr | 2d91260 | 2016-08-10 14:46:49 +0200 | [diff] [blame] | 17 | |
Neels Hofmeyr | 7fd177b | 2016-08-10 15:29:31 +0200 | [diff] [blame] | 18 | # Collect configure options for osmo-pcu |
| 19 | PCU_CONFIG="" |
| 20 | if [ "$with_dsp" = sysmo ]; then |
| 21 | PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp" |
| 22 | |
| 23 | # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API |
| 24 | cd "$deps" |
| 25 | if [ ! -d layer1-api ]; then |
| 26 | git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api |
| 27 | fi |
| 28 | cd layer1-api |
| 29 | git fetch origin |
| 30 | git reset --hard origin/master |
| 31 | api_incl="$inst/include/sysmocom/femtobts/" |
| 32 | mkdir -p "$api_incl" |
| 33 | cp include/*.h "$api_incl" |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 34 | cd "$base" |
Neels Hofmeyr | 7fd177b | 2016-08-10 15:29:31 +0200 | [diff] [blame] | 35 | |
| 36 | elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then |
| 37 | echo "Direct DSP access disabled" |
| 38 | else |
| 39 | echo 'Invalid $with_dsp value:' $with_dsp |
| 40 | exit 1 |
| 41 | fi |
| 42 | |
| 43 | if [ "$with_vty" = "yes" ]; then |
| 44 | PCU_CONFIG="$PCU_CONFIG --enable-vty-tests" |
| 45 | elif [ -z "$with_vty" -o "$with_vty" = "no" ]; then |
| 46 | echo "VTY tests disabled" |
| 47 | else |
| 48 | echo 'Invalid $with_vty value:' $with_vty |
| 49 | exit 1 |
| 50 | fi |
| 51 | |
| 52 | # Build deps |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 53 | osmo-build-dep.sh libosmocore |
Holger Hans Peter Freyther | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 54 | |
Neels Hofmeyr | 2082737 | 2017-03-01 15:48:39 +0100 | [diff] [blame^] | 55 | "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
| 56 | |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 57 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
Neels Hofmeyr | 2d91260 | 2016-08-10 14:46:49 +0200 | [diff] [blame] | 58 | export LD_LIBRARY_PATH="$inst/lib" |
Neels Hofmeyr | 7fd177b | 2016-08-10 15:29:31 +0200 | [diff] [blame] | 59 | |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 60 | set +x |
| 61 | echo |
| 62 | echo |
| 63 | echo |
| 64 | echo " =============================== osmo-pcu ===============================" |
| 65 | echo |
| 66 | set -x |
| 67 | |
Neels Hofmeyr | 2d91260 | 2016-08-10 14:46:49 +0200 | [diff] [blame] | 68 | autoreconf --install --force |
| 69 | ./configure $PCU_CONFIG |
| 70 | $MAKE $PARALLEL_MAKE |
Neels Hofmeyr | f868bdb | 2016-10-10 00:55:12 +0200 | [diff] [blame] | 71 | DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \ |
| 72 | $MAKE distcheck \ |
| 73 | || cat-testlogs.sh |