From f0bd8976ba77266fda286214fe99b0959c9f5313 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 6 Feb 2014 14:23:34 +0100 Subject: [PATCH] Add patch to fix log2f problems with latest android ndk. --- Makefile | 6 +++++- patches/x264_log2f_fix.patch | 41 ++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 patches/x264_log2f_fix.patch diff --git a/Makefile b/Makefile index 277b47e36..10351cecd 100644 --- a/Makefile +++ b/Makefile @@ -156,7 +156,7 @@ clean-ffmpeg: #x264 ifeq ($(BUILD_X264), 1) -BUILD_X264_DEPS=$(X264_BUILD_DIR)/arm/libx264.a +BUILD_X264_DEPS=$(X264_SRC_DIR)/log2f_fix_patch_applied.txt $(X264_BUILD_DIR)/arm/libx264.a ifeq ($(BUILD_FOR_X86), 1) BUILD_X264_DEPS+=$(X264_BUILD_DIR)/x86/libx264.a endif @@ -166,6 +166,10 @@ X264_CONFIGURE_OPTIONS= X264_ARM_CONFIGURE_OPTIONS=--host=arm-none-linux-gnueabi --sysroot=$(ARM_SYSROOT) --cross-prefix=$(ARM_TOOLCHAIN_PATH) --enable-pic X264_X86_CONFIGURE_OPTIONS=--host=i686-linux-gnueabi --sysroot=$(X86_SYSROOT) --cross-prefix=$(X86_TOOLCHAIN_PATH) +$(X264_SRC_DIR)/log2f_fix_patch_applied.txt: + @patch -p0 < $(TOPDIR)/patches/x264_log2f_fix.patch + touch $@ + $(X264_BUILD_DIR)/arm/libx264.a: mkdir -p $(X264_BUILD_DIR)/arm && \ cd $(X264_SRC_DIR) && \ diff --git a/patches/x264_log2f_fix.patch b/patches/x264_log2f_fix.patch new file mode 100644 index 000000000..e5d0647a0 --- /dev/null +++ b/patches/x264_log2f_fix.patch @@ -0,0 +1,41 @@ +diff -urN submodules/externals/x264/common/osdep.h.orig submodules/externals/x264/common/osdep.h +--- submodules/externals/x264/common/osdep.h.orig 2014-02-06 13:56:59.243663951 +0100 ++++ submodules/externals/x264/common/osdep.h 2014-02-06 13:57:17.215685078 +0100 +@@ -35,11 +35,6 @@ + + #include "config.h" + +-#if !HAVE_LOG2F +-#define log2f(x) (logf(x)/0.693147180559945f) +-#define log2(x) (log(x)/0.693147180559945) +-#endif +- + #ifdef _WIN32 + #include // _setmode() + #include // _O_BINARY +@@ -55,6 +60,11 @@ + #include + #endif + ++#if !HAVE_LOG2F ++#define log2f(x) (logf(x)/0.693147180559945f) ++#define log2(x) (log(x)/0.693147180559945) ++#endif ++ + #if (defined(__GNUC__) || defined(__INTEL_COMPILER)) && (ARCH_X86 || ARCH_X86_64) + #define HAVE_X86_INLINE_ASM 1 + #endif +diff -urN submodules/externals/x264/configure.orig submodules/externals/x264/configure +--- submodules/externals/x264/configure.orig 2014-02-06 13:56:59.231663937 +0100 ++++ submodules/externals/x264/configure 2014-02-06 13:57:17.219685083 +0100 +@@ -816,10 +816,6 @@ + fi + [ "$thread" != "no" ] && define HAVE_THREAD + +-if cc_check "math.h" "-Werror" "return log2f(2);" ; then +- define HAVE_LOG2F +-fi +- + if [ "$vis" = "yes" ] ; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -I/usr/X11R6/include"