Commit 2209e091 authored by Vittorio Giovara's avatar Vittorio Giovara Committed by Jean-Baptiste Kempf

contrib: libvpx: allow compiling on android

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 58c5bed5
......@@ -4,12 +4,14 @@ VLC's contrib system is clever enough to detect this, but libvpx fails miserably
diff -ru libvpx/build/make/configure.sh libvpx/build/make/configure.sh
--- libvpx/build/make/configure.sh 2012-06-08 10:26:47.000000000 +0200
+++ libvpx-fixed/build/make/configure.sh 2012-06-08 10:26:07.000000000 +0200
@@ -628,6 +628,9 @@
@@ -628,6 +628,11 @@
if [ -d "/Developer/SDKs/MacOSX10.7.sdk" ]; then
osx_sdk_dir="/Developer/SDKs/MacOSX10.7.sdk"
fi
+ if [ -d "${sdk_path}" ]; then
+ osx_sdk_dir=${sdk_path}
+ case "${sdk_path}" in
+ darwin*) osx_sdk_dir=${sdk_path} ;;
+ esac
+ fi
case ${toolchain} in
......
Our contrib system already passes the correct sysroot to the compiler, so there
is no need to set an alternate libc path. If that path is empty the script will
try to look for it in some fashion, but since the SDKROOT may be in a
non standard location the look up may fail.
This patch avoids that case and relies on the user configuration for the
correct sysroot.
See also https://code.google.com/p/webm/issues/detail?id=809
diff --git a/build/make/configure.sh b/build/make/configure.sh
index d4124c7..c420d25 100755
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -939,8 +939,11 @@ EOF
awk '{ print $1 }' | tail -1`
fi
- add_cflags "--sysroot=${alt_libc}"
- add_ldflags "--sysroot=${alt_libc}"
+ # this may happen if toolchain binaries are outside the ndk dir
+ if [ "${alt_libc}" ]; then
+ add_cflags "--sysroot=${alt_libc}"
+ add_ldflags "--sysroot=${alt_libc}"
+ fi
# linker flag that routes around a CPU bug in some
# Cortex-A8 implementations (NDK Dev Guide)
--
1.8.3.2
......@@ -10,6 +10,7 @@ $(TARBALLS)/libvpx-$(VPX_VERSION).tar.bz2:
libvpx: libvpx-$(VPX_VERSION).tar.bz2 .sum-vpx
$(UNPACK)
$(APPLY) $(SRC)/vpx/libvpx-sysroot.patch
$(APPLY) $(SRC)/vpx/libvpx-no-cross.patch
$(APPLY) $(SRC)/vpx/libvpx-mac.patch
$(MOVE)
......@@ -38,7 +39,9 @@ else ifeq ($(ARCH),x86_64)
VPX_ARCH := x86_64
endif
ifdef HAVE_LINUX
ifdef HAVE_ANDROID
VPX_OS := android
else ifdef HAVE_LINUX
VPX_OS := linux
else ifdef HAVE_DARWIN_OS
ifeq ($(ARCH),arm)
......@@ -83,6 +86,13 @@ endif
ifdef HAVE_IOS
VPX_CONF += --sdk-path=$(SDKROOT)
endif
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/"
endif
.vpx: libvpx
cd $< && CROSS=$(VPX_CROSS) ./configure --target=$(VPX_TARGET) \
......
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