blob: 608e4cde0bb59f5ab5a6ffa5be7c77a0e1997ef0 [file] [log] [blame]
Holger Hans Peter Freyther64f56392016-04-27 22:06:46 +02001#!/usr/bin/env bash
2
3set -ex
4
Neels Hofmeyrde0acd22016-07-11 17:10:49 +02005base="$PWD"
6deps="$base/deps"
7inst="$deps/install"
Holger Hans Peter Freyther64f56392016-04-27 22:06:46 +02008
Neels Hofmeyrde0acd22016-07-11 17:10:49 +02009mkdir "$deps" || true
10rm -rf "$inst"
11
12build_dep() {
13 project="$1"
14 branch="$2"
15 if [ -z "$project" ]; then
16 echo "internal failure"
17 exit 1
18 fi
19 cd "$deps"
20 rm -rf "$project"
21 osmo-deps.sh "$project"
22 cd "$project"
23 if [ -n "$branch" ]; then
24 git checkout "$branch"
25 fi
26 autoreconf --install --force
27 ./configure --prefix="$inst"
28 $MAKE $PARALLEL_MAKE install
29}
30
31build_dep libosmocore
32
33# All below builds want this PKG_CONFIG_PATH
34export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
35
36build_dep libosmo-abis
37build_dep libosmo-netif sysmocom/sctp
38build_dep libosmo-sccp sysmocom/iu
39build_dep libasn1c
40
41# the asn1c binary is used by the 'regen' target below
42build_dep asn1c aper-prefix
43
44cd "$base"
Holger Hans Peter Freyther64f56392016-04-27 22:06:46 +020045autoreconf --install --force
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020046./configure
47PATH="$inst/bin:$PATH" $MAKE $PARALLEL_MAKE -C src regen
48$MAKE $PARALLEL_MAKE
49LD_LIBRARY_PATH="$inst/lib" $MAKE check
Holger Hans Peter Freyther64f56392016-04-27 22:06:46 +020050# distcheck is broken
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020051#LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck