blob: fb0fb2f42b6d77f104d03f8f2102ca75d9e02905 [file] [log] [blame]
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -04001#!/usr/bin/env bash
2
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"
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 Hofmeyrf868bdb2016-10-10 00:55:12 +020034 cd "$base"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020035
36elif [ -z "$with_dsp" -o "$with_dsp" = none ]; then
37 echo "Direct DSP access disabled"
38else
39 echo 'Invalid $with_dsp value:' $with_dsp
40 exit 1
41fi
42
43if [ "$with_vty" = "yes" ]; then
44 PCU_CONFIG="$PCU_CONFIG --enable-vty-tests"
45elif [ -z "$with_vty" -o "$with_vty" = "no" ]; then
46 echo "VTY tests disabled"
47else
48 echo 'Invalid $with_vty value:' $with_vty
49 exit 1
50fi
51
52# Build deps
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020053osmo-build-dep.sh libosmocore
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040054
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020055export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
Neels Hofmeyr2d912602016-08-10 14:46:49 +020056export LD_LIBRARY_PATH="$inst/lib"
Neels Hofmeyr7fd177b2016-08-10 15:29:31 +020057
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020058set +x
59echo
60echo
61echo
62echo " =============================== osmo-pcu ==============================="
63echo
64set -x
65
Neels Hofmeyr2d912602016-08-10 14:46:49 +020066autoreconf --install --force
67./configure $PCU_CONFIG
68$MAKE $PARALLEL_MAKE
Neels Hofmeyrf868bdb2016-10-10 00:55:12 +020069DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \
70 $MAKE distcheck \
71 || cat-testlogs.sh