diff --git a/contrib/src/vpx/SHA512SUMS b/contrib/src/vpx/SHA512SUMS new file mode 100644 index 0000000000000000000000000000000000000000..84d2a309bc7e16480d70fd8f5fb50350b3550019 --- /dev/null +++ b/contrib/src/vpx/SHA512SUMS @@ -0,0 +1 @@ +af26766a3336155c5bc7b8cce7c23228de054287b990f9cacdc35273384a7af4999c01bb623d12143f40107036308a8b3207081efe67936748503c30c985fd6b libvpx-v1.3.0.tar.bz2 diff --git a/contrib/src/vpx/libvpx-mac.patch b/contrib/src/vpx/libvpx-mac.patch new file mode 100644 index 0000000000000000000000000000000000000000..ebb868ade3efe9b652fbe51d1d70051edfe56bbe --- /dev/null +++ b/contrib/src/vpx/libvpx-mac.patch @@ -0,0 +1,18 @@ +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-*) diff --git a/contrib/src/vpx/libvpx-no-cross.patch b/contrib/src/vpx/libvpx-no-cross.patch new file mode 100644 index 0000000000000000000000000000000000000000..e261dc7773b882e7d2e9797607e0d941713667e3 --- /dev/null +++ b/contrib/src/vpx/libvpx-no-cross.patch @@ -0,0 +1,10 @@ +--- 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} diff --git a/contrib/src/vpx/libvpx-sysroot.patch b/contrib/src/vpx/libvpx-sysroot.patch new file mode 100644 index 0000000000000000000000000000000000000000..9b843389d511cc887671467f5ce33233e9271737 --- /dev/null +++ b/contrib/src/vpx/libvpx-sysroot.patch @@ -0,0 +1,31 @@ +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 + diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak new file mode 100644 index 0000000000000000000000000000000000000000..a419cbd6a85ee4bcbb14e6dbc6083893fe827034 --- /dev/null +++ b/contrib/src/vpx/rules.mak @@ -0,0 +1,104 @@ +# 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 $@