ffmpeg-kit/scripts/android/libvpx.sh

88 lines
2.1 KiB
Bash
Raw Normal View History

2020-08-05 03:53:02 +03:00
#!/bin/bash
2020-11-23 00:51:45 +02:00
# UPDATE BUILD FLAGS
export CFLAGS="$(get_cflags "${LIB_NAME}") -I${LIB_INSTALL_BASE}/cpu-features/include/ndk_compat"
2020-08-05 03:53:02 +03:00
2020-11-23 00:51:45 +02:00
# SET BUILD OPTIONS
2020-08-05 03:53:02 +03:00
TARGET_CPU=""
2020-11-23 00:51:45 +02:00
ASM_OPTIONS=""
2020-08-05 03:53:02 +03:00
case ${ARCH} in
2020-11-23 00:51:45 +02:00
arm-v7a)
TARGET_CPU="armv7"
# NEON disabled explicitly because
# --enable-runtime-cpu-detect enables NEON for armv7 cpu
ASM_OPTIONS="--disable-neon"
unset ASFLAGS
;;
arm-v7a-neon)
# NEON IS ENABLED BY --enable-runtime-cpu-detect
TARGET_CPU="armv7"
unset ASFLAGS
;;
arm64-v8a)
# NEON IS ENABLED BY --enable-runtime-cpu-detect
TARGET_CPU="arm64"
unset ASFLAGS
;;
*)
# INTEL CPU EXTENSIONS ENABLED BY --enable-runtime-cpu-detect
TARGET_CPU="$(get_target_cpu)"
export ASFLAGS="-D__ANDROID__"
;;
2020-08-05 03:53:02 +03:00
esac
2020-11-23 00:51:45 +02:00
# ALWAYS CLEAN THE PREVIOUS BUILD
2020-08-05 03:53:02 +03:00
make distclean 2>/dev/null 1>/dev/null
2020-11-23 00:51:45 +02:00
# NOTE THAT RECONFIGURE IS NOT SUPPORTED
2020-08-05 03:53:02 +03:00
2020-11-23 00:51:45 +02:00
# WORKAROUND TO FIX BUILD OPTIONS DEFINED IN configure.sh
overwrite_file "${BASEDIR}"/tools/patch/make/libvpx/configure.sh "${BASEDIR}"/src/"${LIB_NAME}"/build/make/configure.sh || return 1
2020-08-05 03:53:02 +03:00
2020-11-23 00:51:45 +02:00
./configure \
--prefix="${LIB_INSTALL_PREFIX}" \
--target="${TARGET_CPU}-android-gcc" \
--extra-cflags="${CFLAGS}" \
--extra-cxxflags="${CXXFLAGS}" \
--as=yasm \
--log=yes \
--enable-libs \
--enable-install-libs \
--enable-pic \
--enable-optimizations \
--enable-better-hw-compatibility \
--enable-runtime-cpu-detect \
${ASM_OPTIONS} \
--enable-vp8 \
--enable-vp9 \
--enable-multithread \
--enable-spatial-resampling \
--enable-small \
--enable-static \
--disable-realtime-only \
--disable-shared \
--disable-debug \
--disable-gprof \
--disable-gcov \
--disable-ccache \
--disable-install-bins \
--disable-install-srcs \
--disable-install-docs \
--disable-docs \
--disable-tools \
--disable-examples \
--disable-unit-tests \
--disable-decode-perf-tests \
--disable-encode-perf-tests \
--disable-codec-srcs \
--disable-debug-libs \
--disable-internal-stats || return 1
make -j$(get_cpu_count) || return 1
make install || return 1
2020-08-05 03:53:02 +03:00
2020-11-23 00:51:45 +02:00
# MANUALLY COPY PKG-CONFIG FILES
cp ./*.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1