[vlc-commits] contrib: vpx: fix android build

Thomas Guillem git at videolan.org
Fri May 20 13:34:12 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri May 20 11:58:48 2016 +0200| [e9f7b720c7f139eb16dd12dc81c2e8d37baec1a7] | committer: Thomas Guillem

contrib: vpx: fix android build

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e9f7b720c7f139eb16dd12dc81c2e8d37baec1a7
---

 contrib/src/vpx/libvpx-android.patch |   34 ++++++++++++++++++++++++++++++++++
 contrib/src/vpx/rules.mak            |    7 +++++--
 2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/contrib/src/vpx/libvpx-android.patch b/contrib/src/vpx/libvpx-android.patch
new file mode 100644
index 0000000..ed2a8ad
--- /dev/null
+++ b/contrib/src/vpx/libvpx-android.patch
@@ -0,0 +1,34 @@
+We don't use Android.mk to build libvpx. Then we have to force the build of
+cpu-features.c. Additionally, we don't need to link with pthread.
+
+--- libvpx/libs.mk.orig	2016-05-20 12:24:16.635969371 +0200
++++ libvpx/libs.mk	2016-05-20 12:25:01.275249347 +0200
+@@ -300,7 +300,7 @@
+ 	$(qexec)echo 'Conflicts:' >> $@
+ 	$(qexec)echo 'Libs: -L$${libdir} -lvpx -lm' >> $@
+ ifeq ($(HAVE_PTHREAD_H),yes)
+-	$(qexec)echo 'Libs.private: -lm -lpthread' >> $@
++	$(qexec)echo 'Libs.private: -lm' >> $@
+ else
+ 	$(qexec)echo 'Libs.private: -lm' >> $@
+ endif
+--- libvpx/vpx_ports/vpx_ports.mk.orig	2016-05-20 12:35:19.293271792 +0200
++++ libvpx/vpx_ports/vpx_ports.mk	2016-05-20 12:35:06.857472718 +0200
+@@ -21,4 +21,5 @@
+ endif
+ 
+ PORTS_SRCS-$(ARCH_ARM) += arm_cpudetect.c
++PORTS_SRCS-$(ARCH_ARM) += cpu-features.c
+ PORTS_SRCS-$(ARCH_ARM) += arm.h
+--- libvpx/build/make/configure.sh.orig	2016-05-20 12:48:54.468179035 +0200
++++ libvpx/build/make/configure.sh	2016-05-20 12:49:30.379601840 +0200
+@@ -907,7 +907,8 @@
+             soft_enable runtime_cpu_detect
+           fi
+           if enabled runtime_cpu_detect; then
+-            add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
++            cp "${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c" vpx_ports
++            add_cflags "-I${ANDROID_NDK}/sources/android/cpufeatures"
+           fi
+           ;;
+ 
diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak
index 986f681..adb550e 100644
--- a/contrib/src/vpx/rules.mak
+++ b/contrib/src/vpx/rules.mak
@@ -15,6 +15,9 @@ libvpx: libvpx-$(VPX_VERSION).tar.bz2 .sum-vpx
 	$(APPLY) $(SRC)/vpx/libvpx-mac.patch
 	$(APPLY) $(SRC)/vpx/libvpx-ios.patch
 	$(APPLY) $(SRC)/vpx/libvpx-arm.patch
+ifdef HAVE_ANDROID
+	$(APPLY) $(SRC)/vpx/libvpx-android.patch
+endif
 	$(MOVE)
 
 DEPS_vpx =
@@ -108,8 +111,8 @@ ifdef HAVE_ANDROID
 # vpx configure.sh overrides our sysroot and it looks for it itself, and
 # uses that path to look for the compiler (which we already know)
 VPX_CONF += --sdk-path=$(shell dirname $(shell which $(HOST)-gcc))
-# needed for cpu-features.h
-VPX_CONF += --extra-cflags="-I $(ANDROID_NDK)/sources/cpufeatures/"
+# put sysroot
+VPX_CONF += --libc=$(ANDROID_NDK)/platforms/$(ANDROID_API)/arch-$(PLATFORM_SHORT_ARCH)
 endif
 
 ifndef WITH_OPTIMIZATION



More information about the vlc-commits mailing list