summaryrefslogtreecommitdiffstats
path: root/coverity/build_Osmocom.sh
blob: 842f496f71a4cb374aca0fc4a9cd13c6ef1fdd60 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#!/usr/bin/env bash

set -e -x

base_dir="$PWD"
src_dir="$base_dir/source-Osmocom"
prefix="$base_dir/install-Osmocom"

install -d "$prefix"

export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"

git_branch() {
  echo "$(git status)" | grep 'On branch' | sed 's/On branch //'
}

do_build() {
	autoreconf --install --force
	./configure --prefix="$prefix" $*

	make
	make install
}

build_layer1api() {
	pushd layer1-api
	install -d "$prefix/include/sysmocom/femtobts/"
	cp include/*.h "$prefix/include/sysmocom/femtobts/"
	popd
}

build_asn1c() {
	pushd asn1c
	do_build
	popd
}

build_libasn1c() {
	pushd libasn1c
	do_build
	sed -i s,'#include "config.h"','/*#include "config.h"*/', "$prefix/include/asn1c/asn_system.h"
	popd
}

build_osmoiuh() {
	pushd osmo-iuh
	do_build
	popd
}

build_libosmocore() {
	pushd libosmocore

	do_build
	popd
}

build_libosmoabis() {
	pushd libosmo-abis

	do_build
	popd
}

build_libosmosccp() {
	pushd libosmo-sccp

	do_build
	popd
}

build_openggsn() {
	pushd openggsn
	do_build
	popd
}

build_openbsc() {
	pushd openbsc/openbsc
	git checkout sysmocom/iu

	do_build --enable-osmo-bsc --enable-nat --enable-smpp --enable-mgcp-transcoding --enable-iu
	popd
}

build_osmobts() {
	pushd openbsc/openbsc
	git checkout master
	git pull --rebase
	popd
	pushd osmo-bts

	do_build --enable-sysmocom-bts --with-openbsc="$src_dir/openbsc/openbsc/include"
	popd
}

build_osmopcu() {
	pushd osmo-pcu 

	do_build --enable-sysmocom-bts=yes --enable-sysmocom-dsp=yes
	popd
}

build_libosmodsp() {
	pushd libosmo-dsp
	do_build
	popd
}

build_libosmonetif() {
	pushd libosmo-netif
	do_build
	popd
}

build_osmogmr() {
	pushd osmo-gmr
	do_build
	popd
}

build_libsmpp34() {
	pushd libsmpp34
	do_build
	popd
}

build_osmosipconnector() {
	pushd osmo-sip-connector
	do_build
	popd
}

build_osmotrx() {
	pushd osmo-trx
	do_build
	popd
}

cd "$src_dir"

rm -rf "$prefix"

build_layer1api
build_asn1c
build_libosmocore
build_libasn1c
build_libosmoabis
build_libosmonetif
build_libosmosccp
build_libsmpp34
build_openggsn
build_osmoiuh
build_osmopcu
build_osmobts
build_openbsc

# GMR
build_libosmodsp
build_osmogmr

# MNCC to SIP
build_osmosipconnector

build_osmotrx