11#! /usr/bin/env bash
22
33case $ANDROID_ABI in
4+ armeabi-v7a)
5+ EXTRA_BUILD_CONFIGURATION_FLAGS=--enable-thumb
6+ ;;
47 x86)
58# Disabling assembler optimizations, because they have text relocations
69 EXTRA_BUILD_CONFIGURATION_FLAGS=--disable-asm
2124DEP_CFLAGS=" -I${BUILD_DIR_EXTERNAL} /${ANDROID_ABI} /include"
2225DEP_LD_FLAGS=" -L${BUILD_DIR_EXTERNAL} /${ANDROID_ABI} /lib$FFMPEG_EXTRA_LD_FLAGS "
2326
27+ # Everything that goes below ${EXTRA_BUILD_CONFIGURATION_FLAGS} is my project-specific.
28+ # You are free to enable/disable whatever you actually need.
29+
2430./configure \
2531 --prefix=${BUILD_DIR_FFMPEG} /${ANDROID_ABI} \
2632 --enable-cross-compile \
@@ -35,6 +41,19 @@ DEP_LD_FLAGS="-L${BUILD_DIR_EXTERNAL}/${ANDROID_ABI}/lib $FFMPEG_EXTRA_LD_FLAGS"
3541 --disable-static \
3642 --pkg-config=$( which pkg-config) \
3743${EXTRA_BUILD_CONFIGURATION_FLAGS} \
44+ --disable-runtime-cpudetect \
45+ --disable-programs \
46+ --disable-muxers \
47+ --disable-encoders \
48+ --disable-avdevice \
49+ --disable-postproc \
50+ --disable-swresample \
51+ --disable-avfilter \
52+ --disable-doc \
53+ --disable-debug \
54+ --disable-pthreads \
55+ --disable-network \
56+ --disable-bsfs \
3857$ADDITIONAL_COMPONENTS
3958
4059${MAKE_EXECUTABLE} clean