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 | 2d91260 | 2016-08-10 14:46:49 +0200 | [diff] [blame^] | 10 | if [ "$sysmobts" = "no" -a "$sysmodsp" = "yes" ]; then |
| 11 | echo "This config does not make sense." |
| 12 | exit 0 |
Holger Hans Peter Freyther | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 13 | fi |
| 14 | |
Neels Hofmeyr | 6bae2d1 | 2016-08-10 14:42:16 +0200 | [diff] [blame] | 15 | base="$PWD" |
| 16 | deps="$base/deps" |
| 17 | inst="$deps/install" |
| 18 | |
| 19 | rm -rf "$inst" |
Neels Hofmeyr | 2d91260 | 2016-08-10 14:46:49 +0200 | [diff] [blame^] | 20 | mkdir -p "$deps" |
| 21 | |
Neels Hofmeyr | 6bae2d1 | 2016-08-10 14:42:16 +0200 | [diff] [blame] | 22 | cd "$deps" |
Holger Hans Peter Freyther | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 23 | osmo-deps.sh libosmocore |
Holger Hans Peter Freyther | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 24 | cd libosmocore |
| 25 | autoreconf --install --force |
Neels Hofmeyr | 6bae2d1 | 2016-08-10 14:42:16 +0200 | [diff] [blame] | 26 | ./configure --prefix="$inst" |
Holger Hans Peter Freyther | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 27 | $MAKE $PARALLEL_MAKE install |
| 28 | |
Neels Hofmeyr | 6bae2d1 | 2016-08-10 14:42:16 +0200 | [diff] [blame] | 29 | cd "$deps" |
Neels Hofmeyr | 2d91260 | 2016-08-10 14:46:49 +0200 | [diff] [blame^] | 30 | if [ ! -d layer1-api ]; then |
Holger Hans Peter Freyther | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 31 | git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api |
| 32 | fi |
Holger Hans Peter Freyther | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 33 | cd layer1-api |
| 34 | git fetch origin |
| 35 | git reset --hard origin/master |
Neels Hofmeyr | 6bae2d1 | 2016-08-10 14:42:16 +0200 | [diff] [blame] | 36 | api_incl="$inst/include/sysmocom/femtobts/" |
| 37 | mkdir -p "$api_incl" |
| 38 | cp include/*.h "$api_incl" |
Holger Hans Peter Freyther | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 39 | |
Neels Hofmeyr | 2d91260 | 2016-08-10 14:46:49 +0200 | [diff] [blame^] | 40 | PCU_CONFIG="--enable-sysmocom-bts=$sysmobts --enable-sysmocom-dsp=$sysmodsp" |
| 41 | if [ "$sysmobts" = "no" ]; then |
| 42 | PCU_CONFIG="$PCU_CONFIG --enable-vty-tests" |
Holger Hans Peter Freyther | 1aa7527 | 2016-04-13 19:05:52 -0400 | [diff] [blame] | 43 | fi |
| 44 | |
Neels Hofmeyr | 2d91260 | 2016-08-10 14:46:49 +0200 | [diff] [blame^] | 45 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig" |
| 46 | export LD_LIBRARY_PATH="$inst/lib" |
| 47 | cd "$base" |
| 48 | autoreconf --install --force |
| 49 | ./configure $PCU_CONFIG |
| 50 | $MAKE $PARALLEL_MAKE |
| 51 | DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" $MAKE distcheck |