mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [RFC] Improve speex's buildsystem
@ 2012-04-06 11:08 Juergen Beisert
  2012-04-08  7:42 ` Michael Olbrich
  0 siblings, 1 reply; 5+ messages in thread
From: Juergen Beisert @ 2012-04-06 11:08 UTC (permalink / raw)
  To: ptxdist

Please find below a patch to improve 'speex' buildsystem in various ways.
'speex' comes with many hardware related switches. And as it is a user-land
component, sharing the settings in a PTXdist project based on more than one
platform with different architectures is (currently) impossible.

Also the current rule file is broken, as it depends on a few platform settings
which are no longer available since ages.

This patch adds some auto-scripts (thanks to Uwe) that are able to read back
the important settings from the toolchain. And the result will configure
'speex' automagically in accordance to the architecture's features.

These auto-scripts could also be used in other packages, that need
architecture specific configuration. And since the use of these auto-scripts
depends on an autogen step, PTXdist could provide these auto-scripts as a
generic part, instead of patching them into each package (like it is done in
this example).

Comments are welcome.

commit 5de468977ac9df84e5a24120494e96668626ca58
Author: Juergen Beisert <jbe@pengutronix.de>
Date:   Tue Dec 27 20:00:30 2011 +0100

    SPEEX: improve its buildsystem
    
    This patch adds a series of patches to the speex package to
    - fix its buildsystem
    - add libogg dependency on demand only
    - add autodetection of the architecture and possible optimzations
    
    Signed-off-by: Juergen Beisert <jbe@pengutronix.de>

diff --git a/patches/speex-1.2rc1/add_more_autodetection.diff b/patches/speex-1.2rc1/add_more_autodetection.diff
new file mode 100644
index 0000000..2907379
--- /dev/null
+++ b/patches/speex-1.2rc1/add_more_autodetection.diff
@@ -0,0 +1,168 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Subject: [PATCH] SPEEX: lets configure detect more arch settings from the compiler
+
+The preprocessor defines various symbols on its default settings and also on
+given parameters. Use these symbols to detect optimization possibilities.
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ configure.ac |  127 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 108 insertions(+), 19 deletions(-)
+
+Index: speex-1.2rc1/configure.ac
+===================================================================
+--- speex-1.2rc1.orig/configure.ac
++++ speex-1.2rc1/configure.ac
+@@ -36,7 +36,7 @@ AC_CANONICAL_HOST
+ LT_INIT
+ 
+ # default is more output while building the package
+-AM_SILENT_RULES()
++AM_SILENT_RULES([${enable_silent_rules}])
+ 
+ AC_C_BIGENDIAN
+ AC_C_CONST
+@@ -64,22 +64,98 @@ AC_TYPE_INT16_T
+ AC_TYPE_INT32_T
+ AC_TYPE_SIZE_T
+ 
+-AC_MSG_CHECKING(for SSE in current arch/CFLAGS)
+-AC_LINK_IFELSE([
+-AC_LANG_PROGRAM([[
+-#include <xmmintrin.h>
+-__m128 testfunc(float *a, float *b) {
+-  return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b));
+-}
+-]])],
+-[
+-has_sse=yes
+-],
+-[
+-has_sse=no
+-]
+-)
+-AC_MSG_RESULT($has_sse)  
++target_arch_detected=guessed
++
++# ---------------------------------------------------------------------------
++
++case $host_cpu in
++	i?86)
++		base_arch=x86
++		;;
++	arm)
++		base_arch=arm;
++		;;
++	*)
++		base_arch=unknown;
++		;;
++esac
++
++# ---------------------------------------------------------------------------
++
++# Checking if this CPU has a hardware floating point unit
++
++AX_HARDWARE_FP([target_hardware_fp=yes], [target_hardware_fp=no])
++
++# When a hardware floating point unit seems available, then use it.
++# This will end in bad code on badly configured compilers which generates
++# floating point instructions even if the CPU has not hardware FP unit
++#
++if test x${target_hardware_fp} = xyes; then
++	enable_fixed_point=no
++	enable_float_api=yes
++	enable_vbr=yes
++	with_fft=smallft
++	math_type="floating"
++else
++	enable_fixed_point=yes
++	enable_float_api=no
++	enable_vbr=no
++	with_fft=kiss
++	math_type="fixed"
++fi
++
++# ---------------------------------------------------------------------------
++
++if test x${base_arch} = xarm; then
++# discover the architecture this compiler builds code for
++
++enable_arm4_asm=no;
++enable_arm5e_asm=no;
++
++# check here for symbols the preprocessor automatically defines.
++# To find the correct symbol to test for just run "cpp -dM" and press CTRL-D.
++
++AX_DETECT_ARMV4([enable_arm4_asm=yes; optimized_for="ARMv4"; target_arch_detected=yes], [])
++AX_DETECT_ARMV5([enable_arm5e_asm=yes; optimized_for="ARMv5"; target_arch_detected=yes], [])
++#currently not used in this package
++# AX_DETECT_ARMV6([enable_arm6_asm=yes; optimized_for="ARMv6"; target_arch_detected=yes], [])
++# AX_DETECT_ARMV7([enable_arm7_asm=yes; optimized_for="ARMv7"; target_arch_detected=yes], [])
++
++if test x${target_arch_detected} = xguessed; then
++	optimized_for="ARM"
++fi
++
++fi
++
++# end of ARM
++# ---------------------------------------------------------------------------
++
++if test x${base_arch} = xx86; then
++
++# on x86 we assume a floating point unit
++	target_arch_detected=guessed
++	optimized_for="x86";
++
++AC_MSG_CHECKING(for SSE capability)
++AC_COMPILE_IFELSE(
++	[AC_LANG_PROGRAM([[]],
++	[[
++#undef SSE_IS_POSSIBLE
++#if defined(__SSE__) || defined(__SSE2__) || defined(__SSE2_MATH__)
++# define SSE_IS_POSSIBLE 1
++#endif
++int foo = SSE_IS_POSSIBLE;
++	]])],
++	[has_sse=yes],
++	[has_sse=no],
++	[Optimize for SSE])
++AC_MSG_RESULT(${has_sse})
++
++AX_EXT
++
++fi
++
++# ---------------------------------------------------------------------------
+ 
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+@@ -316,8 +392,6 @@ AC_CONFIG_FILES([Makefile libspeex/Makef
+ 	   ti/speex_C64_test/Makefile ])
+ AC_OUTPUT
+ 
+-echo "Type \"make; make install\" to compile and install Speex";
+-
+ echo "------------------------------------------------------"
+ echo "   Results:"
+ echo "------------------------------------------------------"
+@@ -330,3 +404,18 @@ echo "   CFLAGS:                $CFLAGS 
+ echo "   Additional libs:       $LIBS $OGG_LIBS"
+ echo "   Coder/Encoder tools:   $enable_coders"
+ echo "------------------------------------------------------"
++echo "   Architecture specific settings:"
++echo ""
++echo "   Arch discovered:       ${target_arch_detected}"
++echo "   Base architecture:     ${base_arch}"
++echo "   Optimized for:         ${optimized_for} with ${math_type} point"
++if test x${base_arch} = xx86; then
++echo "    enable SSE math:      ${has_sse}"
++fi
++if test x${base_arch} = xarm; then
++	echo "    ARMv4 enabled:        ${enable_arm4_asm}"
++	echo "    ARMv5 enabled:        ${enable_arm5e_asm}"
++fi
++echo "------------------------------------------------------"
++
++echo "Type \"make; make install\" to compile and install Speex";
diff --git a/patches/speex-1.2rc1/autogen.sh b/patches/speex-1.2rc1/autogen.sh
new file mode 120000
index 0000000..9f8a4cb
--- /dev/null
+++ b/patches/speex-1.2rc1/autogen.sh
@@ -0,0 +1 @@
+../autogen.sh
\ No newline at end of file
diff --git a/patches/speex-1.2rc1/ax_armv4_detection.diff b/patches/speex-1.2rc1/ax_armv4_detection.diff
new file mode 100644
index 0000000..32c6b40
--- /dev/null
+++ b/patches/speex-1.2rc1/ax_armv4_detection.diff
@@ -0,0 +1,117 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Subject: [PATCH] lets configure detect more arch settings from the compiler
+
+The preprocessor defines various symbols on its default settings and also on
+given parameters. Use these symbols to detect optimization possibilities.
+
+__ARM_ARCH_4__/__ARM_ARCH_4T__ are defined if the default architecture is ARMv4
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ m4/ax_armv4_detection.m4 |   98 +++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 98 insertions(+)
+
+Index: speex-1.2rc1/m4/ax_armv4_detection.m4
+===================================================================
+--- /dev/null
++++ speex-1.2rc1/m4/ax_armv4_detection.m4
+@@ -0,0 +1,98 @@
++#
++# SYNOPSIS
++#
++#   AX_DETECT_ARMV4([ACTION-IF-ARMv4],[ACTION-IF-NO-ARMv4])
++#
++# DESCRIPTION
++#
++#   AX_DETECT_ARMV4 detects from the compiler settings if the target is of
++#   type ARMv4. It is intended mostly for cross compiling to be able to collect
++#   more information about the target architecture and features. The user can
++#   overwrite the detection by using the option --enable-armv4core or
++#   --disable-armv4core.
++#   It works by detecting the compiler's macros __ARM_ARCH_4__ and
++#   __ARM_ARCH_4T__. These are set in gcc compilers when they are configured
++#   to create code for ARMv4 cores.
++#   This macro cannot detect the correct target's features if the compiler is
++#   not correctly configured to reflect the target's features.
++#
++# LICENSE
++#
++#   Copyright (c) 2012 Juergen Beisert <jbe@pengutronix.de>
++#
++#   This program is free software; you can redistribute it and/or modify it
++#   under the terms of the GNU General Public License as published by the
++#   Free Software Foundation; either version 2 of the License, or (at your
++#   option) any later version.
++#
++#   This program is distributed in the hope that it will be useful, but
++#   WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++#   Public License for more details.
++#
++#   You should have received a copy of the GNU General Public License along
++#   with this program. If not, see <http://www.gnu.org/licenses/>.
++#
++#   As a special exception, the respective Autoconf Macro's copyright owner
++#   gives unlimited permission to copy, distribute and modify the configure
++#   scripts that are the output of Autoconf when processing the Macro. You
++#   need not follow the terms of the GNU General Public License when using
++#   or distributing such scripts, even though portions of the text of the
++#   Macro appear in them. The GNU General Public License (GPL) does govern
++#   all other use of the material that constitutes the Autoconf Macro.
++#
++#   This special exception to the GPL applies to versions of the Autoconf
++#   Macro released by the Autoconf Archive. When you make and distribute a
++#   modified version of the Autoconf Macro, you may extend this special
++#   exception to the GPL to apply to your modified version as well.
++
++AC_DEFUN([AX_DETECT_ARMV4],
++	[AC_REQUIRE([AC_PROG_CC])
++dnl
++dnl Give the user the possibility to overwrite the auto detection
++dnl
++	AC_ARG_ENABLE([armv4core],
++		[AS_HELP_STRING([--enable-armv4core],
++			[Enable optimizations for ARMv4 cores @<:@default=auto@:>@])],
++		[ax_armv4core="${enableval}"],
++		[ax_armv4core=auto])
++
++	AC_CACHE_CHECK([for ARMv4 target core], [ax_cv_armv4core],
++		[ax_cv_armv4core=${ax_armv4core}])
++dnl	AC_MSG_RESULT([${ax_cv_armv4core}])
++
++	if test "x${ax_cv_armv4core}" = "xauto"; then
++		if test "x$GCC" != "xyes"; then
++dnl only for GCC we know it works in this way
++			AC_MSG_ERROR([Cannot autodetect the architecture for non GCC compilers])
++		else
++			AC_MSG_CHECKING(if target's core is of type ARMv4)
++			AC_COMPILE_IFELSE(
++				[AC_LANG_PROGRAM([[]],
++					[[
++#undef THIS_IS_V4
++#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
++# define THIS_IS_V4 1
++#endif
++int foo = THIS_IS_V4;
++					]]) dnl AC_LANG_PROGRAM
++				],
++				[ax_cv_armv4core=yes],
++				[ax_cv_armv4core=no],
++				[ARMv4 core]); dnl AC_COMPILE_IFELSE
++			AC_MSG_RESULT([${ax_cv_armv4core}]);
++		fi
++	fi
++
++	case "x${ax_cv_armv4core}" in
++	"xyes")
++		$1
++		;;
++	"xno")
++		$2
++		;;
++	*)
++		AC_MSG_ERROR([Unknown setting for ARMv4 architecture: '${ax_cv_armv4core}'.])
++		;;
++	esac
++]) dnl AC_DEFUN
diff --git a/patches/speex-1.2rc1/ax_armv5_detection.diff b/patches/speex-1.2rc1/ax_armv5_detection.diff
new file mode 100644
index 0000000..b8358ac
--- /dev/null
+++ b/patches/speex-1.2rc1/ax_armv5_detection.diff
@@ -0,0 +1,120 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Subject: [PATCH] lets configure detect more arch settings from the compiler
+
+The preprocessor defines various symbols on its default settings and also on
+given parameters. Use these symbols to detect optimization possibilities.
+
+__ARM_ARCH_5__/__ARM_ARCH_5E__/__ARM_ARCH_5T__/__ARM_ARCH_5TE__/__ARM_ARCH_5TEJ__
+are defined if the default architecture is ARMv5
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ m4/ax_armv5_detection.m4 |  100 +++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 100 insertions(+)
+
+Index: speex-1.2rc1/m4/ax_armv5_detection.m4
+===================================================================
+--- /dev/null
++++ speex-1.2rc1/m4/ax_armv5_detection.m4
+@@ -0,0 +1,100 @@
++#
++# SYNOPSIS
++#
++#   AX_DETECT_ARMV5([ACTION-IF-ARMv5],[ACTION-IF-NO-ARMv5])
++#
++# DESCRIPTION
++#
++#   AX_DETECT_ARMV5 detects from the compiler settings if the target is of
++#   type ARMv5. It is intended mostly for cross compiling to be able to collect
++#   more information about the target architecture and features. The user can
++#   overwrite the detection by using the option --enable-armv5core or
++#   --disable-armv5core.
++#   It works by detecting the compiler's macros __ARM_ARCH_5__, __ARM_ARCH_5E__,
++#   __ARM_ARCH_5T__, __ARM_ARCH_5TE__ and __ARM_ARCH_5TEJ__. These are set in
++#   gcc compilers when they are configured to create code for ARMv5 cores.
++#   This macro cannot detect the correct target's features if the compiler is
++#   not correctly configured to reflect the target's features.
++#
++# LICENSE
++#
++#   Copyright (c) 2012 Juergen Beisert <jbe@pengutronix.de>
++#
++#   This program is free software; you can redistribute it and/or modify it
++#   under the terms of the GNU General Public License as published by the
++#   Free Software Foundation; either version 2 of the License, or (at your
++#   option) any later version.
++#
++#   This program is distributed in the hope that it will be useful, but
++#   WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++#   Public License for more details.
++#
++#   You should have received a copy of the GNU General Public License along
++#   with this program. If not, see <http://www.gnu.org/licenses/>.
++#
++#   As a special exception, the respective Autoconf Macro's copyright owner
++#   gives unlimited permission to copy, distribute and modify the configure
++#   scripts that are the output of Autoconf when processing the Macro. You
++#   need not follow the terms of the GNU General Public License when using
++#   or distributing such scripts, even though portions of the text of the
++#   Macro appear in them. The GNU General Public License (GPL) does govern
++#   all other use of the material that constitutes the Autoconf Macro.
++#
++#   This special exception to the GPL applies to versions of the Autoconf
++#   Macro released by the Autoconf Archive. When you make and distribute a
++#   modified version of the Autoconf Macro, you may extend this special
++#   exception to the GPL to apply to your modified version as well.
++
++AC_DEFUN([AX_DETECT_ARMV5],
++	[AC_REQUIRE([AC_PROG_CC])
++dnl
++dnl Give the user the possibility to overwrite the auto detection
++dnl
++	AC_ARG_ENABLE([armv5core],
++		[AS_HELP_STRING([--enable-armv5core],
++			[Enable optimizations for ARMv5 cores @<:@default=auto@:>@])],
++		[ax_armv5core="${enableval}"],
++		[ax_armv5core=auto])
++
++	AC_CACHE_CHECK([for ARMv5 target core], [ax_cv_armv5core],
++		[ax_cv_armv5core=${ax_armv5core}])
++dnl	AC_MSG_RESULT([${ax_cv_armv5core}])
++
++	if test "x${ax_cv_armv5core}" = "xauto"; then
++		if test "x$GCC" != "xyes"; then
++dnl only for GCC we know it works in this way
++			AC_MSG_ERROR([Cannot autodetect the architecture for non GCC compilers])
++		else
++			AC_MSG_CHECKING(if target's core is of type ARMv5)
++			AC_COMPILE_IFELSE(
++				[AC_LANG_PROGRAM([[]],
++					[[
++#undef THIS_IS_V5
++#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5E__) || \
++defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__) || \
++defined(__ARM_ARCH_5TEJ__)
++# define THIS_IS_V5 1
++#endif
++int foo = THIS_IS_V5;
++					]]) dnl AC_LANG_PROGRAM
++				],
++				[ax_cv_armv5core=yes],
++				[ax_cv_armv5core=no],
++				[ARMv5 core]); dnl AC_COMPILE_IFELSE
++			AC_MSG_RESULT([${ax_cv_armv5core}]);
++		fi
++	fi
++
++	case "x${ax_cv_armv5core}" in
++	"xyes")
++		$1
++		;;
++	"xno")
++		$2
++		;;
++	*)
++		AC_MSG_ERROR([Unknown setting for ARMv5 architecture: '${ax_cv_armv5core}'.])
++		;;
++	esac
++]) dnl AC_DEFUN
diff --git a/patches/speex-1.2rc1/ax_armv6_detection.diff b/patches/speex-1.2rc1/ax_armv6_detection.diff
new file mode 100644
index 0000000..635e6a8
--- /dev/null
+++ b/patches/speex-1.2rc1/ax_armv6_detection.diff
@@ -0,0 +1,122 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Subject: [PATCH] lets configure detect more arch settings from the compiler
+
+The preprocessor defines various symbols on its default settings and also on
+given parameters. Use these symbols to detect optimization possibilities.
+
+__ARM_ARCH_6__, __ARM_ARCH_6J__, __ARM_ARCH_6K__, __ARM_ARCH_6Z__,
+__ARM_ARCH_6ZK__ and __ARM_ARCH_6T2__ are defined if the default
+architecture is ARMv6
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ m4/ax_armv6_detection.m4 |  101 +++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 101 insertions(+)
+
+Index: speex-1.2rc1/m4/ax_armv6_detection.m4
+===================================================================
+--- /dev/null
++++ speex-1.2rc1/m4/ax_armv6_detection.m4
+@@ -0,0 +1,101 @@
++#
++# SYNOPSIS
++#
++#   AX_DETECT_ARMV6([ACTION-IF-ARMv6],[ACTION-IF-NO-ARMv6])
++#
++# DESCRIPTION
++#
++#   AX_DETECT_ARMV6 detects from the compiler settings if the target is of
++#   type ARMv6. It is intended mostly for cross compiling to be able to collect
++#   more information about the target architecture and features. The user can
++#   overwrite the detection by using the option --enable-armv6core or
++#   --disable-armv6core.
++#   It works by detecting the compiler's macros __ARM_ARCH_6__, __ARM_ARCH_6J__,
++#   __ARM_ARCH_6K__, __ARM_ARCH_6Z__, __ARM_ARCH_6ZK__ and __ARM_ARCH_6T2__.
++#   These are set in  gcc compilers when they are configured to create code for
++#   ARMv6 cores.
++#   This macro cannot detect the correct target's features if the compiler is
++#   not correctly configured to reflect the target's features.
++#
++# LICENSE
++#
++#   Copyright (c) 2012 Juergen Beisert <jbe@pengutronix.de>
++#
++#   This program is free software; you can redistribute it and/or modify it
++#   under the terms of the GNU General Public License as published by the
++#   Free Software Foundation; either version 2 of the License, or (at your
++#   option) any later version.
++#
++#   This program is distributed in the hope that it will be useful, but
++#   WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++#   Public License for more details.
++#
++#   You should have received a copy of the GNU General Public License along
++#   with this program. If not, see <http://www.gnu.org/licenses/>.
++#
++#   As a special exception, the respective Autoconf Macro's copyright owner
++#   gives unlimited permission to copy, distribute and modify the configure
++#   scripts that are the output of Autoconf when processing the Macro. You
++#   need not follow the terms of the GNU General Public License when using
++#   or distributing such scripts, even though portions of the text of the
++#   Macro appear in them. The GNU General Public License (GPL) does govern
++#   all other use of the material that constitutes the Autoconf Macro.
++#
++#   This special exception to the GPL applies to versions of the Autoconf
++#   Macro released by the Autoconf Archive. When you make and distribute a
++#   modified version of the Autoconf Macro, you may extend this special
++#   exception to the GPL to apply to your modified version as well.
++
++AC_DEFUN([AX_DETECT_ARMV6],
++	[AC_REQUIRE([AC_PROG_CC])
++dnl
++dnl Give the user the possibility to overwrite the auto detection
++dnl
++	AC_ARG_ENABLE([armv6core],
++		[AS_HELP_STRING([--enable-armv6core],
++			[Enable optimizations for ARMv6 cores @<:@default=auto@:>@])],
++		[ax_armv6core="${enableval}"],
++		[ax_armv6core=auto])
++
++	AC_CACHE_CHECK([for ARMv6 target core], [ax_cv_armv6core],
++		[ax_cv_armv6core=${ax_armv6core}])
++dnl	AC_MSG_RESULT([${ax_cv_armv6core}])
++
++	if test "x${ax_cv_armv6core}" = "xauto"; then
++		if test "x$GCC" != "xyes"; then
++dnl only for GCC we know it works in this way
++			AC_MSG_ERROR([Cannot autodetect the architecture for non GCC compilers])
++		else
++			AC_MSG_CHECKING(if target's core is of type ARMv6)
++			AC_COMPILE_IFELSE(
++				[AC_LANG_PROGRAM([[]],
++					[[
++#undef THIS_IS_V6
++#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
++defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
++defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__)
++# define THIS_IS_V6 1
++#endif
++int foo = THIS_IS_V6;
++					]]) dnl AC_LANG_PROGRAM
++				],
++				[ax_cv_armv6core=yes],
++				[ax_cv_armv6core=no],
++				[ARMv6 core]); dnl AC_COMPILE_IFELSE
++			AC_MSG_RESULT([${ax_cv_armv6core}]);
++		fi
++	fi
++
++	case "x${ax_cv_armv6core}" in
++	"xyes")
++		$1
++		;;
++	"xno")
++		$2
++		;;
++	*)
++		AC_MSG_ERROR([Unknown setting for ARMv6 architecture: '${ax_cv_armv6core}'.])
++		;;
++	esac
++]) dnl AC_DEFUN
diff --git a/patches/speex-1.2rc1/ax_armv7_detection.diff b/patches/speex-1.2rc1/ax_armv7_detection.diff
new file mode 100644
index 0000000..1653a9e
--- /dev/null
+++ b/patches/speex-1.2rc1/ax_armv7_detection.diff
@@ -0,0 +1,118 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Subject: [PATCH] lets configure detect more arch settings from the compiler
+
+The preprocessor defines various symbols on its default settings and also on
+given parameters. Use these symbols to detect optimization possibilities.
+
+__ARM_ARCH_7A__, __ARM_ARCH_7M__ are defined if the default
+architecture is ARMv7
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ m4/ax_armv7_detection.m4 |   98 +++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 98 insertions(+)
+
+Index: speex-1.2rc1/m4/ax_armv7_detection.m4
+===================================================================
+--- /dev/null
++++ speex-1.2rc1/m4/ax_armv7_detection.m4
+@@ -0,0 +1,98 @@
++#
++# SYNOPSIS
++#
++#   AX_DETECT_ARMV7([ACTION-IF-ARMv7],[ACTION-IF-NO-ARMv7])
++#
++# DESCRIPTION
++#
++#   AX_DETECT_ARMV7 detects from the compiler settings if the target is of
++#   type ARMv7. It is intended mostly for cross compiling to be able to collect
++#   more information about the target architecture and features. The user can
++#   overwrite the detection by using the option --enable-armv7core or
++#   --disable-armv7core.
++#   It works by detecting the compiler's macros __ARM_ARCH_7A__, __ARM_ARCH_7M__.
++#   These are set in  gcc compilers when they are configured to create code for
++#   ARMv6 cores.
++#   This macro cannot detect the correct target's features if the compiler is
++#   not correctly configured to reflect the target's features.
++#
++# LICENSE
++#
++#   Copyright (c) 2012 Juergen Beisert <jbe@pengutronix.de>
++#
++#   This program is free software; you can redistribute it and/or modify it
++#   under the terms of the GNU General Public License as published by the
++#   Free Software Foundation; either version 2 of the License, or (at your
++#   option) any later version.
++#
++#   This program is distributed in the hope that it will be useful, but
++#   WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++#   Public License for more details.
++#
++#   You should have received a copy of the GNU General Public License along
++#   with this program. If not, see <http://www.gnu.org/licenses/>.
++#
++#   As a special exception, the respective Autoconf Macro's copyright owner
++#   gives unlimited permission to copy, distribute and modify the configure
++#   scripts that are the output of Autoconf when processing the Macro. You
++#   need not follow the terms of the GNU General Public License when using
++#   or distributing such scripts, even though portions of the text of the
++#   Macro appear in them. The GNU General Public License (GPL) does govern
++#   all other use of the material that constitutes the Autoconf Macro.
++#
++#   This special exception to the GPL applies to versions of the Autoconf
++#   Macro released by the Autoconf Archive. When you make and distribute a
++#   modified version of the Autoconf Macro, you may extend this special
++#   exception to the GPL to apply to your modified version as well.
++
++AC_DEFUN([AX_DETECT_ARMV7],
++	[AC_REQUIRE([AC_PROG_CC])
++dnl
++dnl Give the user the possibility to overwrite the auto detection
++dnl
++	AC_ARG_ENABLE([armv7core],
++		[AS_HELP_STRING([--enable-armv7core],
++			[Enable optimizations for ARMv7 cores @<:@default=auto@:>@])],
++		[ax_armv7core="${enableval}"],
++		[ax_armv7core=auto])
++
++	AC_CACHE_CHECK([for ARMv7 target core], [ax_cv_armv7core],
++		[ax_cv_armv7core=${ax_armv6core}])
++dnl	AC_MSG_RESULT([${ax_cv_armv7core}])
++
++	if test "x${ax_cv_armv7core}" = "xauto"; then
++		if test "x$GCC" != "xyes"; then
++dnl only for GCC we know it works in this way
++			AC_MSG_ERROR([Cannot autodetect the architecture for non GCC compilers])
++		else
++			AC_MSG_CHECKING(if target's core is of type ARMv7)
++			AC_COMPILE_IFELSE(
++				[AC_LANG_PROGRAM([[]],
++					[[
++#undef THIS_IS_V7
++#if defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7M__)
++# define THIS_IS_V7 1
++#endif
++int foo = THIS_IS_V7;
++					]]) dnl AC_LANG_PROGRAM
++				],
++				[ax_cv_armv7core=yes],
++				[ax_cv_armv7core=no],
++				[ARMv6 core]); dnl AC_COMPILE_IFELSE
++			AC_MSG_RESULT([${ax_cv_armv7core}]);
++		fi
++	fi
++
++	case "x${ax_cv_armv7core}" in
++	"xyes")
++		$1
++		;;
++	"xno")
++		$2
++		;;
++	*)
++		AC_MSG_ERROR([Unknown setting for ARMv7 architecture: '${ax_cv_armv7core}'.])
++		;;
++	esac
++]) dnl AC_DEFUN
diff --git a/patches/speex-1.2rc1/ax_floating_point.diff b/patches/speex-1.2rc1/ax_floating_point.diff
new file mode 100644
index 0000000..9e64ce3
--- /dev/null
+++ b/patches/speex-1.2rc1/ax_floating_point.diff
@@ -0,0 +1,117 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Subject: [PATCH] lets configure detect more arch settings from the compiler
+
+The preprocessor defines various symbols on its default settings and also on
+given parameters. Use these symbols to detect optimization possibilities.
+
+__SOFTFP__ is a symbol defined when the toolchain is configured to not create
+floating point instructions and call soft floating point routines instead.
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ m4/ax_floating_point.m4 |   97 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 97 insertions(+)
+
+Index: speex-1.2rc1/m4/ax_floating_point.m4
+===================================================================
+--- /dev/null
++++ speex-1.2rc1/m4/ax_floating_point.m4
+@@ -0,0 +1,97 @@
++#
++# SYNOPSIS
++#
++#   AX_HARDWARE_FP([ACTION-IF-HARD-FLOAT],[ACTION-IF-SOFT-FLOAT])
++#
++# DESCRIPTION
++#
++#   AX_DETECT_FLOAT detects the compiler settings about floating point usage.
++#   It is intended mostly for cross compiling to be able to collect more
++#   information about the target architecture and features. The user can
++#   overwrite the detection by using the option --enable-hardware-fp or
++#   --disable-hardware-fp.
++#   It works by detecting the compiler's macro __SOFTFP__. This one is set in
++#   gcc compilers when there is no hardware floating point available.
++#   This macro cannot detect the correct target's features if the compiler is
++#   not correctly configured to reflect the target's features.
++#
++# LICENSE
++#
++#   Copyright (c) 2012 Juergen Beisert <jbe@pengutronix.de>
++#
++#   This program is free software; you can redistribute it and/or modify it
++#   under the terms of the GNU General Public License as published by the
++#   Free Software Foundation; either version 2 of the License, or (at your
++#   option) any later version.
++#
++#   This program is distributed in the hope that it will be useful, but
++#   WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++#   Public License for more details.
++#
++#   You should have received a copy of the GNU General Public License along
++#   with this program. If not, see <http://www.gnu.org/licenses/>.
++#
++#   As a special exception, the respective Autoconf Macro's copyright owner
++#   gives unlimited permission to copy, distribute and modify the configure
++#   scripts that are the output of Autoconf when processing the Macro. You
++#   need not follow the terms of the GNU General Public License when using
++#   or distributing such scripts, even though portions of the text of the
++#   Macro appear in them. The GNU General Public License (GPL) does govern
++#   all other use of the material that constitutes the Autoconf Macro.
++#
++#   This special exception to the GPL applies to versions of the Autoconf
++#   Macro released by the Autoconf Archive. When you make and distribute a
++#   modified version of the Autoconf Macro, you may extend this special
++#   exception to the GPL to apply to your modified version as well.
++
++AC_DEFUN([AX_HARDWARE_FP],
++	[AC_REQUIRE([AC_PROG_CC])
++dnl
++dnl Give the user the possibility to overwrite the auto detection
++dnl
++	AC_ARG_ENABLE([hardware-fp],
++		[AS_HELP_STRING([--enable-hardware-fp],
++			[Enable hardware floating point @<:@default=auto@:>@])],
++		[ax_hardware_fp="${enableval}"],
++		[ax_hardware_fp=auto])
++
++	AC_CACHE_CHECK([for hardware fp support], [ax_cv_hardware_fp],
++		[ax_cv_hardware_fp=${ax_hardware_fp}])
++dnl	AC_MSG_RESULT([${ax_cv_hardware_fp}])
++
++	if test "x${ax_cv_hardware_fp}" = "xauto"; then
++		if test "x$GCC" != "xyes"; then
++dnl only for GCC we know it works in this way
++			AC_MSG_ERROR([Cannot autodetect the hardware floating point feature for non GCC compilers])
++		else
++			AC_MSG_CHECKING(if hardware fp is supported)
++			AC_COMPILE_IFELSE(
++				[AC_LANG_PROGRAM([[]],
++					[[
++#define HARD_FP_SUPPORT 1
++#if defined(__SOFTFP__)
++# undef HARD_FP_SUPPORT
++#endif
++int foo = HARD_FP_SUPPORT;
++					]]) dnl AC_LANG_PROGRAM
++				],
++				[ax_cv_hardware_fp=yes],
++				[ax_cv_hardware_fp=no],
++				[hardware FP support]); dnl AC_COMPILE_IFELSE
++			AC_MSG_RESULT([${ax_cv_hardware_fp}]);
++		fi
++	fi
++
++	case "x${ax_cv_hardware_fp}" in
++	"xyes")
++		$1
++		;;
++	"xno")
++		$2
++		;;
++	*)
++		AC_MSG_ERROR([Unknown setting for hardware floating point usage: '${ax_cv_hardware_fp}'.])
++		;;
++	esac
++]) dnl AC_DEFUN
diff --git a/patches/speex-1.2rc1/clean_up_configure_ac.diff b/patches/speex-1.2rc1/clean_up_configure_ac.diff
new file mode 100644
index 0000000..72abf44
--- /dev/null
+++ b/patches/speex-1.2rc1/clean_up_configure_ac.diff
@@ -0,0 +1,160 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Subject: [PATCH] SPEEX: update the configure.ac by running 'autoupdate'
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ Makefile.am  |    2 +
+ configure.ac |   81 +++++++++++++++++++++++++++++------------------------------
+ 2 files changed, 43 insertions(+), 40 deletions(-)
+
+Index: speex-1.2rc1/configure.ac
+===================================================================
+--- speex-1.2rc1.orig/configure.ac
++++ speex-1.2rc1/configure.ac
+@@ -1,8 +1,10 @@
+ dnl Process this file with autoconf to produce a configure script. -*-m4-*-
+ 
+-AC_INIT(libspeex/speex.c)
++AC_INIT
++AC_CONFIG_SRCDIR([libspeex/speex.c])
+ 
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
++AC_CONFIG_MACRO_DIR([m4])
+ 
+ SPEEX_MAJOR_VERSION=1
+ SPEEX_MINOR_VERSION=1
+@@ -30,8 +32,11 @@ AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-
+ AM_MAINTAINER_MODE
+ 
+ AC_CANONICAL_HOST
+-AC_LIBTOOL_WIN32_DLL
+-AM_PROG_LIBTOOL
++
++LT_INIT
++
++# default is more output while building the package
++AM_SILENT_RULES()
+ 
+ AC_C_BIGENDIAN
+ AC_C_CONST
+@@ -40,37 +45,24 @@ AC_C_RESTRICT
+ 
+ 
+ AC_MSG_CHECKING(for C99 variable-size arrays)
+-AC_TRY_COMPILE( , [
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ int foo;
+ foo = 10;
+ int array[foo];
+-],
+-[has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays])
+-],
+-has_var_arrays=no
+-)
++]])],[has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays])
++],[has_var_arrays=no
++])
+ AC_MSG_RESULT($has_var_arrays)
+ 
+-AC_CHECK_HEADERS([alloca.h getopt.h])
+-AC_MSG_CHECKING(for alloca)
+-AC_TRY_COMPILE( [
+-#ifdef HAVE_ALLOCA_H
+-# include <alloca.h>
+-#endif
+-#include <stdlib.h>
+-], [
+-int foo=10;
+-int *array = alloca(foo);
+-],
+-[
+-has_alloca=yes;
+-if test x$has_var_arrays = "xno" ; then
+-AC_DEFINE([USE_ALLOCA], [], [Make use of alloca])
+-fi
+-],
+-has_alloca=no
+-)
+-AC_MSG_RESULT($has_alloca)
++AC_CHECK_HEADERS([alloca.h getopt.h fcntl.h libintl.h malloc.h sys/ioctl.h])
++AC_FUNC_ALLOCA
++AC_FUNC_MALLOC
++AC_FUNC_REALLOC
++AC_CHECK_FUNCS([floor memset pow sqrt strchr])
++
++AC_TYPE_INT16_T
++AC_TYPE_INT32_T
++AC_TYPE_SIZE_T
+ 
+ AC_MSG_CHECKING(for SSE in current arch/CFLAGS)
+ AC_LINK_IFELSE([
+@@ -138,7 +130,9 @@ if test "x$enable_libogg" = xyes; then
+ 	PKG_CHECK_MODULES(OGG, ogg)
+ fi
+ 
+-AC_CHECK_LIB(m, sin)
++AC_SEARCH_LIBS([floor], [m], [], [AC_MSG_ERROR([unable to find the floor() function])])
++AC_SEARCH_LIBS([pow], [m], [], [AC_MSG_ERROR([unable to find the pow() function])])
++AC_SEARCH_LIBS([sqrt], [m], [], [AC_MSG_ERROR([unable to find the sqrt() function])])
+ 
+ # Check for getopt_long; if not found, use included source.
+ AC_CHECK_FUNCS([getopt_long],,
+@@ -181,8 +175,7 @@ AC_ARG_ENABLE(fixed-point, [  --enable-f
+   AC_DEFINE([FIXED_POINT], , [Compile as fixed-point])
+ else
+   AC_DEFINE([FLOATING_POINT], , [Compile as floating-point])
+-fi],
+-AC_DEFINE([FLOATING_POINT], , [Compile as floating-point]))
++fi],AC_DEFINE([FLOATING_POINT], , [Compile as floating-point]))
+ 
+ if test "$has_sse" = yes; then
+   AC_DEFINE([_USE_SSE], , [Enable SSE support])
+@@ -296,7 +289,7 @@ fi
+ AC_SUBST(SIZE16)
+ AC_SUBST(SIZE32)
+ 
+-AC_OUTPUT([Makefile libspeex/Makefile src/Makefile doc/Makefile Speex.spec
++AC_CONFIG_FILES([Makefile libspeex/Makefile src/Makefile doc/Makefile Speex.spec
+            include/Makefile include/speex/Makefile speex.pc speexdsp.pc
+            win32/Makefile win32/libspeex/Makefile win32/speexenc/Makefile
+            win32/speexdec/Makefile symbian/Makefile 
+@@ -321,11 +314,19 @@ AC_OUTPUT([Makefile libspeex/Makefile sr
+            include/speex/speex_config_types.h ti/Makefile 
+ 	   ti/speex_C54_test/Makefile ti/speex_C55_test/Makefile
+ 	   ti/speex_C64_test/Makefile ])
+-
+-if test "x$src" = "x"; then 
+-echo "**IMPORTANT**"
+-echo "You don't seem to have the development package for libogg (libogg-devel) installed. Only the Speex library (libspeex) will be built (no 
encoder/decoder executable)"
+-echo "You can download libogg from http://downloads.xiph.org/releases/ogg/"
+-fi
++AC_OUTPUT
+ 
+ echo "Type \"make; make install\" to compile and install Speex";
++
++echo "------------------------------------------------------"
++echo "   Results:"
++echo "------------------------------------------------------"
++echo "   Cross compiling:       $cross_compiling"
++echo "   Target CPU:            $host_cpu"
++echo "   Target OS:             $host_os"
++echo "   Install prefix:        $prefix"
++echo "   Compiler:              $CC"
++echo "   CFLAGS:                $CFLAGS $OGG_CFLAGS"
++echo "   Additional libs:       $LIBS $OGG_LIBS"
++echo "   Coder/Encoder tools:   $enable_coders"
++echo "------------------------------------------------------"
+Index: speex-1.2rc1/Makefile.am
+===================================================================
+--- speex-1.2rc1.orig/Makefile.am
++++ speex-1.2rc1/Makefile.am
+@@ -1,5 +1,7 @@
+ ## Process this file with automake to produce Makefile.in. -*-Makefile-*-
+ 
++ACLOCAL_AMFLAGS = -I m4
++
+ # To disable automatic dependency tracking if using other tools than
+ # gcc and gmake, add the option 'no-dependencies'
+ AUTOMAKE_OPTIONS = 1.8
diff --git a/patches/speex-1.2rc1/fix_ogg_usage.diff b/patches/speex-1.2rc1/fix_ogg_usage.diff
new file mode 100644
index 0000000..0d0c30e
--- /dev/null
+++ b/patches/speex-1.2rc1/fix_ogg_usage.diff
@@ -0,0 +1,162 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Subject: [PATCH] SPEEX: avoid libogg if not really required
+
+The SPEEX library needs the oggvorbis library only when the decode/encoder tools
+are built. The library itself does not need it. But the configure test if the
+oggvorbis library is required is broken. This patch fix it by adding
+a new switch "--enable-coders". If not given, oggvorbis is not required anymore.
+Also the handmade check for oggvorbis is now replaced by a simple call to
+pkg_config.
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ acinclude.m4 |  102 -----------------------------------------------------------
+ configure.ac |   25 +++++++++++++-
+ 2 files changed, 24 insertions(+), 103 deletions(-)
+
+Index: speex-1.2rc1/configure.ac
+===================================================================
+--- speex-1.2rc1.orig/configure.ac
++++ speex-1.2rc1/configure.ac
+@@ -112,9 +112,32 @@ AC_MSG_RESULT($has_visibility)
+ 
+ AC_CHECK_HEADERS(sys/soundcard.h sys/audioio.h)
+ 
+-XIPH_PATH_OGG([src="src"], [src=""])
++PKG_PROG_PKG_CONFIG
++
++# without the coder tools we do not need libogg
++AC_MSG_CHECKING([whether to build coders tools])
++AC_ARG_ENABLE([coders],
++	[AS_HELP_STRING([--enable-coders],
++		[Enable coder tools (needs oggvorbis) @<:@default=disabled@:>@])],
++	[enable_coders="$enableval"],
++	[enable_coders=no])
++AC_MSG_RESULT([${enable_coders}])
++
++# building the coders requires libogg
++if test "x$enable_coders" = xyes; then
++	src="src"
++	enable_libogg="yes"
++else
++	src=""
++	enable_libogg="no"
++fi
+ AC_SUBST(src)
+ 
++# do we need libogg?
++if test "x$enable_libogg" = xyes; then
++	PKG_CHECK_MODULES(OGG, ogg)
++fi
++
+ AC_CHECK_LIB(m, sin)
+ 
+ # Check for getopt_long; if not found, use included source.
+Index: speex-1.2rc1/acinclude.m4
+===================================================================
+--- speex-1.2rc1.orig/acinclude.m4
++++ /dev/null
+@@ -1,102 +0,0 @@
+-# Configure paths for libogg
+-# Jack Moffitt <jack@icecast.org> 10-21-2000
+-# Shamelessly stolen from Owen Taylor and Manish Singh
+-
+-dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+-dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
+-dnl
+-AC_DEFUN([XIPH_PATH_OGG],
+-[dnl 
+-dnl Get the cflags and libraries
+-dnl
+-AC_ARG_WITH(ogg,[  --with-ogg=PFX   Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
+-AC_ARG_WITH(ogg-libraries,[  --with-ogg-libraries=DIR   Directory where libogg library is installed (optional)], ogg_libraries="$withval", 
ogg_libraries="")
+-AC_ARG_WITH(ogg-includes,[  --with-ogg-includes=DIR   Directory where libogg header files are installed (optional)], ogg_includes="$withval", 
ogg_includes="")
+-AC_ARG_ENABLE(oggtest, [  --disable-oggtest       Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
+-
+-  if test "x$ogg_libraries" != "x" ; then
+-    OGG_LIBS="-L$ogg_libraries"
+-  elif test "x$ogg_prefix" != "x" ; then
+-    OGG_LIBS="-L$ogg_prefix/lib"
+-  elif test "x$prefix" != "xNONE" ; then
+-    OGG_LIBS="-L$prefix/lib"
+-  fi
+-
+-  OGG_LIBS="$OGG_LIBS -logg"
+-
+-  if test "x$ogg_includes" != "x" ; then
+-    OGG_CFLAGS="-I$ogg_includes"
+-  elif test "x$ogg_prefix" != "x" ; then
+-    OGG_CFLAGS="-I$ogg_prefix/include"
+-  elif test "x$prefix" != "xNONE"; then
+-    OGG_CFLAGS="-I$prefix/include"
+-  fi
+-
+-  AC_MSG_CHECKING(for Ogg)
+-  no_ogg=""
+-
+-
+-  if test "x$enable_oggtest" = "xyes" ; then
+-    ac_save_CFLAGS="$CFLAGS"
+-    ac_save_LIBS="$LIBS"
+-    CFLAGS="$CFLAGS $OGG_CFLAGS"
+-    LIBS="$LIBS $OGG_LIBS"
+-dnl
+-dnl Now check if the installed Ogg is sufficiently new.
+-dnl
+-      rm -f conf.oggtest
+-      AC_TRY_RUN([
+-#include <stdio.h>
+-#include <stdlib.h>
+-#include <string.h>
+-#include <ogg/ogg.h>
+-
+-int main ()
+-{
+-  system("touch conf.oggtest");
+-  return 0;
+-}
+-
+-],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+-       CFLAGS="$ac_save_CFLAGS"
+-       LIBS="$ac_save_LIBS"
+-  fi
+-
+-  if test "x$no_ogg" = "x" ; then
+-     AC_MSG_RESULT(yes)
+-     ifelse([$1], , :, [$1])     
+-  else
+-     AC_MSG_RESULT(no)
+-     if test -f conf.oggtest ; then
+-       :
+-     else
+-       echo "*** Could not run Ogg test program, checking why..."
+-       CFLAGS="$CFLAGS $OGG_CFLAGS"
+-       LIBS="$LIBS $OGG_LIBS"
+-       AC_TRY_LINK([
+-#include <stdio.h>
+-#include <ogg/ogg.h>
+-],     [ return 0; ],
+-       [ echo "*** The test program compiled, but did not run. This usually means"
+-       echo "*** that the run-time linker is not finding Ogg or finding the wrong"
+-       echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
+-       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+-       echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+-       echo "*** is required on your system"
+-       echo "***"
+-       echo "*** If you have an old version installed, it is best to remove it, although"
+-       echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+-       [ echo "*** The test program failed to compile or link. See the file config.log for the"
+-       echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
+-       echo "*** or that you have moved Ogg since it was installed." ])
+-       CFLAGS="$ac_save_CFLAGS"
+-       LIBS="$ac_save_LIBS"
+-     fi
+-     OGG_CFLAGS=""
+-     OGG_LIBS=""
+-     ifelse([$2], , :, [$2])
+-  fi
+-  AC_SUBST(OGG_CFLAGS)
+-  AC_SUBST(OGG_LIBS)
+-  rm -f conf.oggtest
+-])
diff --git a/patches/speex-1.2rc1/install_tests.diff b/patches/speex-1.2rc1/install_tests.diff
new file mode 100644
index 0000000..d0e4f4d
--- /dev/null
+++ b/patches/speex-1.2rc1/install_tests.diff
@@ -0,0 +1,22 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Subject: [PATCH] also install the test tools
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ libspeex/Makefile.am |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: speex-1.2rc1/libspeex/Makefile.am
+===================================================================
+--- speex-1.2rc1.orig/libspeex/Makefile.am
++++ speex-1.2rc1/libspeex/Makefile.am
+@@ -40,7 +40,7 @@ noinst_HEADERS = 	arch.h 	cb_search_arm4
+ libspeex_la_LDFLAGS = -no-undefined -version-info @SPEEX_LT_CURRENT@:@SPEEX_LT_REVISION@:@SPEEX_LT_AGE@
+ libspeexdsp_la_LDFLAGS = -no-undefined -version-info @SPEEX_LT_CURRENT@:@SPEEX_LT_REVISION@:@SPEEX_LT_AGE@
+ 
+-noinst_PROGRAMS = testenc testenc_wb testenc_uwb testdenoise testecho testjitter
++bin_PROGRAMS = testenc testenc_wb testenc_uwb testdenoise testecho testjitter
+ testenc_SOURCES = testenc.c
+ testenc_LDADD = libspeex.la
+ testenc_wb_SOURCES = testenc_wb.c
diff --git a/patches/speex-1.2rc1/series b/patches/speex-1.2rc1/series
new file mode 100644
index 0000000..3adfd21
--- /dev/null
+++ b/patches/speex-1.2rc1/series
@@ -0,0 +1,9 @@
+fix_ogg_usage.diff
+clean_up_configure_ac.diff
+ax_floating_point.diff
+ax_armv4_detection.diff
+ax_armv5_detection.diff
+ax_armv6_detection.diff
+ax_armv7_detection.diff
+add_more_autodetection.diff
+install_tests.diff
diff --git a/rules/speex.in b/rules/speex.in
index 7ed3b83..060feb6 100644
--- a/rules/speex.in
+++ b/rules/speex.in
@@ -3,62 +3,41 @@
 menuconfig SPEEX
 	tristate
 	select LIBC_M
-	select GCCLIBS_GCC_S
-	select LIBOGG
+	select GCCLIBS_GCC_S if SPEEX_INSTALL_SPEEXDEC
+	select LIBOGG if SPEEX_ENABLE_TOOLS
 	prompt "speex                         "
 	help
-	  Speex is an Open Source/Free Software
-	  patent-free audio compression format
-	  designed for speech.
+	  Speex is an Open Source/Free Software patent-free audio compression
+	  format designed for speech.
 
 if SPEEX
 
-config SPEEX_FIXED_POINT
+config SPEEX_ENABLE_TOOLS
 	bool
-	prompt "use fixed point"
 
-config SPEEX_FIXED_POINT_DEBUG
-	bool
-	depends on SPEEX_FIXED_POINT
-	prompt "fixed point debugging"
-
-config SPEEX_FLOAT_API
-	bool
-	prompt "enable float api"
-
-config SPEEX_VBR
-	bool
-	prompt "enable VBR"
-
-choice
-	prompt "Kind of FFT to use"
-	default SPEEX_FFT_KISS
-
-	config SPEEX_FFT_KISS
-		bool
-		prompt "kiss"
-
-	config SPEEX_FFT_SMALLFT
-		bool
-		prompt "smallft"
-
-	config SPEEX_FFT_GPL_FFTW3
-		bool
-		depends on BROKEN
-		prompt "gpl-fftw3 [BROKEN]"
-
-	config SPEEX_FFT_PROPRIETARY_INTL_MKL
-		bool
-		depends on BROKEN
-		prompt "proprietary-intel-mkl [BROKEN]"
-endchoice
+comment "--- install options ---"
 
 config SPEEX_INSTALL_SPEEXENC
 	bool
-	prompt "Install speexenc"
+	select SPEEX_ENABLE_TOOLS
+	prompt "install speexenc"
+	help
+	  Install a tool to encode an audio file into the speex format.
+	  Note: this requires libogg
 
 config SPEEX_INSTALL_SPEEXDEC
 	bool
-	prompt "Install speexdec"
+	select SPEEX_ENABLE_TOOLS
+	prompt "install speexdec"
+	help
+	  Install a tool to decode a speex audio file.
+	  Note: this requires libogg
+
+config SPEEX_INSTALL_TESTS
+	bool
+	prompt "install tests"
+	help
+	  Install some tests from the package. Useful only for development or
+	  debugging.
 
 endif
diff --git a/rules/speex.make b/rules/speex.make
index d181ca4..51eff4d 100644
--- a/rules/speex.make
+++ b/rules/speex.make
@@ -26,58 +26,22 @@ SPEEX_DIR	:= $(BUILDDIR)/$(SPEEX)
 SPEEX_LICENSE	:= unknown
 
 # ----------------------------------------------------------------------------
-# Get
-# ----------------------------------------------------------------------------
-
-$(SPEEX_SOURCE):
-	@$(call targetinfo)
-	@$(call get, SPEEX)
-
-# ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
 
-SPEEX_FFT-$(PTXCONF_SPEEX_FFT_KISS)			+= kiss
-SPEEX_FFT-$(PTXCONF_SPEEX_FFT_SMALLFT)			+= smallft
-SPEEX_FFT-$(PTXCONF_SPEEX_FFT_GPL_FFTW3)		+= gpl-fftw3
-SPEEX_FFT-$(PTXCONF_SPEEX_FFT_PROPRIETARY_INTL_MKL)	+= proprietary-intel-mkl
-
 #
 # autoconf
 #
 SPEEX_CONF_TOOL := autoconf
 SPEEX_CONF_OPT := \
 	$(CROSS_AUTOCONF_USR) \
-	--disable-oggtest \
+	--enable-shared \
+	--disable-static \
 	--disable-valgrind \
-	--disable-fixed-point-debug \
-	--enable-fixed-point \
-	--disable-float-api \
-	--disable-vbr \
 	--disable-ti-c55x \
-	--with-fft=$(SPEEX_FFT-y) \
-	--with-ogg=$(PTXDIST_SYSROOT_TARGET)/usr
+	--$(call ptx/endis, PTXCONF_SPEEX_ENABLE_TOOLS)-coders
 
-ifdef PTXCONF_ARCH_ARM_V4
-SPEEX_CONF_OPT += --enable-arm4-asm
-else
-SPEEX_CONF_OPT += --disable-arm4-asm
-endif
-ifdef PTXCONF_ARCH_ARM_V5E
-SPEEX_CONF_OPT += --enable-arm5e-asm
-else
-SPEEX_CONF_OPT += --disable-arm5e-asm
-endif
-ifdef PTXCONF_ARCH_X86
-SPEEX_CONF_OPT += --enable-sse
-else
-SPEEX_CONF_OPT += --disable-sse
-endif
-ifdef PTXCONF_ARCH_BLACKFIN
-SPEEX_CONF_OPT += --enable-blackfin-asm
-else
-SPEEX_CONF_OPT += --disable-blackfin-asm
-endif
+SPEEX_TESTS := testdenoise testecho testenc testenc_uwb testenc_wb testjitter
 
 # ----------------------------------------------------------------------------
 # Target-Install
@@ -102,6 +66,11 @@ endif
 	@$(call install_lib, speex, 0, 0, 0644, libspeexdsp)
 	@$(call install_lib, speex, 0, 0, 0644, libspeex)
 
+ifdef PTXCONF_SPEEX_INSTALL_TESTS
+	@$(foreach test, $(SPEEX_TESTS), \
+		$(call install_copy, speex, 0, 0, 0755, -, /usr/bin/$(test));)
+endif
+
 	@$(call install_finish, speex)
 
 	@$(call touch)

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-08  8:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-06 11:08 [ptxdist] [RFC] Improve speex's buildsystem Juergen Beisert
2012-04-08  7:42 ` Michael Olbrich
2012-04-08  7:47   ` Wolfram Sang
2012-04-08  7:56     ` Michael Olbrich
2012-04-08  8:59   ` Juergen Beisert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox