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