Holger Hans Peter Freyther | 64f5639 | 2016-04-27 22:06:46 +0200 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -ex |
| 4 | |
Neels Hofmeyr | de0acd2 | 2016-07-11 17:10:49 +0200 | [diff] [blame^] | 5 | base="$PWD" |
| 6 | deps="$base/deps" |
| 7 | inst="$deps/install" |
Holger Hans Peter Freyther | 64f5639 | 2016-04-27 22:06:46 +0200 | [diff] [blame] | 8 | |
Neels Hofmeyr | de0acd2 | 2016-07-11 17:10:49 +0200 | [diff] [blame^] | 9 | mkdir "$deps" || true |
| 10 | rm -rf "$inst" |
| 11 | |
| 12 | build_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 | |
| 31 | build_dep libosmocore |
| 32 | |
| 33 | # All below builds want this PKG_CONFIG_PATH |
| 34 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
| 35 | |
| 36 | build_dep libosmo-abis |
| 37 | build_dep libosmo-netif sysmocom/sctp |
| 38 | build_dep libosmo-sccp sysmocom/iu |
| 39 | build_dep libasn1c |
| 40 | |
| 41 | # the asn1c binary is used by the 'regen' target below |
| 42 | build_dep asn1c aper-prefix |
| 43 | |
| 44 | cd "$base" |
Holger Hans Peter Freyther | 64f5639 | 2016-04-27 22:06:46 +0200 | [diff] [blame] | 45 | autoreconf --install --force |
Neels Hofmeyr | de0acd2 | 2016-07-11 17:10:49 +0200 | [diff] [blame^] | 46 | ./configure |
| 47 | PATH="$inst/bin:$PATH" $MAKE $PARALLEL_MAKE -C src regen |
| 48 | $MAKE $PARALLEL_MAKE |
| 49 | LD_LIBRARY_PATH="$inst/lib" $MAKE check |
Holger Hans Peter Freyther | 64f5639 | 2016-04-27 22:06:46 +0200 | [diff] [blame] | 50 | # distcheck is broken |
Neels Hofmeyr | de0acd2 | 2016-07-11 17:10:49 +0200 | [diff] [blame^] | 51 | #LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck |