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 -x -e |
| 3 | |
| 4 | base="$PWD" |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 5 | prefix="$base/inst-osmo-bts-trx" |
| 6 | |
| 7 | rm -f "$base/osmo-bts-trx*.tgz" |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 8 | |
| 9 | deps=" |
| 10 | libosmocore |
| 11 | libosmo-abis |
| 12 | osmo-trx |
| 13 | osmo-bts |
| 14 | " |
| 15 | |
| 16 | have_repo() { |
| 17 | repo="$1" |
| 18 | cd "$base" |
| 19 | if [ ! -e "$repo" ]; then |
| 20 | set +x |
| 21 | echo "MISSING REPOSITORY: $repo" |
| 22 | echo "should be provided by the jenkins workspace" |
| 23 | exit 1 |
| 24 | fi |
| 25 | cd "$repo" |
| 26 | git clean -dxf |
| 27 | cd "$base" |
| 28 | } |
| 29 | |
| 30 | # for gsm_data_shared.* |
| 31 | have_repo openbsc |
| 32 | |
| 33 | |
| 34 | rm -rf "$prefix" |
| 35 | mkdir -p "$prefix" |
| 36 | |
| 37 | export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" |
| 38 | export LD_LIBRARY_PATH="$prefix/lib" |
| 39 | |
| 40 | for dep in $deps; do |
| 41 | have_repo "$dep" |
| 42 | cd "$dep" |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 43 | rm -rf * |
| 44 | git checkout . |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 45 | |
| 46 | echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-trx_osmo-trx_git_hashes.txt" |
| 47 | |
| 48 | autoreconf -fi |
| 49 | |
| 50 | config_opts="" |
| 51 | |
| 52 | case "$repo" in |
| 53 | 'osmo-bts') config_opts="--enable-trx --with-openbsc=$base/openbsc/openbsc/include" ;; |
| 54 | 'osmo-trx') config_opts="--without-sse" ;; |
| 55 | esac |
| 56 | |
| 57 | ./configure --prefix="$prefix" $config_opts |
| 58 | make -j8 |
| 59 | make install |
| 60 | done |
| 61 | |
| 62 | # build the archive that is going to be copied to the tester |
Neels Hofmeyr | 8bedf8c | 2017-05-02 17:00:30 +0200 | [diff] [blame] | 63 | rm "$base"/*.tgz || true |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 64 | cd "$prefix" |
| 65 | tar czf "$base/osmo-bts-trx.build-${BUILD_NUMBER}.tgz" * |