-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_libs.sh
executable file
·99 lines (84 loc) · 2.82 KB
/
build_libs.sh
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
#!/bin/sh
#sudo apt update
#sudo apt install -y autoconf automake libtool pkg-config make cmake gcc zlib1g-dev libssl-dev openssl git wget
mkdir -p libbaresip
cd libbaresip/
mkdir -p git
mkdir -p re
mkdir -p rem
mkdir -p baresip
mkdir -p opus
mkdir -p openssl
my_base_modules="account b2bua contact cons ctrl_tcp debug_cmd echo httpd menu natpmp ice stun turn serreg uuid stdio"
my_audio_modules="aubridge aufile ausine mixminus"
my_codec_modules="g711 g722 opus"
my_tls_modules="dtls_srtp srtp"
opus="1.3.1"
openssl="1.1.1k"
sl_extra_cflags="-I ../my_include "
sl_extra_lflags="-L ../opus -L ../opus/libopus.a -L ../openssl ../openssl/libssl.a ../openssl/libcrypto.a "
cd git
if [ ! -d "re" ]; then
git clone https://github.com/baresip/re.git
fi
cd re; make clean; make -j16 USE_ZLIB= RELEASE=1 libre.a; cp libre.a ../../re; cd ..
if [ ! -d "rem" ]; then
git clone https://github.com/baresip/rem.git
fi
cd rem; make clean; make -j16 USE_ZLIB= RELEASE=1 librem.a; cp librem.a ../../rem; cd ..
if [ ! -d "openssl-${openssl}" ]; then
wget https://www.openssl.org/source/openssl-${openssl}.tar.gz
tar -xzf openssl-${openssl}.tar.gz
fi
cd openssl-${openssl}; ./config no-shared; make clean; make -j16 build_libs; cd ..
mkdir -p openssl
mkdir -p my_include/openssl
cp openssl-${openssl}/*.a ../openssl; cp openssl-${openssl}/*.a openssl
cp openssl-${openssl}/include/openssl/*.h my_include/openssl
if [ ! -d "opus-${opus}" ]; then
wget "https://archive.mozilla.org/pub/opus/opus-${opus}.tar.gz"
tar -xzf opus-${opus}.tar.gz
fi
cd opus-${opus}; ./configure --with-pic; make clean; make -j16; cd ..
mkdir -p opus
mkdir -p my_include/opus
cp opus-${opus}/.libs/libopus.a ../opus; cp opus-${opus}/.libs/libopus.a opus
cp opus-${opus}/include/*.h my_include/opus
if [ ! -d "baresip" ]; then
git clone https://github.com/baresip/baresip.git
fi
cd baresip
rm -rf modules/g722
cp -ap ../../../g722 modules/
make clean; make -j16 LIBRE_SO=../re LIBREM_PATH=../rem USE_ZLIB= RELEASE=1 STATIC=1 libbaresip.a \
MODULES="$my_base_modules $my_audio_modules $my_codec_modules $my_tls_modules" \
EXTRA_CFLAGS="$sl_extra_cflags" \
EXTRA_LFLAGS="$sl_extra_lflags"
cp libbaresip.a ../../baresip; cd ..
cp -R re/include ../re
cp -R rem/include ../rem
cp -R baresip/include ../baresip
cd ../..
: '
cd espeak
if [ ! -d "espeak-ng" ]; then
git clone https://github.com/espeak-ng/espeak-ng.git
fi
cd espeak-ng
./autogen.sh
./configure --without-async --without-mbrola --without-sonic --without-speechplayer
make -j16
cp src/.libs/libespeak-ng.a ../
cp src/include/espeak-ng/speak_lib.h ../
make clean
cd ..
if [ ! -d "soxr-code" ]; then
git clone https://git.code.sf.net/p/soxr/code soxr-code
fi
cd soxr-code
cmake -DWITH_OPENMP=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=0 -DBUILD_EXAMPLES=0 .
make -j16
cp src/libsoxr.a src/soxr.h ../
make clean
cd ..
'