blob: 522247640d84c6a48e8db0bb964c1b414a0b4f8c [file] [log] [blame]
Max062dfa12017-06-13 18:39:52 +02001#!/bin/sh
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -04002
3set -ex
4
Neels Hofmeyr0b4da052016-08-10 14:35:51 +02005if [ -z "$MAKE" ]; then
6 echo 'The $MAKE variable is not defined, cannot build'
7 exit 1
8fi
9
Neels Hofmeyr6bae2d12016-08-10 14:42:16 +020010base="$PWD"
11deps="$base/deps"
12inst="$deps/install"
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020013export deps inst
Neels Hofmeyr6bae2d12016-08-10 14:42:16 +020014
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020015mkdir "$deps" || true
Neels Hofmeyr6bae2d12016-08-10 14:42:16 +020016rm -rf "$inst"
Neels Hofmeyr2d912602016-08-10 14:46:49 +020017
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020018# Collect configure options for osmo-pcu
19PCU_CONFIG=""
20if [ "$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"
Max062dfa12017-06-13 18:39:52 +020025 osmo-layer1-headers.sh sysmo
26 cd layer1-headers
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020027 api_incl="$inst/include/sysmocom/femtobts/"
28 mkdir -p "$api_incl"
29 cp include/*.h "$api_incl"
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020030 cd "$base"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020031
Max062dfa12017-06-13 18:39:52 +020032elif [ "$with_dsp" = lc15 ]; then
33 PCU_CONFIG="$PCU_CONFIG --enable-lc15bts-phy --with-litecell15=$deps/layer1-headers/inc"
34 cd "$deps"
Max865436d2017-06-22 18:23:09 +020035 osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION"
Max062dfa12017-06-13 18:39:52 +020036 cd "$base"
37
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020038elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then
39 echo "Direct DSP access disabled"
40else
41 echo 'Invalid $with_dsp value:' $with_dsp
42 exit 1
43fi
44
45if [ "$with_vty" = "yes" ]; then
46 PCU_CONFIG="$PCU_CONFIG --enable-vty-tests"
47elif [ -z "$with_vty" -o "$with_vty" = "no" ]; then
48 echo "VTY tests disabled"
49else
50 echo 'Invalid $with_vty value:' $with_vty
51 exit 1
52fi
53
54# Build deps
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020055osmo-build-dep.sh libosmocore
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040056
Neels Hofmeyr20827372017-03-01 15:48:39 +010057"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
58
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020059export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
Neels Hofmeyr2d912602016-08-10 14:46:49 +020060export LD_LIBRARY_PATH="$inst/lib"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020061
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020062set +x
63echo
64echo
65echo
66echo " =============================== osmo-pcu ==============================="
67echo
68set -x
69
Neels Hofmeyr2d912602016-08-10 14:46:49 +020070autoreconf --install --force
71./configure $PCU_CONFIG
72$MAKE $PARALLEL_MAKE
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020073DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \
74 $MAKE distcheck \
75 || cat-testlogs.sh