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