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" |
Neels Hofmeyr | 0961408 | 2016-07-11 19:27:22 +0200 | [diff] [blame] | 15 | set +x |
| 16 | echo |
| 17 | echo |
| 18 | echo |
| 19 | echo " =============================== $project ===============================" |
| 20 | echo |
| 21 | set -x |
Neels Hofmeyr | de0acd2 | 2016-07-11 17:10:49 +0200 | [diff] [blame] | 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 |
Neels Hofmeyr | 0961408 | 2016-07-11 19:27:22 +0200 | [diff] [blame] | 33 | git rev-parse HEAD |
Neels Hofmeyr | de0acd2 | 2016-07-11 17:10:49 +0200 | [diff] [blame] | 34 | autoreconf --install --force |
| 35 | ./configure --prefix="$inst" |
| 36 | $MAKE $PARALLEL_MAKE install |
| 37 | } |
| 38 | |
| 39 | build_dep libosmocore |
| 40 | |
| 41 | # All below builds want this PKG_CONFIG_PATH |
| 42 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
| 43 | |
| 44 | build_dep libosmo-abis |
| 45 | build_dep libosmo-netif sysmocom/sctp |
| 46 | build_dep libosmo-sccp sysmocom/iu |
| 47 | build_dep libasn1c |
| 48 | |
| 49 | # the asn1c binary is used by the 'regen' target below |
| 50 | build_dep asn1c aper-prefix |
| 51 | |
| 52 | cd "$base" |
Neels Hofmeyr | 6458c30 | 2016-07-11 21:56:15 +0200 | [diff] [blame] | 53 | # Build using the checked-in asn1 code |
| 54 | autoreconf --install --force |
| 55 | ./configure |
| 56 | $MAKE $PARALLEL_MAKE |
| 57 | LD_LIBRARY_PATH="$inst/lib" $MAKE check |
| 58 | # distcheck is broken |
| 59 | #LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck |
| 60 | make clean |
| 61 | |
| 62 | # Build with regenerated asn1 code |
Holger Hans Peter Freyther | 64f5639 | 2016-04-27 22:06:46 +0200 | [diff] [blame] | 63 | autoreconf --install --force |
Neels Hofmeyr | de0acd2 | 2016-07-11 17:10:49 +0200 | [diff] [blame] | 64 | ./configure |
| 65 | PATH="$inst/bin:$PATH" $MAKE $PARALLEL_MAKE -C src regen |
| 66 | $MAKE $PARALLEL_MAKE |
| 67 | LD_LIBRARY_PATH="$inst/lib" $MAKE check |
Holger Hans Peter Freyther | 64f5639 | 2016-04-27 22:06:46 +0200 | [diff] [blame] | 68 | # distcheck is broken |
Neels Hofmeyr | de0acd2 | 2016-07-11 17:10:49 +0200 | [diff] [blame] | 69 | #LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck |