blob: 8021bbdb2c8f04b1e3e57c71b24bb9f2d1555aa8 [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
Neels Hofmeyre75a6292016-08-27 13:59:54 +020012marker() {
Neels Hofmeyr09614082016-07-11 19:27:22 +020013 set +x
14 echo
15 echo
16 echo
Neels Hofmeyre75a6292016-08-27 13:59:54 +020017 echo " =============================== $@ ==============================="
Neels Hofmeyr09614082016-07-11 19:27:22 +020018 echo
19 set -x
Neels Hofmeyre75a6292016-08-27 13:59:54 +020020}
21
22build_dep() {
23 project="$1"
24 branch="$2"
25 marker $project
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020026 if [ -z "$project" ]; then
27 echo "internal failure"
28 exit 1
29 fi
30 cd "$deps"
31 rm -rf "$project"
32 osmo-deps.sh "$project"
33 cd "$project"
34 if [ -n "$branch" ]; then
35 git checkout "$branch"
36 fi
Neels Hofmeyr09614082016-07-11 19:27:22 +020037 git rev-parse HEAD
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020038 autoreconf --install --force
39 ./configure --prefix="$inst"
40 $MAKE $PARALLEL_MAKE install
41}
42
43build_dep libosmocore
44
45# All below builds want this PKG_CONFIG_PATH
46export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
47
48build_dep libosmo-abis
49build_dep libosmo-netif sysmocom/sctp
50build_dep libosmo-sccp sysmocom/iu
51build_dep libasn1c
52
53# the asn1c binary is used by the 'regen' target below
54build_dep asn1c aper-prefix
55
Neels Hofmeyre75a6292016-08-27 13:59:54 +020056marker osmo-iuh
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020057cd "$base"
Neels Hofmeyr6458c302016-07-11 21:56:15 +020058
Holger Hans Peter Freyther64f56392016-04-27 22:06:46 +020059autoreconf --install --force
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020060./configure
Neels Hofmeyr6648fe82016-08-29 15:50:14 +020061
62# Verify that checked-in asn1 code is identical to regenerated asn1 code
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020063PATH="$inst/bin:$PATH" $MAKE $PARALLEL_MAKE -C src regen
Neels Hofmeyr6648fe82016-08-29 15:50:14 +020064
65# attempt to settle the file system
66sleep 1
67
68git status
69git diff | cat
70
71if ! git diff-files --quiet ; then
72 echo "ERROR: 'make -C src regen' does not match committed asn1 code"
73 exit 1
74fi
75
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020076$MAKE $PARALLEL_MAKE
77LD_LIBRARY_PATH="$inst/lib" $MAKE check
Neels Hofmeyr30f534f2016-08-27 14:01:51 +020078LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck