@@ -0,0 +1,23 @@
+Index: libvpx-1.0.0/build/make/configure.sh
+===================================================================
+--- libvpx-1.0.0.orig/build/make/configure.sh 2012-02-20 15:33:19.699399094 +0200
++++ libvpx-1.0.0/build/make/configure.sh 2012-02-20 16:46:12.863199409 +0200
+@@ -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}
+@@ -689,8 +688,8 @@
+ tune_cflags="-mtune="
+ if enabled armv7
+ then
+- check_add_cflags -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp #-ftree-vectorize
+- check_add_asflags -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp #-march=armv7-a
++ check_add_cflags -march=armv7-a -mcpu=cortex-a8 -mfpu=neon #-ftree-vectorize
++ check_add_asflags -mcpu=cortex-a8 -mfpu=neon #-march=armv7-a
+ else
+ check_add_cflags -march=${tgt_isa}
+ check_add_asflags -march=${tgt_isa}
@@ -1 +1,2 @@
01_enable-shared.patch
+fix-armhf-link.patch
@@ -2,7 +2,9 @@
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
configure_flags += \
--prefix=/usr \
@@ -11,23 +13,41 @@
--disable-install-bins \
--disable-install-srcs
-# TODO: Special cases for ARM?
-ifeq ($(DEB_BUILD_ARCH), amd64)
+ifeq ($(DEB_HOST_ARCH_CPU),arm)
+configure_flags_neon := $(configure_flags) --target=armv7-linux-gcc
+BUILD_NEON=Yes
+endif
+
+ifeq ($(DEB_HOST_ARCH), armel)
+ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
+configure_flags += --target=armv6-linux-gcc --enable-small
+else
+configure_flags += --target=generic-gnu
+endif
+else
+ifeq ($(DEB_HOST_ARCH), armhf)
+# now armhf is ARMv7, but ARMv7 in vpx means NEON, which is not mandatory on armhf
+# thus we use ARMv6 and -marm (since no thumb2 on ARMv6) to ensure compatability
+# with all ARMv7 cores we support.
+CFLAGS += -marm
+configure_flags += --target=armv6-linux-gcc --enable-small
+else
+ifeq ($(DEB_HOST_ARCH), amd64)
configure_flags += --target=x86_64-linux-gcc
else
-ifeq ($(DEB_BUILD_ARCH), kfreebsd-amd64)
+ifeq ($(DEB_HOST_ARCH), kfreebsd-amd64)
configure_flags += --target=x86_64-linux-gcc
else
-ifeq ($(DEB_BUILD_ARCH), i386)
+ifeq ($(DEB_HOST_ARCH), i386)
configure_flags += --target=x86-linux-gcc
else
-ifeq ($(DEB_BUILD_ARCH), kfreebsd-i386)
+ifeq ($(DEB_HOST_ARCH), kfreebsd-i386)
configure_flags += --target=x86-linux-gcc
else
-ifeq ($(DEB_BUILD_ARCH), hurd-i386)
+ifeq ($(DEB_HOST_ARCH), hurd-i386)
configure_flags += --target=x86-linux-gcc
else
-ifeq ($(DEB_BUILD_ARCH), powerpc)
+ifeq ($(DEB_HOST_ARCH), powerpc)
configure_flags += --target=ppc32-linux-gcc
else
configure_flags += --target=generic-gnu
@@ -37,9 +57,12 @@
endif
endif
endif
+endif
+endif
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
-configure_flags += --host=$(DEB_HOST_GNU_TYPE)
+CROSS=$(DEB_HOST_GNU_TYPE)-
+export CROSS
endif
CFLAGS += -Wall -g
@@ -60,12 +83,22 @@
CFLAGS="$(CFLAGS)" $(CURDIR)/configure \
$(configure_flags)
touch $@
+ifeq ($(BUILD_NEON), Yes)
+ mkdir -p $(builddir)-neon; \
+ cd $(builddir)-neon; \
+ CFLAGS="$(CFLAGS)" $(CURDIR)/configure \
+ $(configure_flags_neon)
+ touch $@
+endif
build: build-stamp
build-stamp: configure-stamp
dh_testdir
$(MAKE) -C $(builddir) verbose=yes
+ifeq ($(BUILD_NEON), Yes)
+ $(MAKE) -C $(builddir)-neon verbose=yes
+endif
touch $@
clean:
@@ -73,6 +106,7 @@
dh_testroot
rm -f *-stamp
rm -rf $(builddir)
+ rm -rf $(builddir)-neon
dh_clean
install: build-stamp
@@ -81,6 +115,9 @@
dh_prep
dh_installdirs
$(MAKE) -C $(builddir) verbose=yes dist
+ifeq ($(BUILD_NEON), Yes)
+ $(MAKE) -C $(builddir)-neon verbose=yes dist
+endif
# don't use stripped library...
cp -v $(builddir)/libvpx_g.a \
$(builddir)/vpx-vp8-*/lib/libvpx.a
@@ -105,6 +142,10 @@
dh_install -s
mkdir -p debian/libvpx1/usr/lib/$(DEB_HOST_MULTIARCH)
cp -a builddir/vpx-vp8-*/lib/libvpx.so.* debian/libvpx1/usr/lib/$(DEB_HOST_MULTIARCH)
+ifeq ($(BUILD_NEON), Yes)
+ mkdir -p debian/libvpx1/usr/lib/$(DEB_HOST_MULTIARCH)/vfp/neon
+ cp -a builddir-neon/vpx-vp8-*/lib/libvpx.so.* debian/libvpx1/usr/lib/$(DEB_HOST_MULTIARCH)/vfp/neon
+endif
mkdir -p debian/libvpx-dev/usr/lib/$(DEB_HOST_MULTIARCH)
cp -a builddir/vpx-vp8-*/lib/libvpx.so builddir/vpx-vp8-*/lib/libvpx.a debian/libvpx-dev/usr/lib/$(DEB_HOST_MULTIARCH)
dh_installdocs -s -A README AUTHORS