blob: 4b9286196ab6d27dc111710243c153ef8ec2784b [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"
Neels Hofmeyr09614082016-07-11 19:27:22 +020015 set +x
16 echo
17 echo
18 echo
19 echo " =============================== $project ==============================="
20 echo
21 set -x
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020022 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
Neels Hofmeyr09614082016-07-11 19:27:22 +020033 git rev-parse HEAD
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020034 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
44build_dep libosmo-abis
45build_dep libosmo-netif sysmocom/sctp
46build_dep libosmo-sccp sysmocom/iu
47build_dep libasn1c
48
49# the asn1c binary is used by the 'regen' target below
50build_dep asn1c aper-prefix
51
52cd "$base"
Neels Hofmeyr6458c302016-07-11 21:56:15 +020053# Build using the checked-in asn1 code
54autoreconf --install --force
55./configure
56$MAKE $PARALLEL_MAKE
57LD_LIBRARY_PATH="$inst/lib" $MAKE check
58# distcheck is broken
59#LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck
60make clean
61
62# Build with regenerated asn1 code
Holger Hans Peter Freyther64f56392016-04-27 22:06:46 +020063autoreconf --install --force
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020064./configure
65PATH="$inst/bin:$PATH" $MAKE $PARALLEL_MAKE -C src regen
66$MAKE $PARALLEL_MAKE
67LD_LIBRARY_PATH="$inst/lib" $MAKE check
Holger Hans Peter Freyther64f56392016-04-27 22:06:46 +020068# distcheck is broken
Neels Hofmeyrde0acd22016-07-11 17:10:49 +020069#LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck