Skip to content
Snippets Groups Projects
Commit ded1cb56 authored by Vittorio Giovara's avatar Vittorio Giovara Committed by Tristan Matthews
Browse files

contrib: add vpx rules and patches

Dependency required by libav.

Based on VideoLan code by Rémi Denis-Courmont et al.
Refs: #46617

Change-Id: I7d29d51feeff97349fdbe341cbba07f068e79521
parent 04b0a2c6
No related branches found
No related tags found
No related merge requests found
af26766a3336155c5bc7b8cce7c23228de054287b990f9cacdc35273384a7af4999c01bb623d12143f40107036308a8b3207081efe67936748503c30c985fd6b libvpx-v1.3.0.tar.bz2
libvpx's configure script hard-codes the SDK location of previous Xcode release in the /Developer folder. However, starting with Xcode 4.3, the SDKs moved to /Applications/Xcode.app/blabla
VLC's contrib system is clever enough to detect this, but libvpx fails miserably. However, they are providing a work-around for iOS and Android, which is expanded by this patch.
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,11 @@
if [ -d "/Developer/SDKs/MacOSX10.7.sdk" ]; then
osx_sdk_dir="/Developer/SDKs/MacOSX10.7.sdk"
fi
+ if [ -d "${sdk_path}" ]; then
+ case "${sdk_path}" in
+ darwin*) osx_sdk_dir=${sdk_path} ;;
+ esac
+ fi
case ${toolchain} in
*-darwin8-*)
--- libvpx-v1.0.0/build/make/configure.sh.orig 2012-01-29 04:59:36.976441000 -0500
+++ libvpx-v1.0.0/build/make/configure.sh 2012-01-29 04:59:46.684441001 -0500
@@ -680,7 +680,6 @@
case ${tgt_cc} in
gcc)
- CROSS=${CROSS:-arm-none-linux-gnueabi-}
link_with_cc=gcc
setup_gnu_toolchain
arch_int=${tgt_isa##armv}
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
# libvpx
VPX_VERSION := v1.3.0
VPX_URL := http://webm.googlecode.com/files/libvpx-$(VPX_VERSION).tar.bz2
$(TARBALLS)/libvpx-$(VPX_VERSION).tar.bz2:
$(call download,$(VPX_URL))
.sum-vpx: libvpx-$(VPX_VERSION).tar.bz2
vpx: 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)
DEPS_vpx =
ifdef HAVE_CROSS_COMPILE
VPX_CROSS := $(HOST)-
else
VPX_CROSS :=
endif
ifeq ($(ARCH),arm)
VPX_ARCH := armv7
else ifeq ($(ARCH),i386)
VPX_ARCH := x86
else ifeq ($(ARCH),mips)
VPX_ARCH := mips32
else ifeq ($(ARCH),ppc)
VPX_ARCH := ppc32
else ifeq ($(ARCH),ppc64)
VPX_ARCH := ppc64
else ifeq ($(ARCH),sparc)
VPX_ARCH := sparc
else ifeq ($(ARCH),x86_64)
VPX_ARCH := x86_64
endif
ifdef HAVE_ANDROID
VPX_OS := android
else ifdef HAVE_LINUX
VPX_OS := linux
else ifdef HAVE_DARWIN_OS
ifeq ($(ARCH),arm)
VPX_OS := darwin
else
ifeq ($(OSX_VERSION),10.5)
VPX_OS := darwin9
else
VPX_OS := darwin10
endif
endif
else ifdef HAVE_SOLARIS
VPX_OS := solaris
else ifdef HAVE_WIN64 # must be before WIN32
VPX_OS := win64
else ifdef HAVE_WIN32
VPX_OS := win32
else ifdef HAVE_BSD
VPX_OS := linux
endif
VPX_TARGET := generic-gnu
ifdef VPX_ARCH
ifdef VPX_OS
VPX_TARGET := $(VPX_ARCH)-$(VPX_OS)-gcc
endif
endif
VPX_CONF := \
--enable-runtime-cpu-detect \
--disable-install-bins \
--disable-install-docs \
--disable-examples \
--disable-unit-tests \
--disable-vp8-decoder \
--disable-vp9-decoder
ifndef HAVE_WIN32
VPX_CONF += --enable-pic
endif
ifdef HAVE_MACOSX
VPX_CONF += --sdk-path=$(MACOSX_SDK)
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: vpx
cd $< && CROSS=$(VPX_CROSS) ./configure --target=$(VPX_TARGET) \
$(VPX_CONF) --prefix=$(PREFIX)
cd $< && $(MAKE)
cd $< && ../../../contrib/src/pkg-static.sh vpx.pc
cd $< && $(MAKE) install
touch $@
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment