mirror of
https://github.com/androidx/media.git
synced 2025-05-09 16:40:55 +08:00
Fix VP9 build setup
Update configuration script to use an external build, so we can remove use of isysroot which is broken in the latest NDK r19c. Also switch from gnustl_static to c++_static so that ndk-build with NDK r19c succeeds. Issue: #5922 PiperOrigin-RevId: 250287551
This commit is contained in:
parent
47cc567dca
commit
c495a3f55e
@ -29,6 +29,7 @@ VP9_EXT_PATH="${EXOPLAYER_ROOT}/extensions/vp9/src/main"
|
||||
```
|
||||
|
||||
* Download the [Android NDK][] and set its location in an environment variable.
|
||||
The build configuration has been tested with Android NDK r19c.
|
||||
|
||||
```
|
||||
NDK_PATH="<path to Android NDK>"
|
||||
@ -54,7 +55,7 @@ git checkout tags/v1.8.0 -b v1.8.0
|
||||
|
||||
```
|
||||
cd ${VP9_EXT_PATH}/jni && \
|
||||
./generate_libvpx_android_configs.sh "${NDK_PATH}"
|
||||
./generate_libvpx_android_configs.sh
|
||||
```
|
||||
|
||||
* Build the JNI native libraries from the command line:
|
||||
|
@ -15,6 +15,6 @@
|
||||
#
|
||||
|
||||
APP_OPTIM := release
|
||||
APP_STL := gnustl_static
|
||||
APP_STL := c++_static
|
||||
APP_CPPFLAGS := -frtti
|
||||
APP_PLATFORM := android-9
|
||||
APP_PLATFORM := android-16
|
||||
|
@ -20,46 +20,33 @@
|
||||
|
||||
set -e
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: ${0} <path_to_android_ndk>"
|
||||
if [ $# -ne 0 ]; then
|
||||
echo "Usage: ${0}"
|
||||
exit
|
||||
fi
|
||||
|
||||
ndk="${1}"
|
||||
shift 1
|
||||
|
||||
# configuration parameters common to all architectures
|
||||
common_params="--disable-examples --disable-docs --enable-realtime-only"
|
||||
common_params+=" --disable-vp8 --disable-vp9-encoder --disable-webm-io"
|
||||
common_params+=" --disable-libyuv --disable-runtime-cpu-detect"
|
||||
common_params+=" --enable-external-build"
|
||||
|
||||
# configuration parameters for various architectures
|
||||
arch[0]="armeabi-v7a"
|
||||
config[0]="--target=armv7-android-gcc --sdk-path=$ndk --enable-neon"
|
||||
config[0]+=" --enable-neon-asm"
|
||||
config[0]="--target=armv7-android-gcc --enable-neon --enable-neon-asm"
|
||||
|
||||
arch[1]="armeabi"
|
||||
config[1]="--target=armv7-android-gcc --sdk-path=$ndk --disable-neon"
|
||||
config[1]+=" --disable-neon-asm"
|
||||
arch[1]="x86"
|
||||
config[1]="--force-target=x86-android-gcc --disable-sse2"
|
||||
config[1]+=" --disable-sse3 --disable-ssse3 --disable-sse4_1 --disable-avx"
|
||||
config[1]+=" --disable-avx2 --enable-pic"
|
||||
|
||||
arch[2]="mips"
|
||||
config[2]="--force-target=mips32-android-gcc --sdk-path=$ndk"
|
||||
arch[2]="arm64-v8a"
|
||||
config[2]="--force-target=armv8-android-gcc --enable-neon"
|
||||
|
||||
arch[3]="x86"
|
||||
config[3]="--force-target=x86-android-gcc --sdk-path=$ndk --disable-sse2"
|
||||
arch[3]="x86_64"
|
||||
config[3]="--force-target=x86_64-android-gcc --disable-sse2"
|
||||
config[3]+=" --disable-sse3 --disable-ssse3 --disable-sse4_1 --disable-avx"
|
||||
config[3]+=" --disable-avx2 --enable-pic"
|
||||
|
||||
arch[4]="arm64-v8a"
|
||||
config[4]="--force-target=armv8-android-gcc --sdk-path=$ndk --enable-neon"
|
||||
|
||||
arch[5]="x86_64"
|
||||
config[5]="--force-target=x86_64-android-gcc --sdk-path=$ndk --disable-sse2"
|
||||
config[5]+=" --disable-sse3 --disable-ssse3 --disable-sse4_1 --disable-avx"
|
||||
config[5]+=" --disable-avx2 --enable-pic --disable-neon --disable-neon-asm"
|
||||
|
||||
arch[6]="mips64"
|
||||
config[6]="--force-target=mips64-android-gcc --sdk-path=$ndk"
|
||||
config[3]+=" --disable-avx2 --enable-pic --disable-neon --disable-neon-asm"
|
||||
|
||||
limit=$((${#arch[@]} - 1))
|
||||
|
||||
@ -102,10 +89,7 @@ for i in $(seq 0 ${limit}); do
|
||||
# configure and make
|
||||
echo "build_android_configs: "
|
||||
echo "configure ${config[${i}]} ${common_params}"
|
||||
../../libvpx/configure ${config[${i}]} ${common_params} --extra-cflags=" \
|
||||
-isystem $ndk/sysroot/usr/include/arm-linux-androideabi \
|
||||
-isystem $ndk/sysroot/usr/include \
|
||||
"
|
||||
../../libvpx/configure ${config[${i}]} ${common_params}
|
||||
rm -f libvpx_srcs.txt
|
||||
for f in ${allowed_files}; do
|
||||
# the build system supports multiple different configurations. avoid
|
||||
|
Loading…
x
Reference in New Issue
Block a user