blob: 7d3acc0799373b75e635c9fc89368777439c6692 [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
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040010if [ $sysmobts = "no" -a $sysmodsp = "yes" ]; then
11 echo "This config does not make sense."
12 exit 0
13fi
14
15rm -rf deps/install
16mkdir deps || true
17cd deps
18osmo-deps.sh libosmocore
19
20cd libosmocore
21autoreconf --install --force
22./configure --prefix=$PWD/../install
23$MAKE $PARALLEL_MAKE install
24
25# Install the API
26cd ../
27if ! test -d layer1-api;
28then
29 git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api
30fi
31
32cd layer1-api
33git fetch origin
34git reset --hard origin/master
35mkdir -p $PWD/../install/include/sysmocom/femtobts/
36cp include/*.h ../install/include/sysmocom/femtobts/
37
38cd ../../
39autoreconf --install --force
40BTS_CONFIG="--enable-sysmocom-bts=$sysmobts --enable-sysmocom-dsp=$sysmodsp"
41if [ $sysmobts = "no" ]; then
42 BTS_CONFIG="$BTS_CONFIG --enable-vty-tests"
43fi
44
45PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig ./configure $BTS_CONFIG
46PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig $MAKE $PARALLEL_MAKE
47DISTCHECK_CONFIGURE_FLAGS="$BTS_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$BTS_CONFIG" PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck