[vlc-devel] [PATCH 2/2] contrib: libvpx: fix for NDK21

Thomas Guillem thomas at gllm.fr
Wed Jan 22 15:42:23 CET 2020


cf. # comment.

This gcc test is only needed during the NDK 18 -> 21 transtion.
---
 contrib/src/vpx/rules.mak | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak
index 23841bb28cf..e0cdd7bf4be 100644
--- a/contrib/src/vpx/rules.mak
+++ b/contrib/src/vpx/rules.mak
@@ -155,8 +155,18 @@ ifndef WITH_OPTIMIZATION
 VPX_CONF += --enable-debug --disable-optimizations
 endif
 
+ifdef HAVE_ANDROID
+# Starting NDK19, standalone toolchains are deprecated and gcc is not shipped.
+# The presence of gcc can be used to detect if we are using an old standalone
+# toolchain. Unfortunately, libvpx buildsystem only work with standalone
+# toolchains, therefore pass the HOSTVARS directly to bypass any detection.
+ifneq ($(shell $(VPX_CROSS)gcc -v >/dev/null 2>&1 || echo FAIL),)
+VPX_HOSTVARS = $(HOSTVARS)
+endif
+endif
+
 .vpx: libvpx
-	cd $< && LDFLAGS="$(VPX_LDFLAGS)" CROSS=$(VPX_CROSS) ./configure --target=$(VPX_TARGET) \
+	cd $< && LDFLAGS="$(VPX_LDFLAGS)" CROSS=$(VPX_CROSS) $(VPX_HOSTVARS) ./configure --target=$(VPX_TARGET) \
 		$(VPX_CONF) --prefix=$(PREFIX)
 	cd $< && $(MAKE)
 	$(call pkg_static,"vpx.pc")
-- 
2.20.1



More information about the vlc-devel mailing list