forked from VoiSmart/pjsip-android-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openh264-build-target-archs
executable file
·69 lines (52 loc) · 1.62 KB
/
openh264-build-target-archs
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
#!/bin/bash -e
. config.conf
NDK_PATH=$(pwd)"/${NDK_DIR_NAME}"
SDK_TOOLS_PATH=$(pwd)"/${SDK_DIR_NAME}/tools"
OPENH264_PATH=$(pwd)"/${OPENH264_DIR_NAME}"
LIB_PATH="${OPENH264_BUILD_OUT_PATH}/libs"
LOG_PATH="${OPENH264_BUILD_OUT_PATH}/logs"
TMP_DIR="/tmp/openh264"
export PATH=${SDK_TOOLS_PATH}:$PATH
rm -rf "${OPENH264_BUILD_OUT_PATH}"
mkdir -p "${LIB_PATH}"
mkdir -p "${LOG_PATH}"
for arch in "${TARGET_ARCHS[@]}"
do
echo "Building OpenH264 for target arch $arch ..."
rm -rf "${TMP_DIR}"
mkdir -p "${TMP_DIR}"
cd ${OPENH264_PATH}
cp -r * ${TMP_DIR}
cd ${TMP_DIR}
mkdir -p "${LIB_PATH}/${arch}"
#change default output DIR for make install
sed -i "s*PREFIX=/usr/local*PREFIX=${LIB_PATH}/${arch}*g" Makefile
ARGS="OS=android NDKROOT=${NDK_PATH} NDKLEVEL=${OPENH264_TARGET_NDK_LEVEL} "
ARGS="${ARGS}TARGET=android-${TARGET_ANDROID_API} ARCH="
if [ "$arch" == "armeabi" ]
then
ARGS="${ARGS}arm APP_ABI=armeabi"
elif [ "$arch" == "armeabi-v7a" ]
then
ARGS="${ARGS}arm"
elif [ "$arch" == "x86" ]
then
ARGS="${ARGS}x86"
elif [ "$arch" == "x86_64" ]
then
ARGS="${ARGS}x86_64"
elif [ "$arch" == "arm64-v8a" ]
then
ARGS="${ARGS}arm64"
elif [ "$arch" == "mips" ]
then
ARGS="${ARGS}mips"
elif [ "$arch" == "mips64" ]
then
ARGS="${ARGS}mips64"
fi
make ${ARGS} >>"${LOG_PATH}/${arch}.log" 2>&1
mkdir -p ${LIB_PATH}/${arch}
make ${ARGS} install >>"${LOG_PATH}/${arch}.log" 2>&1
done
echo "Finished building OpenH264! Check output folder: ${OPENH264_BUILD_OUT_PATH}"