summaryrefslogtreecommitdiffstats
path: root/contrib/jenkins-osmo-bts-octphy.sh
blob: 49560ca6d840748c51200004c6a9701196dbce3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
set -x -e

base="$PWD"
prefix="$base/inst-osmo-bts-octphy"

rm -f "$base/osmo-bts-octphy*.tgz"

deps="
libosmocore
libosmo-abis
osmo-bts
"

have_repo() {
	repo="$1"
	cd "$base"
	if [ ! -e "$repo" ]; then
		set +x
		echo "MISSING REPOSITORY: $repo"
		echo "should be provided by the jenkins workspace"
		exit 1
	fi
	cd "$repo"
	git clean -dxf
	cd "$base"
}

# for gsm_data_shared.*
have_repo openbsc

# octphy headers
have_repo octphy-2g-headers


rm -rf "$prefix"
mkdir -p "$prefix"

export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
export LD_LIBRARY_PATH="$prefix/lib"

for dep in $deps; do
	have_repo "$dep"
	cd "$dep"
	rm -rf *
	git checkout .

	echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-octphy_git_hashes.txt"

	autoreconf -fi

	config_opts=""

	case "$repo" in
	'osmo-bts')	config_opts="$config_opts --enable-octphy --with-octsdr-2g=$base/octphy-2g-headers" ;;
	esac

	./configure --prefix="$prefix" $config_opts
	make -j8
	make install
done

# build the archive that is going to be copied to the tester
rm "$base"/*.tgz || true
cd "$prefix"
tar czf "$base/osmo-bts-octphy.build-${BUILD_NUMBER}.tgz" *