You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ffmpeg-android-maker/scripts/ffmpeg/build.sh

43 lines
1.2 KiB

5 years ago
#!/usr/bin/env bash
case $ANDROID_ABI in
x86)
# Disabling assembler optimizations, because they have text relocations
EXTRA_BUILD_CONFIGURATION_FLAGS=--disable-asm
;;
x86_64)
EXTRA_BUILD_CONFIGURATION_FLAGS=--x86asmexe=${FAM_YASM}
;;
esac
# Preparing flags for enabling requested libraries
ADDITIONAL_COMPONENTS=
for LIBARY_NAME in ${FFMPEG_EXTERNAL_LIBRARIES[@]}
do
ADDITIONAL_COMPONENTS+=" --enable-$LIBARY_NAME"
done
# Referencing dependencies without pkgconfig
DEP_CFLAGS="-I${BUILD_DIR_EXTERNAL}/${ANDROID_ABI}/include"
DEP_LD_FLAGS="-L${BUILD_DIR_EXTERNAL}/${ANDROID_ABI}/lib $FFMPEG_EXTRA_LD_FLAGS"
./configure \
--prefix=${BUILD_DIR_FFMPEG}/${ANDROID_ABI} \
--enable-cross-compile \
--target-os=android \
--arch=${TARGET_TRIPLE_MACHINE_BINUTILS} \
--sysroot=${SYSROOT_PATH} \
--cross-prefix=${CROSS_PREFIX_WITH_PATH} \
--cc=${FAM_CC} \
--extra-cflags="-O3 -fPIC $DEP_CFLAGS" \
--extra-ldflags="$DEP_LD_FLAGS" \
--enable-shared \
--disable-static \
--pkg-config=$(which pkg-config) \
${EXTRA_BUILD_CONFIGURATION_FLAGS} \
$ADDITIONAL_COMPONENTS
${MAKE_EXECUTABLE} clean
${MAKE_EXECUTABLE} -j${HOST_NPROC}
${MAKE_EXECUTABLE} install