Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -ex |
| 4 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 5 | base="$PWD" |
| 6 | deps="$base/deps" |
| 7 | inst="$deps/install" |
Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 8 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 9 | mkdir "$deps" || true |
| 10 | rm -rf "$inst" |
| 11 | |
| 12 | build_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 | |
| 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 | |
Neels Hofmeyr | 9759374 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 44 | if [ "x$IU" = "x--enable-iu" ]; then |
| 45 | netif_branch="sysmocom/sctp" |
| 46 | sccp_branch="sysmocom/iu" |
| 47 | fi |
| 48 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 49 | build_dep libosmo-abis |
Neels Hofmeyr | 9759374 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 50 | build_dep libosmo-netif $netif_branch |
| 51 | build_dep libosmo-sccp $sccp_branch |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 52 | PARALLEL_MAKE="" build_dep libsmpp34 |
| 53 | build_dep openggsn |
| 54 | |
Neels Hofmeyr | 9759374 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 55 | if [ "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 |
| 59 | fi |
| 60 | |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 61 | cd "$base" |
| 62 | cd openbsc |
Holger Hans Peter Freyther | a47b401 | 2016-04-13 19:03:38 -0400 | [diff] [blame] | 63 | autoreconf --install --force |
Neels Hofmeyr | 9759374 | 2016-07-11 19:44:58 +0200 | [diff] [blame] | 64 | ./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests |
Neels Hofmeyr | a3d93ed | 2016-07-11 19:39:51 +0200 | [diff] [blame] | 65 | $MAKE $PARALLEL_MAKE |
| 66 | LD_LIBRARY_PATH="$inst/lib" $MAKE check |
| 67 | LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck |