Skip to contentSkip to conversation

include speexdsp_types.h, not speex_types.h

PATCH In review Tanu Kaskinen 2 participants 3 messages Jul 9, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include speexdsp_types.h, not speex_types.h

Speexdsp was separated from speex in 1.2rc2. speex_types.h is not shipped by speexdsp, so alsa-plugins shouldn't use that file. speexdsp has speexdsp_types.h, which has the same contents as speex_types.h.

speexdsp_types.h is a new file introduced in 1.2rc2, so this change bumps the minimum supported speexdsp version. The version check in configure.ac will actually break if speexdsp 1.2 ever gets released, because pkg-config thinks that "1.2" < "1.2rc2", but I think it's useful to fail if the installed speexdsp version is 1.2rc1 (which I believe is very common on current distributions). If a non-rc version of speexdsp will ever get released, I hope version number 1.2 will be skipped for this reason. (A non-rc version seems unlikely, since 1.2rc1 was released years ago, so it's pretty likely that the project is stuck on so called "release candidates" forever...)

---
 configure.ac          | 2 +-
 pph/arch.h            | 2 +-
 pph/speex_resampler.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
configure.ac +1 -1
index 902a6d7..c554d22 100644
@@ -108,7 +108,7 @@ AC_SUBST(AVCODEC_CFLAGS)
 AC_SUBST(AVCODEC_LIBS)
 AC_SUBST(AVCODEC_HEADER)
 
-PKG_CHECK_MODULES(speexdsp, [speexdsp >= 1.2], [HAVE_SPEEXDSP="yes"], [HAVE_SPEEXDSP=""])
+PKG_CHECK_MODULES(speexdsp, [speexdsp >= 1.2rc2], [HAVE_SPEEXDSP="yes"], [HAVE_SPEEXDSP=""])
 AM_CONDITIONAL(HAVE_SPEEXDSP, test "$HAVE_SPEEXDSP" = "yes")
 
 AC_ARG_WITH([speex],
pph/arch.h +1 -1
index e2d731a..a07d0d9 100644
@@ -36,7 +36,7 @@
 #define ARCH_H
 
 #ifndef OUTSIDE_SPEEX
-#include "speex/speex_types.h"
+#include "speex/speexdsp_types.h"
 #endif
 
 #define ABS(x) ((x) < 0 ? (-(x)) : (x))      /**< Absolute integer value. */
pph/speex_resampler.h +1 -1
index c44fbcd..aa85abb 100644
@@ -82,7 +82,7 @@
       
 #else /* OUTSIDE_SPEEX */
 
-#include "speex/speex_types.h"
+#include "speex/speexdsp_types.h"
 
 #endif /* OUTSIDE_SPEEX */
 
Signature · 1 line
1.9.3
#1 lore raw
Quoted 16 lines · Tanu Kaskinen

Speexdsp was separated from speex in 1.2rc2. speex_types.h is not shipped by speexdsp, so alsa-plugins shouldn't use that file. speexdsp has speexdsp_types.h, which has the same contents as speex_types.h.

speexdsp_types.h is a new file introduced in 1.2rc2, so this change bumps the minimum supported speexdsp version. The version check in configure.ac will actually break if speexdsp 1.2 ever gets released, because pkg-config thinks that "1.2" < "1.2rc2", but I think it's useful to fail if the installed speexdsp version is 1.2rc1 (which I believe is very common on current distributions). If a non-rc version of speexdsp will ever get released, I hope version number 1.2 will be skipped for this reason. (A non-rc version seems unlikely, since 1.2rc1 was released years ago, so it's pretty likely that the project is stuck on so called "release candidates" forever...)

Quoted 1 line

While I take this as is, I think we can work around the old header file by just checking the new path and creating a dummy header including the old header in configure script. Let me give some try...

thanks,

Takashi

Quoted 53 lines
---
 configure.ac          | 2 +-
 pph/arch.h            | 2 +-
 pph/speex_resampler.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
configure.ac +1 -1
index 902a6d7..c554d22 100644
@@ -108,7 +108,7 @@ AC_SUBST(AVCODEC_CFLAGS)
 AC_SUBST(AVCODEC_LIBS)
 AC_SUBST(AVCODEC_HEADER)
 
