Project

General

Profile

build_2G.sh

example build script - laforge, 09/06/2017 11:55 AM

Download (1.13 KB)

 
1
#!/bin/sh
2

    
3
# These components are built
4
reposes="
5
libosmocore
6
libosmo-abis
7
libosmo-netif
8
libosmo-sccp
9
osmo-ggsn
10
libsmpp34
11
openbsc/openbsc
12
"
13

    
14
# Set 'prefix' to a path of your choice to install to a prefix
15
prefix=""
16

    
17
# (don't change this)
18
opt_prefix=""
19
if [ -n "$prefix" ]; then
20
	export LD_LIBRARY_PATH="$prefix"/lib
21
	export PKG_CONFIG_PATH="$prefix"/lib/pkgconfig
22
	opt_prefix="--prefix=$prefix"
23
fi
24

    
25
do_clean="1"
26

    
27
if [ "$1" = "noclean" ]; then
28
	do_clean="0"
29
elif [ -n "$1" ]; then
30
	echo "unknown argument: '$1'"
31
	echo "
32
Args:
33
  noclean   skip the 'make clean' step
34
"
35
	exit 1
36
fi
37

    
38
set -x -e
39
base="$PWD"
40
builddir="build-2G"
41
for r in $reposes; do
42
	echo "======================= $r ======================"
43

    
44
	cd "$base/$r"
45
	if [ "$do_clean" = "1" ]; then
46
		set +e
47
		make distclean
48
		rm -rf "$builddir"
49
		set -e
50
		autoreconf -fi
51
	fi
52

    
53
	mkdir -p "$builddir"
54
	cd "$builddir"
55

    
56
	if [ "$do_clean" = "1" ]; then
57
		opt_enable=""
58
		if [ "$r" = 'openbsc/openbsc' ]; then
59
			opt_enable="--enable-smpp --enable-osmo-bsc --enable-nat"
60
		fi
61

    
62
		../configure "$opt_prefix" $opt_enable
63
		set +e
64
		make clean
65
		set -e
66
	fi
67

    
68
	make -j || make || make
69
	make check
70
	make install
71
done