ffmpeg-kit/scripts/android/x264.sh

49 lines
1.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
# SET BUILD OPTIONS
ASM_OPTIONS=""
2020-08-05 03:53:02 +03:00
case ${ARCH} in
2020-11-23 00:51:45 +02:00
x86)
# please note that asm is disabled
# enabling asm for x86 causes text relocations in libavfilter.so
ASM_OPTIONS="--disable-asm"
;;
x86-64)
if ! [ -x "$(command -v nasm)" ]; then
echo -e "\n(*) nasm command not found\n"
return 1
fi
export AS="$(command -v nasm)"
# WORKAROUND TO ENABLE X86 ASM
# https://github.com/android-ndk/ndk/issues/693
export CFLAGS="${CFLAGS} -mno-stackrealign"
;;
esac
2020-08-05 03:53:02 +03:00
2020-11-23 00:51:45 +02:00
# ALWAYS CLEAN THE PREVIOUS BUILD
make distclean 2>/dev/null 1>/dev/null
2020-08-05 03:53:02 +03:00
2020-11-23 00:51:45 +02:00
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_x264} -eq 1 ]]; then
autoreconf_library "${LIB_NAME}"
fi
2020-08-05 03:53:02 +03:00
./configure \
2020-11-23 00:51:45 +02:00
--prefix="${LIB_INSTALL_PREFIX}" \
--enable-pic \
--sysroot="${ANDROID_SYSROOT}" \
--enable-static \
--disable-cli \
${ASM_OPTIONS} \
--host="${HOST}" || return 1
2020-08-05 03:53:02 +03:00
2020-11-23 00:51:45 +02:00
make -j$(get_cpu_count) || return 1
2020-08-05 03:53:02 +03:00
2020-11-23 00:51:45 +02:00
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 x264.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1