diff options
author | Jörg Sommer <joerg.sommer@navimatix.de> | 2024-03-16 09:23:07 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-03-17 13:10:11 -0700 |
commit | 6a2b29e98d77de46a2885eff15bc8e4bc42e9396 (patch) | |
tree | 9c0c7bd1904f209b619daa9def29fc7924adc6d3 /meta-multimedia | |
parent | 538b03a3ffaf25c3bfcde076ae6a81ca05b3c166 (diff) | |
download | meta-openembedded-6a2b29e98d77de46a2885eff15bc8e4bc42e9396.tar.gz |
spandsp: new telephony DSP library
Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-multimedia')
3 files changed, 267 insertions, 0 deletions
diff --git a/meta-multimedia/recipes-multimedia/spandsp/spandsp/configure.patch b/meta-multimedia/recipes-multimedia/spandsp/spandsp/configure.patch new file mode 100644 index 0000000000..af504be766 --- /dev/null +++ b/meta-multimedia/recipes-multimedia/spandsp/spandsp/configure.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From: =?UTF-8?q?J=C3=B6rg=20Sommer?= <joerg.sommer@navimatix.de> | ||
2 | Date: Thu, 14 Mar 2024 09:41:57 +0100 | ||
3 | Subject: [PATCH 2/2] configure: Replace manual search for libxml by | ||
4 | AC_CHECK_LIB | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | The manual search fails if the include directories (and build environment) | ||
10 | are located somewhere else. | ||
11 | |||
12 | Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de> | ||
13 | Upstream-Status: Submitted [https://github.com/freeswitch/spandsp/pull/74] | ||
14 | --- | ||
15 | |||
16 | ERROR: spandsp-3.0.0+git-r0 do_configure: QA Issue: This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities. | ||
17 | |||
18 | configure.ac | 22 +++++----------------- | ||
19 | 1 file changed, 5 insertions(+), 17 deletions(-) | ||
20 | |||
21 | diff --git a/configure.ac b/configure.ac | ||
22 | index 2140837..b5138d6 100644 | ||
23 | --- a/configure.ac | ||
24 | +++ b/configure.ac | ||
25 | @@ -185,23 +185,11 @@ then | ||
26 | fi | ||
27 | |||
28 | # Determine XML2 include path | ||
29 | -AC_MSG_CHECKING(for libxml/xmlmemory.h) | ||
30 | - | ||
31 | -# Can we include headers using system include dirs? | ||
32 | -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libxml/xmlmemory.h>]], [[int a = 1;]])],[XML2_INCLUDE=" "],[XML2_INCLUDE=]) | ||
33 | - | ||
34 | -# Hunt through several possible directories to find the includes for libxml2 | ||
35 | -if test "x$XML2_INCLUDE" = "x"; then | ||
36 | - old_CPPFLAGS="$CPPFLAGS" | ||
37 | - for i in $xml2_include_dir /usr/include /usr/local/include /usr/include/libxml2 /usr/local/include/libxml2 ; do | ||
38 | - CPPFLAGS="$old_CPPFLAGS -I$i" | ||
39 | - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libxml/xmlmemory.h>]], [[int a = 1;]])],[XML2_INCLUDE="-I$i"],[XML2_INCLUDE= | ||
40 | - ]) | ||
41 | - if test "x$XML2_INCLUDE" != "x"; then | ||
42 | - break; | ||
43 | - fi | ||
44 | - done | ||
45 | - CPPFLAGS="$old_CPPFLAGS $XML2_INCLUDE" | ||
46 | +AC_CHECK_LIB([xml2], [xmlParseFile], [libxml2_found=yes]) | ||
47 | +if test "$libxml2_found" = "yes" ; then | ||
48 | + AC_DEFINE(HAVE_LIBXML2,1,[defined when libxml2 is available]) | ||
49 | +else | ||
50 | + AC_MSG_WARN([libxml2 not found. Disabling cache.]) | ||
51 | fi | ||
52 | |||
53 | AC_CHECK_HEADERS([libxml/xmlmemory.h]) | ||
54 | -- | ||
55 | 2.34.1 | ||
56 | |||
diff --git a/meta-multimedia/recipes-multimedia/spandsp/spandsp/makefile.patch b/meta-multimedia/recipes-multimedia/spandsp/spandsp/makefile.patch new file mode 100644 index 0000000000..d3eb047fe5 --- /dev/null +++ b/meta-multimedia/recipes-multimedia/spandsp/spandsp/makefile.patch | |||
@@ -0,0 +1,161 @@ | |||
1 | From: =?UTF-8?q?J=C3=B6rg=20Sommer?= <joerg.sommer@navimatix.de> | ||
2 | Date: Thu, 14 Mar 2024 08:08:13 +0100 | ||
3 | Subject: [PATCH 1/2] configure: Use AX_PROG_CC_FOR_BUILD for cross compiling | ||
4 | MIME-Version: 1.0 | ||
5 | Content-Type: text/plain; charset=UTF-8 | ||
6 | Content-Transfer-Encoding: 8bit | ||
7 | |||
8 | The macro AX_PROG_CC_FOR_BUILD [1] sets the variables CC_FOR_BUILD and | ||
9 | ..._FLAGS_FOR_BUILD they can be used [2] to build binaries used at compile | ||
10 | time. | ||
11 | |||
12 | [1]: https://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html | ||
13 | [2]: https://stackoverflow.com/questions/24201260/autotools-cross-compilation-and-generated-sources/24208587#24208587 | ||
14 | |||
15 | Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de> | ||
16 | Upstream-Status: Submitted [https://github.com/freeswitch/spandsp/pull/74] | ||
17 | --- | ||
18 | configure.ac | 49 +------------------------------------------- | ||
19 | src/Makefile.am | 54 +++++++++++++++++++++++++------------------------ | ||
20 | 2 files changed, 29 insertions(+), 74 deletions(-) | ||
21 | |||
22 | diff --git a/configure.ac b/configure.ac | ||
23 | index 96fd022..2140837 100644 | ||
24 | --- a/configure.ac | ||
25 | +++ b/configure.ac | ||
26 | @@ -55,54 +55,7 @@ AC_LANG([C]) | ||
27 | |||
28 | AX_COMPILER_VENDOR | ||
29 | |||
30 | -if test "${build}" != "${host}" | ||
31 | -then | ||
32 | - # If we are doing a Canadian Cross, in which the host and build systems | ||
33 | - # are not the same, we set reasonable default values for the tools. | ||
34 | - | ||
35 | - CC_FOR_BUILD=${CC_FOR_BUILD-gcc} | ||
36 | - CPPFLAGS_FOR_BUILD="\$(CPPFLAGS)" | ||
37 | - CC=${CC-${host_alias}-gcc} | ||
38 | - CFLAGS=${CFLAGS-"-g -O2"} | ||
39 | - CXX=${CXX-${host_alias}-c++} | ||
40 | - CXXFLAGS=${CXXFLAGS-"-g -O2"} | ||
41 | -else | ||
42 | - # Set reasonable default values for some tools even if not Canadian. | ||
43 | - # Of course, these are different reasonable default values, originally | ||
44 | - # specified directly in the Makefile. | ||
45 | - # We don't export, so that autoconf can do its job. | ||
46 | - # Note that all these settings are above the fragment inclusion point | ||
47 | - # in Makefile.in, so can still be overridden by fragments. | ||
48 | - # This is all going to change when we autoconfiscate... | ||
49 | - CC_FOR_BUILD="\$(CC)" | ||
50 | - CPPFLAGS_FOR_BUILD="\$(CPPFLAGS)" | ||
51 | - AC_PROG_CC | ||
52 | - | ||
53 | - # We must set the default linker to the linker used by gcc for the correct | ||
54 | - # operation of libtool. If LD is not defined and we are using gcc, try to | ||
55 | - # set the LD default to the ld used by gcc. | ||
56 | - if test -z "$LD" | ||
57 | - then | ||
58 | - if test "$GCC" = yes | ||
59 | - then | ||
60 | - case $build in | ||
61 | - *-*-mingw*) | ||
62 | - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; | ||
63 | - *) | ||
64 | - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; | ||
65 | - esac | ||
66 | - case $gcc_prog_ld in | ||
67 | - # Accept absolute paths. | ||
68 | - [[\\/]* | [A-Za-z]:[\\/]*)] | ||
69 | - LD="$gcc_prog_ld" ;; | ||
70 | - esac | ||
71 | - fi | ||
72 | - fi | ||
73 | - | ||
74 | - CXX=${CXX-"c++"} | ||
75 | - CFLAGS=${CFLAGS-"-g -O2"} | ||
76 | - CXXFLAGS=${CXXFLAGS-"-g -O2"} | ||
77 | -fi | ||
78 | +AX_PROG_CC_FOR_BUILD | ||
79 | |||
80 | AC_DEFUN([REMOVE_FROM_VAR],[ | ||
81 | new_val="" | ||
82 | diff --git a/src/Makefile.am b/src/Makefile.am | ||
83 | index e05fad5..9b409a1 100644 | ||
84 | --- a/src/Makefile.am | ||
85 | +++ b/src/Makefile.am | ||
86 | @@ -386,44 +386,46 @@ noinst_HEADERS = cielab_luts.h \ | ||
87 | v34_tx_pre_emphasis_filters.h \ | ||
88 | v34_tables.h | ||
89 | |||
90 | -make_at_dictionary$(EXEEXT): $(top_srcdir)/src/make_at_dictionary.c | ||
91 | - $(CC_FOR_BUILD) -o make_at_dictionary$(EXEEXT) $(top_srcdir)/src/make_at_dictionary.c -DHAVE_CONFIG_H -I$(top_builddir)/src | ||
92 | +LINK_FOR_BUILD.c = $(CC_FOR_BUILD) -DHAVE_CONFIG_H -I$(top_builddir)/src $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(TARGET_ARCH_FOR_BUILD) | ||
93 | |||
94 | -make_cielab_luts$(EXEEXT): $(top_srcdir)/src/make_cielab_luts.c | ||
95 | - $(CC_FOR_BUILD) -o make_cielab_luts$(EXEEXT) $(top_srcdir)/src/make_cielab_luts.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm | ||
96 | +make_at_dictionary$(BUILD_EXEEXT): $(top_srcdir)/src/make_at_dictionary.c | ||
97 | + $(LINK_FOR_BUILD.c) -o $@ $^ | ||
98 | |||
99 | -make_math_fixed_tables$(EXEEXT): $(top_srcdir)/src/make_math_fixed_tables.c | ||
100 | - $(CC_FOR_BUILD) -o make_math_fixed_tables$(EXEEXT) $(top_srcdir)/src/make_math_fixed_tables.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm | ||
101 | +make_cielab_luts$(BUILD_EXEEXT): $(top_srcdir)/src/make_cielab_luts.c | ||
102 | + $(LINK_FOR_BUILD.c) -o $@ $^ -lm | ||
103 | |||
104 | -make_modem_filter$(EXEEXT): $(top_srcdir)/src/make_modem_filter.c $(top_srcdir)/src/filter_tools.c | ||
105 | - $(CC_FOR_BUILD) -o make_modem_filter$(EXEEXT) $(top_srcdir)/src/make_modem_filter.c $(top_srcdir)/src/filter_tools.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm | ||
106 | +make_math_fixed_tables$(BUILD_EXEEXT): $(top_srcdir)/src/make_math_fixed_tables.c | ||
107 | + $(LINK_FOR_BUILD.c) -o $@ $^ -lm | ||
108 | |||
109 | -make_modem_godard_coefficients$(EXEEXT): $(top_srcdir)/src/make_modem_godard_coefficients.c $(top_srcdir)/src/filter_tools.c | ||
110 | - $(CC_FOR_BUILD) -o make_modem_godard_coefficients$(EXEEXT) $(top_srcdir)/src/make_modem_godard_coefficients.c $(top_srcdir)/src/filter_tools.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm | ||
111 | +make_modem_filter$(BUILD_EXEEXT): $(top_srcdir)/src/make_modem_filter.c $(top_srcdir)/src/filter_tools.c | ||
112 | + $(LINK_FOR_BUILD.c) -o $@ $^ -lm | ||
113 | |||
114 | -make_t43_gray_code_tables$(EXEEXT): $(top_srcdir)/src/make_t43_gray_code_tables.c | ||
115 | - $(CC_FOR_BUILD) -o make_t43_gray_code_tables$(EXEEXT) $(top_srcdir)/src/make_t43_gray_code_tables.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm | ||
116 | +make_modem_godard_coefficients$(BUILD_EXEEXT): $(top_srcdir)/src/make_modem_godard_coefficients.c $(top_srcdir)/src/filter_tools.c | ||
117 | + $(LINK_FOR_BUILD.c) -o $@ $^ -lm | ||
118 | |||
119 | -make_v17_v32_constellation_map$(EXEEXT): $(top_srcdir)/src/make_v17_v32_constellation_map.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c | ||
120 | - $(CC_FOR_BUILD) -o make_v17_v32_constellation_map$(EXEEXT) $(top_srcdir)/src/make_v17_v32_constellation_map.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm | ||
121 | +make_t43_gray_code_tables$(BUILD_EXEEXT): $(top_srcdir)/src/make_t43_gray_code_tables.c | ||
122 | + $(LINK_FOR_BUILD.c) -o $@ $^ -lm | ||
123 | |||
124 | -make_v17_v32_convolutional_encoder$(EXEEXT): $(top_srcdir)/src/make_v17_v32_convolutional_encoder.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c | ||
125 | - $(CC_FOR_BUILD) -o make_v17_v32_convolutional_encoder$(EXEEXT) $(top_srcdir)/src/make_v17_v32_convolutional_encoder.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm | ||
126 | +make_v17_v32_constellation_map$(BUILD_EXEEXT): $(top_srcdir)/src/make_v17_v32_constellation_map.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c | ||
127 | + $(LINK_FOR_BUILD.c) -o $@ $^ -lm | ||
128 | |||
129 | -make_v29_constellation_map$(EXEEXT): $(top_srcdir)/src/make_v29_constellation_map.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c | ||
130 | - $(CC_FOR_BUILD) -o make_v29_constellation_map$(EXEEXT) $(top_srcdir)/src/make_v29_constellation_map.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm | ||
131 | +make_v17_v32_convolutional_encoder$(BUILD_EXEEXT): $(top_srcdir)/src/make_v17_v32_convolutional_encoder.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c | ||
132 | + $(LINK_FOR_BUILD.c) -o $@ $^ -lm | ||
133 | |||
134 | -make_v34_convolutional_coders$(EXEEXT): $(top_srcdir)/src/make_v34_convolutional_coders.c | ||
135 | - $(CC_FOR_BUILD) -o make_v34_convolutional_coders$(EXEEXT) $(top_srcdir)/src/make_v34_convolutional_coders.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm | ||
136 | +make_v29_constellation_map$(BUILD_EXEEXT): $(top_srcdir)/src/make_v29_constellation_map.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c | ||
137 | + $(LINK_FOR_BUILD.c) -o $@ $^ -lm | ||
138 | |||
139 | -make_v34_probe_signals$(EXEEXT): $(top_srcdir)/src/make_v34_probe_signals.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c | ||
140 | - $(CC_FOR_BUILD) -o make_v34_probe_signals$(EXEEXT) $(top_srcdir)/src/make_v34_probe_signals.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm | ||
141 | +make_v34_convolutional_coders$(BUILD_EXEEXT): $(top_srcdir)/src/make_v34_convolutional_coders.c | ||
142 | + $(LINK_FOR_BUILD.c) -o $@ $^ -lm | ||
143 | |||
144 | -make_v34_shell_map$(EXEEXT): $(top_srcdir)/src/make_v34_shell_map.c | ||
145 | - $(CC_FOR_BUILD) -o make_v34_shell_map$(EXEEXT) $(top_srcdir)/src/make_v34_shell_map.c -DHAVE_CONFIG_H -I$(top_builddir)/src | ||
146 | +make_v34_probe_signals$(BUILD_EXEEXT): $(top_srcdir)/src/make_v34_probe_signals.c $(top_srcdir)/src/g711.c $(top_srcdir)/src/alloc.c | ||
147 | + $(LINK_FOR_BUILD.c) -o $@ $^ -I$(top_srcdir)/src -lm | ||
148 | |||
149 | -make_v34_tx_pre_emphasis_filters$(EXEEXT): $(top_srcdir)/src/make_v34_tx_pre_emphasis_filters.c $(top_srcdir)/tools/meteor-engine.c | ||
150 | - $(CC_FOR_BUILD) -o make_v34_tx_pre_emphasis_filters$(EXEEXT) $(top_srcdir)/src/make_v34_tx_pre_emphasis_filters.c $(top_srcdir)/tools/meteor-engine.c -DHAVE_CONFIG_H -I$(top_builddir)/src -I$(top_builddir)/tools -lm | ||
151 | +make_v34_shell_map$(BUILD_EXEEXT): $(top_srcdir)/src/make_v34_shell_map.c | ||
152 | + $(LINK_FOR_BUILD.c) -o $@ $^ | ||
153 | + | ||
154 | +make_v34_tx_pre_emphasis_filters$(BUILD_EXEEXT): $(top_srcdir)/src/make_v34_tx_pre_emphasis_filters.c $(top_srcdir)/tools/meteor-engine.c | ||
155 | + $(LINK_FOR_BUILD.c) -o $@ $^ -I$(top_srcdir)/tools -lm | ||
156 | |||
157 | # We need to run make_at_dictionary, so it generates the | ||
158 | # at_interpreter_dictionary.h file | ||
159 | -- | ||
160 | 2.34.1 | ||
161 | |||
diff --git a/meta-multimedia/recipes-multimedia/spandsp/spandsp_git.bb b/meta-multimedia/recipes-multimedia/spandsp/spandsp_git.bb new file mode 100644 index 0000000000..f115553fd1 --- /dev/null +++ b/meta-multimedia/recipes-multimedia/spandsp/spandsp_git.bb | |||
@@ -0,0 +1,50 @@ | |||
1 | SUMMARY = "A DSP library for telephony" | ||
2 | DESCRIPTION = "\ | ||
3 | SpanDSP is a low-level signal processing library that modulates and \ | ||
4 | demodulates signals commonly used in telephony, such as the \"noise\" \ | ||
5 | generated by a fax modem or DTMF touchpad. \ | ||
6 | " | ||
7 | HOMEPAGE = "https://www.soft-switch.org/" | ||
8 | BUGTRACKER = "https://github.com/freeswitch/spandsp/issues" | ||
9 | SECTION = "libs" | ||
10 | LICENSE = "LGPL-2.1-only" | ||
11 | LIC_FILES_CHKSUM = "file://COPYING;md5=8791c23ddf418deb5be264cffb5fa6bc" | ||
12 | |||
13 | DEPENDS = "\ | ||
14 | libxml2 \ | ||
15 | tiff \ | ||
16 | tiff-native \ | ||
17 | " | ||
18 | |||
19 | PV = "3.0.0+git" | ||
20 | |||
21 | SRC_URI = "\ | ||
22 | git://github.com/freeswitch/spandsp.git;protocol=https;branch=master \ | ||
23 | file://configure.patch \ | ||
24 | file://makefile.patch \ | ||
25 | " | ||
26 | # Fails to build with Clang since 5394b2cae6c482ccb835335b769469977e6802ae | ||
27 | # https://github.com/freeswitch/spandsp/issues/67 | ||
28 | # https://lists.openembedded.org/g/openembedded-devel/message/109325 | ||
29 | SRCREV = "df1282eb9af538ab1aadb6d66146e258451d4fe4" | ||
30 | |||
31 | S = "${WORKDIR}/git" | ||
32 | |||
33 | inherit autotools | ||
34 | |||
35 | PACKAGECONFIG ?= "" | ||
36 | |||
37 | PACKAGECONFIG[mmx] = "--enable-mmx,--disable-mmx" | ||
38 | PACKAGECONFIG[sse] = "--enable-sse,--disable-sse" | ||
39 | PACKAGECONFIG[sse2] = "--enable-sse2,--disable-sse2" | ||
40 | PACKAGECONFIG[sse3] = "--enable-sse3,--disable-sse3" | ||
41 | PACKAGECONFIG[ssse3] = "--enable-ssse3,--disable-ssse3" | ||
42 | PACKAGECONFIG[sse4-1] = "--enable-sse4-1,--disable-sse4-1" | ||
43 | PACKAGECONFIG[sse4-2] = "--enable-sse4-2,--disable-sse4-2" | ||
44 | PACKAGECONFIG[avx] = "--enable-avx,--disable-avx" | ||
45 | PACKAGECONFIG[avx2] = "--enable-avx2,--disable-avx2" | ||
46 | PACKAGECONFIG[neon] = "--enable-neon,--disable-neon" | ||
47 | PACKAGECONFIG[fixed-point] = "--enable-fixed-point,--disable-fixed-point" | ||
48 | PACKAGECONFIG[v32bis] = "--enable-v32bis,--disable-v32bis" | ||
49 | PACKAGECONFIG[v34] = "--enable-v34,--disable-v34" | ||
50 | PACKAGECONFIG[sslfax] = "--enable-sslfax,--disable-sslfax" | ||