forked from nesterenkodm/pjsip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·59 lines (48 loc) · 1.3 KB
/
build.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
#!/bin/sh
# see http://stackoverflow.com/a/3915420/318790
function realpath { echo $(cd $(dirname "$1"); pwd)/$(basename "$1"); }
__FILE__=`realpath "$0"`
__DIR__=`dirname "${__FILE__}"`
BUILD_DIR="${__DIR__}/build"
if [ ! -d ${BUILD_DIR} ]; then
mkdir ${BUILD_DIR}
fi
# download
function download() {
"${__DIR__}/download.sh" "$1" "$2" #--no-cache
}
# openssl
OPENSSL_DIR="${BUILD_DIR}/openssl"
OPENSSL_ENABLED=
function openssl() {
OPENSSL_URL="https://raw.githubusercontent.com/x2on/OpenSSL-for-iPhone/master/build-libssl.sh"
OPENSSL_SH="${OPENSSL_DIR}/build-libssl.sh"
download ${OPENSSL_URL} ${OPENSSL_SH}
if [ ! -f "${OPENSSL_DIR}/lib/libssl.a" ]; then
pushd . > /dev/null
cd ${OPENSSL_DIR}
/bin/sh ${OPENSSL_SH}
popd > /dev/null
else
echo "Using OpenSSL..."
fi
OPENSSL_ENABLED=1
}
# openh264
OPENH264_DIR="${BUILD_DIR}/openh264"
OPENH264_ENABLED=
function openh264() {
if [ ! -f "${OPENH264_DIR}/lib/libopenh264.a" ]; then
"${__DIR__}/openh264.sh" "${OPENH264_DIR}"
else
echo "Using OpenH264..."
fi
OPENH264_ENABLED=1
}
PJSIP_DIR="${BUILD_DIR}/pjproject"
function pjsip() {
"${__DIR__}/pjsip.sh" "${PJSIP_DIR}" --with-openssl "${OPENSSL_DIR}" --with-openh264 "${OPENH264_DIR}"
}
openssl
openh264
pjsip