-PKG_CHECK_MODULES(speexdsp, [speexdsp >= 1.2], [HAVE_SPEEXDSP="yes"], [HAVE_SPEEXDSP=""])
+PKG_CHECK_MODULES(speexdsp, [speexdsp >= 1.2rc2], [HAVE_SPEEXDSP="yes"], [HAVE_SPEEXDSP=""])
 AM_CONDITIONAL(HAVE_SPEEXDSP, test "$HAVE_SPEEXDSP" = "yes")
 
 AC_ARG_WITH([speex],
pph/arch.h +1 -1
index e2d731a..a07d0d9 100644
@@ -36,7 +36,7 @@
 #define ARCH_H
 
 #ifndef OUTSIDE_SPEEX
-#include "speex/speex_types.h"
+#include "speex/speexdsp_types.h"
 #endif
 
 #define ABS(x) ((x) < 0 ? (-(x)) : (x))      /**< Absolute integer value. */
pph/speex_resampler.h +1 -1
index c44fbcd..aa85abb 100644
@@ -82,7 +82,7 @@
 
 #else /* OUTSIDE_SPEEX */
 
-#include "speex/speex_types.h"
+#include "speex/speexdsp_types.h"
 
 #endif /* OUTSIDE_SPEEX */
 
Signature · 6 lines
1.9.3

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#2 lore raw
Quoted 19 lines · Takashi Iwai
Quoted 16 lines · Tanu Kaskinen

Speexdsp was separated from speex in 1.2rc2. speex_types.h is not shipped by speexdsp, so alsa-plugins shouldn't use that file. speexdsp has speexdsp_types.h, which has the same contents as speex_types.h.

speexdsp_types.h is a new file introduced in 1.2rc2, so this change bumps the minimum supported speexdsp version. The version check in configure.ac will actually break if speexdsp 1.2 ever gets released, because pkg-config thinks that "1.2" < "1.2rc2", but I think it's useful to fail if the installed speexdsp version is 1.2rc1 (which I believe is very common on current distributions). If a non-rc version of speexdsp will ever get released, I hope version number 1.2 will be skipped for this reason. (A non-rc version seems unlikely, since 1.2rc1 was released years ago, so it's pretty likely that the project is stuck on so called "release candidates" forever...)

Quoted 6 lines
Quoted 1 line

While I take this as is, I think we can work around the old header file by just checking the new path and creating a dummy header including the old header in configure script. Let me give some try...

OK, below seems working for both 1.2rc1 and 1.2rc2.

Takashi

---
From: Takashi Iwai <[email protected]>
Subject: [PATCH] pph: Fix build with older speex

The previous commit fixed the build of the recent speexdsp, but it also broke the build with the old library. Actually the only needed change is the inclusion of speex/speex_types.h instead of speex/speexdsp_types.h, so it can be easily worked around via the check in configure script.

Along with this change, make the version check back to 1.2 from 1.2rc2, as 1.2rc1 works fine now again, too.

---
 configure.ac          | 6 +++++-
 pph/speex_resampler.h | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)
configure.ac +5 -1
index c554d2260b63..e786d8e7194b 100644
@@ -108,7 +108,7 @@ AC_SUBST(AVCODEC_CFLAGS)
 AC_SUBST(AVCODEC_LIBS)
 AC_SUBST(AVCODEC_HEADER)
 
-PKG_CHECK_MODULES(speexdsp, [speexdsp >= 1.2rc2], [HAVE_SPEEXDSP="yes"], [HAVE_SPEEXDSP=""])
+PKG_CHECK_MODULES(speexdsp, [speexdsp >= 1.2], [HAVE_SPEEXDSP="yes"], [HAVE_SPEEXDSP=""])
 AM_CONDITIONAL(HAVE_SPEEXDSP, test "$HAVE_SPEEXDSP" = "yes")
 
 AC_ARG_WITH([speex],
@@ -133,6 +133,10 @@ fi
 AM_CONDITIONAL(HAVE_PPH, test "$PPH" = "builtin" -o "$PPH" = "lib")
 AM_CONDITIONAL(USE_LIBSPEEX, test "$PPH" = "lib")
 
+if test "$PPH" = "lib"; then
+    AC_CHECK_HEADERS([speex/speexdsp_types.h])
+fi
+
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
 
pph/speex_resampler.h +4 -0
index aa85abb8cc65..0e5ced45c580 100644
@@ -82,7 +82,11 @@
       
 #else /* OUTSIDE_SPEEX */
 
+#ifdef HAVE_SPEEX_SPEEXDSP_TYPES_H
 #include "speex/speexdsp_types.h"
+#else
+#include "speex/speex_types.h"
+#endif
 
 #endif /* OUTSIDE_SPEEX */
 
Signature · 1 line
2.4.5