Commit a226c547 authored by Adrien Béraud's avatar Adrien Béraud

contrib: fix Android build without standalone toolchain

Change-Id: Ic4eeecb3d982e1b2409cf5a5a364ed6b32395655
parent d2f88a9f
......@@ -194,7 +194,6 @@ endif
ifdef HAVE_LINUX
FFMPEGCONF += --enable-pic
FFMPEGCONF += --extra-cxxflags=-fPIC --extra-cflags=-fPIC
ifdef HAVE_ANDROID
# Android Linux
FFMPEGCONF += \
......@@ -204,7 +203,14 @@ FFMPEGCONF += \
--enable-decoder=vp8_mediacodec \
--enable-decoder=h264_mediacodec \
--enable-decoder=mpeg4_mediacodec \
--enable-decoder=hevc_mediacodec
--enable-decoder=hevc_mediacodec \
--enable-cross-compile \
--ranlib=$(RANLIB) \
--strip=$(STRIP) \
--cc=$(CC) \
--cxx=$(CXX) \
--ld=$(CC) \
--ar=$(AR)
# ASM not working on Android x86 https://trac.ffmpeg.org/ticket/4928
ifeq ($(ARCH),i386)
FFMPEGCONF += --disable-asm
......@@ -276,15 +282,16 @@ FFMPEGCONF += \
--enable-encoder=hevc_videotoolbox \
--target-os=darwin \
--enable-cross-compile \
--arch=$(ARCH) \
--enable-pic
endif
ifndef HAVE_IOS
ifndef HAVE_ANDROID
ifdef HAVE_CROSS_COMPILE
FFMPEGCONF += --cross-prefix=$(HOST)-
endif
endif
endif
# x86 stuff
ifeq ($(ARCH),i386)
......
......@@ -5,6 +5,8 @@ LIBARCHIVE_URL := https://github.com/libarchive/libarchive/releases/download/v$(
PKGS += libarchive
ifeq ($(call need_pkg,"libarchive >= 3.4.0"),)
PKGS_FOUND += libarchive
else
DEPS_libarchive += nettle
endif
LIBARCHIVE_CMAKECONF := \
......
......@@ -121,11 +121,6 @@ STRIP := $(CROSS_COMPILE)strip
endif
endif
ifdef HAVE_ANDROID
CC := $(CROSS_COMPILE)clang
CXX := $(CROSS_COMPILE)clang++
endif
ifdef HAVE_MACOSX
MIN_OSX_VERSION=10.11
CC=xcrun cc
......
From 649b319cfa3fc9bb4b9a93264cff70c187336093 Mon Sep 17 00:00:00 2001
From: philippegorley <gorley.philippe@gmail.com>
Date: Fri, 28 Jul 2017 09:45:23 -0400
Subject: [PATCH] use internal log2f
---
configure | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index ec9389d..02b05c7 100755
--- a/configure
+++ b/configure
@@ -1033,9 +1033,9 @@ if [ "$thread" = "posix" ]; then
fi
[ "$thread" != "no" ] && define HAVE_THREAD
-if cc_check "math.h" "-Werror" "return log2f(2);" ; then
- define HAVE_LOG2F
-fi
+#if cc_check "math.h" "-Werror" "return log2f(2);" ; then
+ define HAVE_LOG2F 0
+#fi
if [ "$SYS" != "WINDOWS" ] && cpp_check "sys/mman.h unistd.h" "" "defined(MAP_PRIVATE)"; then
define HAVE_MMAP
--
2.7.4
# x264
ifndef HAVE_IOS
X264_HASH := 8c2974255b01728d4eda2434cc1997c4a3ca5eff
X264_HASH := db0d417728460c647ed4a847222a535b00d3dbcb
else
X264_HASH := fa3cac516cb71b8ece09cedbfd0ce631ca8a2a4c
endif
......@@ -26,10 +26,12 @@ else
X264CONF += --enable-win32thread
endif
ifndef HAVE_IOS
ifndef HAVE_ANDROID
ifdef HAVE_CROSS_COMPILE
X264CONF += --cross-prefix="$(CROSS_COMPILE)"
endif
endif
endif
# android x86_64 has reloc errors related to assembly optimizations
ifdef HAVE_ANDROID
......@@ -51,19 +53,15 @@ x264: x264-$(X264_HASH).tar.xz .sum-x264
(cd $@-$(X264_HASH) && tar x $(if ${BATCH_MODE},,-v) --strip-components=1 -f ../$<)
ifdef HAVE_IOS
$(APPLY) $(SRC)/x264/remove-align.patch
endif
ifdef HAVE_ANDROID
ifeq ($(ARCH),arm)
$(APPLY) $(SRC)/x264/0001-use-internal-log2f.patch
endif
ifeq ($(ARCH),i386)
$(APPLY) $(SRC)/x264/0001-use-internal-log2f.patch
endif
endif
$(UPDATE_AUTOCONFIG)
$(MOVE)
.x264: x264
ifdef HAVE_ANDROID
cd $< && $(HOSTVARS) AS="$(CC)" ./configure $(X264CONF)
else
cd $< && $(HOSTVARS) ./configure $(X264CONF)
endif
cd $< && $(MAKE) install
touch $@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment