blob: e108e369911e6715e5563ece95e352302d6c5ce1 [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 Hofmeyr2d912602016-08-10 14:46:49 +020010if [ "$sysmobts" = "no" -a "$sysmodsp" = "yes" ]; then
11 echo "This config does not make sense."
12 exit 0
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040013fi
14
Neels Hofmeyr6bae2d12016-08-10 14:42:16 +020015base="$PWD"
16deps="$base/deps"
17inst="$deps/install"
18
19rm -rf "$inst"
Neels Hofmeyr2d912602016-08-10 14:46:49 +020020mkdir -p "$deps"
21
Neels Hofmeyr6bae2d12016-08-10 14:42:16 +020022cd "$deps"
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040023osmo-deps.sh libosmocore
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040024cd libosmocore
25autoreconf --install --force
Neels Hofmeyr6bae2d12016-08-10 14:42:16 +020026./configure --prefix="$inst"
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040027$MAKE $PARALLEL_MAKE install
28
Neels Hofmeyr6bae2d12016-08-10 14:42:16 +020029cd "$deps"
Neels Hofmeyr2d912602016-08-10 14:46:49 +020030if [ ! -d layer1-api ]; then
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040031 git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api
32fi
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040033cd layer1-api
34git fetch origin
35git reset --hard origin/master
Neels Hofmeyr6bae2d12016-08-10 14:42:16 +020036api_incl="$inst/include/sysmocom/femtobts/"
37mkdir -p "$api_incl"
38cp include/*.h "$api_incl"
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040039
Neels Hofmeyr2d912602016-08-10 14:46:49 +020040PCU_CONFIG="--enable-sysmocom-bts=$sysmobts --enable-sysmocom-dsp=$sysmodsp"
41if [ "$sysmobts" = "no" ]; then
42 PCU_CONFIG="$PCU_CONFIG --enable-vty-tests"
Holger Hans Peter Freyther1aa75272016-04-13 19:05:52 -040043fi
44
Neels Hofmeyr2d912602016-08-10 14:46:49 +020045export PKG_CONFIG_PATH="$inst/lib/pkgconfig"
46export LD_LIBRARY_PATH="$inst/lib"
47cd "$base"
48autoreconf --install --force
49./configure $PCU_CONFIG
50$MAKE $PARALLEL_MAKE
51DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" $MAKE distcheck