Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 1 | #!/bin/sh |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 2 | set -e -x |
| 3 | |
| 4 | deps=" |
| 5 | libosmocore |
| 6 | libosmo-abis |
| 7 | osmo-bts |
| 8 | " |
| 9 | |
| 10 | base="$PWD" |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 11 | rm -f "$base/osmo-bts-sysmo.*.tgz" |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 12 | |
| 13 | have_repo() { |
| 14 | repo="$1" |
| 15 | cd "$base" |
| 16 | if [ ! -e "$repo" ]; then |
| 17 | set +x |
| 18 | echo "MISSING REPOSITORY: $repo" |
| 19 | echo "should be provided by the jenkins workspace" |
| 20 | exit 1 |
| 21 | fi |
| 22 | cd "$repo" |
| 23 | git clean -dxf |
| 24 | cd "$base" |
| 25 | } |
| 26 | |
| 27 | for dep in $deps; do |
| 28 | have_repo "$dep" |
| 29 | done |
| 30 | |
| 31 | # for gsm_data_shared.h |
| 32 | have_repo openbsc |
| 33 | |
| 34 | . /opt/poky/1.5.4/environment-setup-armv5te-poky-linux-gnueabi |
| 35 | |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 36 | # Cross-compilation: all installations need to be put in the sysmo SDK sysroot |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 37 | export DESTDIR=/opt/poky/1.5.4/sysroots/armv5te-poky-linux-gnueabi |
| 38 | |
| 39 | prefix_base="/usr/local/jenkins-build" |
| 40 | prefix_base_real="$DESTDIR$prefix_base" |
| 41 | rm -rf "$prefix_base_real" |
| 42 | |
| 43 | prefix="$prefix_base/inst-osmo-bts-sysmo" |
| 44 | prefix_real="$DESTDIR$prefix" |
| 45 | mkdir -p "$prefix_real" |
| 46 | |
| 47 | for dep in $deps; do |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 48 | cd "$base/$dep" |
| 49 | rm -rf * |
| 50 | git checkout . |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 51 | |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 52 | echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/osmo-bts-sysmo_git_hashes.txt" |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 53 | |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 54 | autoreconf -fi |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 55 | |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 56 | config_opts="" |
| 57 | case "$dep" in |
| 58 | 'libosmocore') config_opts="--disable-pcsc" ;; |
| 59 | 'osmo-bts') config_opts="--enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include" ;; |
| 60 | esac |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 61 | |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 62 | ./configure --prefix="$prefix" $CONFIGURE_FLAGS $config_opts |
| 63 | make -j8 |
| 64 | make install |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 65 | done |
| 66 | |
| 67 | # build the archive that is going to be copied to the tester and then to the BTS |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 68 | cd "$prefix_real" |
Neels Hofmeyr | 3531a19 | 2017-03-28 14:30:28 +0200 | [diff] [blame] | 69 | tar cvzf "$base/osmo-bts-sysmo.build-${BUILD_NUMBER}.tgz" * |