* [ptxdist] [PATCH] SPEEX: fix broken package
@ 2011-12-27 20:31 Juergen Beisert
2011-12-28 21:26 ` Juergen Beisert
0 siblings, 1 reply; 3+ messages in thread
From: Juergen Beisert @ 2011-12-27 20:31 UTC (permalink / raw)
To: ptxdist
The current SPEEX adaption in PTXdist is broken in some ways.
This patch
- adds the forgotten 'configure* switches from the configure menu
- removes the dependency to oggvorbis if not really needed
- fixes some handmade configure rules and replace them with
proper autotool macros
- updates the configure.ac with the result of "autoupdate"
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
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/clean_up_configure_ac.diff b/patches/speex-1.2rc1/clean_up_configure_ac.diff
new file mode 100644
index 0000000..876bfaa
--- /dev/null
+++ b/patches/speex-1.2rc1/clean_up_configure_ac.diff
@@ -0,0 +1,143 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Subject: [PATCH] SPEEX: update the configure.ac by running 'autoupdate'
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ configure.ac | 77 ++++++++++++++++++++++++++++-------------------------------
+ 1 file changed, 37 insertions(+), 40 deletions(-)
+
+Index: speex-1.2rc1/configure.ac
+===================================================================
+--- speex-1.2rc1.orig/configure.ac
++++ speex-1.2rc1/configure.ac
+@@ -1,8 +1,9 @@
+ 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])
+
+ SPEEX_MAJOR_VERSION=1
+ SPEEX_MINOR_VERSION=1
+@@ -30,8 +31,8 @@ AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-
+ AM_MAINTAINER_MODE
+
+ AC_CANONICAL_HOST
+-AC_LIBTOOL_WIN32_DLL
+-AM_PROG_LIBTOOL
++
++LT_INIT
+
+ AC_C_BIGENDIAN
+ AC_C_CONST
+@@ -40,37 +41,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 +126,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 +171,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 +285,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 +310,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 "------------------------------------------------------"
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/series b/patches/speex-1.2rc1/series
new file mode 100644
index 0000000..fbd9fe5
--- /dev/null
+++ b/patches/speex-1.2rc1/series
@@ -0,0 +1,2 @@
+fix_ogg_usage.diff
+clean_up_configure_ac.diff
diff --git a/rules/speex.in b/rules/speex.in
index 7ed3b83..0e44b08 100644
--- a/rules/speex.in
+++ b/rules/speex.in
@@ -3,8 +3,8 @@
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
@@ -13,9 +13,14 @@ menuconfig SPEEX
if SPEEX
+config SPEEX_ENABLE_TOOLS
+ bool
+
config SPEEX_FIXED_POINT
bool
prompt "use fixed point"
+ help
+ Use fixed point commands
config SPEEX_FIXED_POINT_DEBUG
bool
@@ -25,10 +30,14 @@ config SPEEX_FIXED_POINT_DEBUG
config SPEEX_FLOAT_API
bool
prompt "enable float api"
+ help
+ Use floating point commands
config SPEEX_VBR
bool
prompt "enable VBR"
+ help
+ Enable Variable Bit Rate
choice
prompt "Kind of FFT to use"
@@ -37,10 +46,15 @@ choice
config SPEEX_FFT_KISS
bool
prompt "kiss"
+ help
+ Use KISS Fast Fourier Transform
config SPEEX_FFT_SMALLFT
bool
prompt "smallft"
+ help
+ Use FFT from the OggVorbis project (this does not require
+ the oggvorbis library at run-time)
config SPEEX_FFT_GPL_FFTW3
bool
@@ -55,10 +69,18 @@ endchoice
config SPEEX_INSTALL_SPEEXENC
bool
+ 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
+ select SPEEX_ENABLE_TOOLS
prompt "Install speexdec"
+ help
+ Install a tool to decode a speex audio file.
+ Note: this requires libogg
endif
diff --git a/rules/speex.make b/rules/speex.make
index d181ca4..7730b26 100644
--- a/rules/speex.make
+++ b/rules/speex.make
@@ -48,16 +48,37 @@ SPEEX_FFT-$(PTXCONF_SPEEX_FFT_PROPRIETARY_INTL_MKL) += proprietary-intel-mkl
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
+ifdef PTXCONF_SPEEX_ENABLE_TOOLS
+SPEEX_CONF_OPT += --enable-coders
+else
+SPEEX_CONF_OPT += --disable-coders
+endif
+ifdef PTXCONF_SPEEX_FIXED_POINT
+SPEEX_CONF_OPT += --enable-fixed-point
+else
+SPEEX_CONF_OPT += --disable-fixed-point
+endif
+ifdef PTXCONF_SPEEX_FIXED_POINT_DEBUG
+SPEEX_CONF_OPT += --enable-fixed-point-debug
+else
+SPEEX_CONF_OPT += --disable-fixed-point-debug
+endif
+ifdef PTXCONF_SPEEX_FLOAT_API
+SPEEX_CONF_OPT += --enable-float-api
+else
+SPEEX_CONF_OPT += --disable-float-api
+endif
+ifdef PTXCONF_SPEEX_VBR
+SPEEX_CONF_OPT += --enable-vbr
+else
+SPEEX_CONF_OPT += --disable-vbr
+endif
ifdef PTXCONF_ARCH_ARM_V4
SPEEX_CONF_OPT += --enable-arm4-asm
else
--
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] 3+ messages in thread
* Re: [ptxdist] [PATCH] SPEEX: fix broken package
2011-12-27 20:31 [ptxdist] [PATCH] SPEEX: fix broken package Juergen Beisert
@ 2011-12-28 21:26 ` Juergen Beisert
2012-01-02 11:32 ` Juergen Beisert
0 siblings, 1 reply; 3+ messages in thread
From: Juergen Beisert @ 2011-12-28 21:26 UTC (permalink / raw)
To: ptxdist
Ups, don't use this patch. Some symbols used in the speex.make rule file do
not exist in PTXdist anymore. Fix will follow.
jbe
--
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] 3+ messages in thread
* [ptxdist] [PATCH] SPEEX: fix broken package
2011-12-28 21:26 ` Juergen Beisert
@ 2012-01-02 11:32 ` Juergen Beisert
0 siblings, 0 replies; 3+ messages in thread
From: Juergen Beisert @ 2012-01-02 11:32 UTC (permalink / raw)
To: ptxdist
The current SPEEX adaption in PTXdist is broken in some ways.
This patch
- adds the forgotten 'configure* switches from the configure menu
- removes the dependency to oggvorbis if not really needed
- fixes some handmade configure rules and replace them with
proper autotool macros
- updates the configure.ac with the result of "autoupdate"
- fix the dependencies between the 'configure' switches
'--disable-fixed-point-debug', '--enable-fixed-point', '--disable-float-api',
'--disable-vbr' and '--with-fft'
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
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/clean_up_configure_ac.diff b/patches/speex-1.2rc1/clean_up_configure_ac.diff
new file mode 100644
index 0000000..876bfaa
--- /dev/null
+++ b/patches/speex-1.2rc1/clean_up_configure_ac.diff
@@ -0,0 +1,143 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Subject: [PATCH] SPEEX: update the configure.ac by running 'autoupdate'
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+
+---
+ configure.ac | 77 ++++++++++++++++++++++++++++-------------------------------
+ 1 file changed, 37 insertions(+), 40 deletions(-)
+
+Index: speex-1.2rc1/configure.ac
+===================================================================
+--- speex-1.2rc1.orig/configure.ac
++++ speex-1.2rc1/configure.ac
+@@ -1,8 +1,9 @@
+ 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])
+
+ SPEEX_MAJOR_VERSION=1
+ SPEEX_MINOR_VERSION=1
+@@ -30,8 +31,8 @@ AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-
+ AM_MAINTAINER_MODE
+
+ AC_CANONICAL_HOST
+-AC_LIBTOOL_WIN32_DLL
+-AM_PROG_LIBTOOL
++
++LT_INIT
+
+ AC_C_BIGENDIAN
+ AC_C_CONST
+@@ -40,37 +41,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 +126,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 +171,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 +285,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 +310,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 "------------------------------------------------------"
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/series b/patches/speex-1.2rc1/series
new file mode 100644
index 0000000..fbd9fe5
--- /dev/null
+++ b/patches/speex-1.2rc1/series
@@ -0,0 +1,2 @@
+fix_ogg_usage.diff
+clean_up_configure_ac.diff
diff --git a/rules/speex.in b/rules/speex.in
index 7ed3b83..5bae9cd 100644
--- a/rules/speex.in
+++ b/rules/speex.in
@@ -3,8 +3,8 @@
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
@@ -13,52 +13,118 @@ menuconfig SPEEX
if SPEEX
+config SPEEX_ENABLE_TOOLS
+ bool
+
+config SPEEX_FLOATING_POINT
+ bool
+
config SPEEX_FIXED_POINT
bool
- prompt "use fixed point"
+
+config SPEEX_FFT_KISS
+ bool
+ help
+ Fixed point FFT
+
+config SPEEX_FFT_SMALLFT
+ bool
+ help
+ Floating point FFT from OggVorbis
+
+comment "--- build options ---"
+
+choice
+ prompt "optimize for"
+ default SPEEX_WITH_FLOAT
+
+config SPEEX_WITH_FLOAT
+ bool
+ prompt "generic CPU with a hardware floating point unit"
+ select SPEEX_FLOATING_POINT
+ select SPEEX_FFT_SMALLFT
+ help
+ Use fixed point calculations for all CPUs which comes without a
+ hardware floating point unit.
+
+config SPEEX_NO_FLOAT
+ bool
+ prompt "generic CPU without a hardware floating point unit"
+ select SPEEX_FIXED_POINT
+ select SPEEX_FFT_KISS
+ help
+ Use fixed point calculations for all CPUs which comes without a
+ hardware floating point unit.
+
+config SPEEX_ARMV4
+ bool
+ prompt "ARMv4"
+ select SPEEX_FIXED_POINT
+ select SPEEX_FFT_KISS
+ help
+ Use assembler code optimized for ARM based CPUs with a V4 core.
+
+config SPEEX_ARMV5
+ bool
+ prompt "ARMv5"
+ select SPEEX_FIXED_POINT
+ select SPEEX_FFT_KISS
+ help
+ Use assembler code optimized for ARM based CPUs with a V5 core
+
+config SPEEX_SSE
+ bool
+ prompt "x86/SSE"
+ select SPEEX_FLOATING_POINT
+ select SPEEX_FFT_SMALLFT
+ help
+ Use code optimized for x86 CPUs with an SSE unit
+
+config SPEEX_BLACKFIN
+ bool
+ prompt "Blackfin"
+ select SPEEX_FIXED_POINT
+ select SPEEX_FFT_KISS
+ help
+ Use assembler code optimized for Blackfin CPUs
+
+endchoice
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
+ depends on SPEEX_FLOATING_POINT
prompt "enable VBR"
+ help
+ Enable Variable Bit Rate (with floating point only)
-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..a9a01bf 100644
--- a/rules/speex.make
+++ b/rules/speex.make
@@ -48,32 +48,50 @@ SPEEX_FFT-$(PTXCONF_SPEEX_FFT_PROPRIETARY_INTL_MKL) += proprietary-intel-mkl
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
-ifdef PTXCONF_ARCH_ARM_V4
+ifdef PTXCONF_SPEEX_ENABLE_TOOLS
+SPEEX_CONF_OPT += --enable-coders
+else
+SPEEX_CONF_OPT += --disable-coders
+endif
+ifdef PTXCONF_SPEEX_FIXED_POINT
+SPEEX_CONF_OPT += --enable-fixed-point \
+ --disable-float-api
+ifdef PTXCONF_SPEEX_FIXED_POINT_DEBUG
+SPEEX_CONF_OPT += --enable-fixed-point-debug
+else
+SPEEX_CONF_OPT += --disable-fixed-point-debug
+endif
+else
+SPEEX_CONF_OPT += --disable-fixed-point \
+ --enable-float-api
+endif
+ifdef PTXCONF_SPEEX_VBR
+SPEEX_CONF_OPT += --enable-vbr
+else
+SPEEX_CONF_OPT += --disable-vbr
+endif
+ifdef PTXCONF_SPEEX_ARMV4
SPEEX_CONF_OPT += --enable-arm4-asm
else
SPEEX_CONF_OPT += --disable-arm4-asm
endif
-ifdef PTXCONF_ARCH_ARM_V5E
+ifdef PTXCONF_SPEEX_ARMV5
SPEEX_CONF_OPT += --enable-arm5e-asm
else
SPEEX_CONF_OPT += --disable-arm5e-asm
endif
-ifdef PTXCONF_ARCH_X86
+ifdef PTXCONF_SPEEX_SSE
SPEEX_CONF_OPT += --enable-sse
else
SPEEX_CONF_OPT += --disable-sse
endif
-ifdef PTXCONF_ARCH_BLACKFIN
+ifdef PTXCONF_SPEEX_BLACKFIN
SPEEX_CONF_OPT += --enable-blackfin-asm
else
SPEEX_CONF_OPT += --disable-blackfin-asm
@@ -102,6 +120,20 @@ endif
@$(call install_lib, speex, 0, 0, 0644, libspeexdsp)
@$(call install_lib, speex, 0, 0, 0644, libspeex)
+ifdef PTXCONF_SPEEX_INSTALL_TESTS
+ @$(call install_copy, speex, 0, 0, 0755, \
+ $(SPEEX_DIR)/libspeex/testdenoise, /usr/bin/testdenoise)
+ @$(call install_copy, speex, 0, 0, 0755, \
+ $(SPEEX_DIR)/libspeex/testecho, /usr/bin/testecho)
+ @$(call install_copy, speex, 0, 0, 0755, \
+ $(SPEEX_DIR)/libspeex/testenc, /usr/bin/testenc)
+ @$(call install_copy, speex, 0, 0, 0755, \
+ $(SPEEX_DIR)/libspeex/testenc_uwb, /usr/bin/testenc_uwb)
+ @$(call install_copy, speex, 0, 0, 0755, \
+ $(SPEEX_DIR)/libspeex/testenc_wb, /usr/bin/testenc_wb)
+ @$(call install_copy, speex, 0, 0, 0755, \
+ $(SPEEX_DIR)/libspeex/testjitter, /usr/bin/testjitter)
+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] 3+ messages in thread
end of thread, other threads:[~2012-01-02 11:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-27 20:31 [ptxdist] [PATCH] SPEEX: fix broken package Juergen Beisert
2011-12-28 21:26 ` Juergen Beisert
2012-01-02 11:32 ` Juergen Beisert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox