From 253a9891a26cb05ffb3303f1e93e0cccf6b281a83cd632b8e9eb23a06b0abb37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Sat, 15 Oct 2011 02:50:16 +0000 Subject: [PATCH] Accepting request 87914 from home:joeyli:branches:multimedia:libs support build libvpx on armv7hl architecture OBS-URL: https://build.opensuse.org/request/show/87914 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/libvpx?expand=0&rev=32 --- libvpx-configure-add-armv7-tgt-isa.patch | 29 ++++++++++++++++++++++++ libvpx.changes | 9 ++++++++ libvpx.spec | 14 ++++++++++-- 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 libvpx-configure-add-armv7-tgt-isa.patch diff --git a/libvpx-configure-add-armv7-tgt-isa.patch b/libvpx-configure-add-armv7-tgt-isa.patch new file mode 100644 index 0000000..4dd8695 --- /dev/null +++ b/libvpx-configure-add-armv7-tgt-isa.patch @@ -0,0 +1,29 @@ +Index: libvpx-v0.9.7-p1/build/make/configure.sh +=================================================================== +--- libvpx-v0.9.7-p1.orig/build/make/configure.sh ++++ libvpx-v0.9.7-p1/build/make/configure.sh +@@ -656,6 +656,8 @@ process_common_toolchain() { + CROSS=${CROSS:-arm-iwmmxt-linux-gnueabi-} + elif enabled symbian; then + CROSS=${CROSS:-arm-none-symbianelf-} ++ elif [[ "$(uname -m)" == $tgt_isa* ]]; then ++ CROSS=${CROSS:-} + else + CROSS=${CROSS:-arm-none-linux-gnueabi-} + fi +@@ -670,8 +672,13 @@ process_common_toolchain() { + check_add_asflags -mcpu=${tgt_isa} + elif 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 ++ if [[ "$(uname -m)" == $tgt_isa* ]]; then ++ check_add_cflags -mfpu=neon ++ check_add_asflags -mfpu=neon ++ else ++ 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 ++ fi + else + check_add_cflags -march=${tgt_isa} + check_add_asflags -march=${tgt_isa} diff --git a/libvpx.changes b/libvpx.changes index b52a952..4cc3d8d 100644 --- a/libvpx.changes +++ b/libvpx.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sat Oct 15 01:47:32 UTC 2011 - jlee@suse.com + +- support build libvpx on armv7hl architecture + * add libvpx-configure-add-armv7-tgt-isa.patch + * add armv7-linux-gcc target and enable runtime cpu detect when + configure. It both support ARMv7 cpu with or without NEON. + e.g. NVIDIA Tegra 2 + ------------------------------------------------------------------- Wed Aug 24 10:11:27 UTC 2011 - adrian@suse.de diff --git a/libvpx.spec b/libvpx.spec index eee133c..21cc62a 100644 --- a/libvpx.spec +++ b/libvpx.spec @@ -28,6 +28,7 @@ Group: Productivity/Multimedia/Other Source0: http://webm.googlecode.com/files/%{name}-v%{version}%{patchlevel}.tar.bz2 # PATCH-FIX-UPSTREAM libvpx-define-config_pic.patch dimstar@opensuse.org -- For older compilers, CONFIG_PIC need to be defined. Patch0: libvpx-define-config_pic.patch +Patch1: libvpx-configure-add-armv7-tgt-isa.patch BuildRequires: yasm BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -56,7 +57,6 @@ The WebM file structure is based on the Matroska container. %package -n %{name}0 - License: BSD3c Summary: VP8 codec library Group: System/Libraries @@ -88,17 +88,27 @@ The WebM file structure is based on the Matroska container. %prep %setup -q -n %name-v%version%patchlevel %patch0 -p1 +%patch1 -p1 %build cd build export CFLAGS="%{optflags}" # It is only an emulation of autotools configure; the macro does not work + +# libvpx default enable NEON support on ARMv7, unfortunately some ARMv7 +# CPU doesn't have NEON, e.g. NVIDIA Tegra 2. +# So, we still set -mfpu=neon when build libvpx rpm, but also enable +# runtime-cpu-detect for runtime detect NEON. ../configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --enable-debug \ --enable-shared \ - --enable-pic +%ifarch armv7hl + --target=armv7-linux-gcc \ + --enable-runtime-cpu-detect \ +%endif + --enable-pic make %{?_smp_mflags} %install