-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathopus-build
More file actions
executable file
·45 lines (33 loc) · 1.05 KB
/
opus-build
File metadata and controls
executable file
·45 lines (33 loc) · 1.05 KB
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
#!/bin/bash -e
. config.conf
NDK_PATH="$DOWNLOAD_DIR/${NDK_DIR_NAME}"
OPUS_PATH="$DOWNLOAD_DIR/${OPUS_DIR_NAME}"
LIB_PATH="${OPUS_BUILD_OUT_PATH}/libs"
LOG_PATH="${OPUS_BUILD_OUT_PATH}/logs"
LIB_BUILD_PATH="$OPUS_PATH/obj/local"
LIB_HEADERS_PATH="$OPUS_PATH/include"
OPUS_UTILS_PATH="${UTILS_PATH}/opus"
rm -rf "${OPUS_BUILD_OUT_PATH}"
mkdir -p "${LIB_PATH}"
mkdir -p "${LOG_PATH}"
cd $OPUS_PATH
# Download Android.mk
echo "Using stored Android.mk file from utils dir ..."
mkdir -p jni
(cd jni && cp $OPUS_UTILS_PATH/Android.mk .)
# Build Opus
echo "Building Opus $OPUS_VERSION ..."
$NDK_PATH/ndk-build APP_PLATFORM=android-${TARGET_ANDROID_API} >> "${LOG_PATH}/opus.log" 2>&1
# Copy Files to Build Directory
echo "Copying build file in Opus Build directory ..."
cp -r $LIB_BUILD_PATH/* $LIB_PATH
for arch in "${TARGET_ARCHS[@]}"
do
echo "Copying Opus file for target arch $arch ..."
cd $LIB_PATH/$arch
mkdir -p lib
mv `ls | grep -w -v lib` lib
mkdir -p include/opus
cp $LIB_HEADERS_PATH/* include/opus
done
echo "Finished building Opus"