blob: 755ff1c128a3ab3a6ffd08a8190f0fc89d0ae5c8 [file] [log] [blame]
Holger Hans Peter Freyther81eb10c2016-04-13 19:03:38 -04001#!/usr/bin/env bash
2
3set -ex
4
Neels Hofmeyra335ee32016-07-11 19:39:51 +02005base="$PWD"
6deps="$base/deps"
7inst="$deps/install"
Holger Hans Peter Freyther81eb10c2016-04-13 19:03:38 -04008
Neels Hofmeyra335ee32016-07-11 19:39:51 +02009mkdir "$deps" || true
10rm -rf "$inst"
11
12build_dep() {
13 project="$1"
14 branch="$2"
15 set +x
16 echo
17 echo
18 echo
19 echo " =============================== $project ==============================="
20 echo
21 set -x
22 if [ -z "$project" ]; then
23 echo "internal failure"
24 exit 1
25 fi
26 cd "$deps"
27 rm -rf "$project"
28 osmo-deps.sh "$project"
29 cd "$project"
30 if [ -n "$branch" ]; then
31 git checkout "$branch"
32 fi
33 git rev-parse HEAD
34 autoreconf --install --force
35 ./configure --prefix="$inst"
36 $MAKE $PARALLEL_MAKE install
37}
38
39build_dep libosmocore
40
41# All below builds want this PKG_CONFIG_PATH
42export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
43
Neels Hofmeyr58996b72016-07-11 19:44:58 +020044if [ "x$IU" = "x--enable-iu" ]; then
45 netif_branch="sysmocom/sctp"
46 sccp_branch="sysmocom/iu"
47fi
48
Neels Hofmeyra335ee32016-07-11 19:39:51 +020049build_dep libosmo-abis
Neels Hofmeyr58996b72016-07-11 19:44:58 +020050build_dep libosmo-netif $netif_branch
51build_dep libosmo-sccp $sccp_branch
Neels Hofmeyra335ee32016-07-11 19:39:51 +020052PARALLEL_MAKE="" build_dep libsmpp34
53build_dep openggsn
54
Neels Hofmeyr58996b72016-07-11 19:44:58 +020055if [ "x$IU" = "x--enable-iu" ]; then
56 build_dep libasn1c
57 #build_dep asn1c aper-prefix # only needed for make regen in osmo-iuh
58 build_dep osmo-iuh
59fi
60
Neels Hofmeyra335ee32016-07-11 19:39:51 +020061cd "$base"
62cd openbsc
Holger Hans Peter Freyther81eb10c2016-04-13 19:03:38 -040063autoreconf --install --force
Neels Hofmeyr58996b72016-07-11 19:44:58 +020064./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests
Neels Hofmeyra335ee32016-07-11 19:39:51 +020065$MAKE $PARALLEL_MAKE
66LD_LIBRARY_PATH="$inst/lib" $MAKE check
67LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck