summaryrefslogtreecommitdiffstats
path: root/meta-multimedia
diff options
context:
space:
mode:
authorJörg Sommer <joerg.sommer@navimatix.de>2024-03-16 09:23:07 +0100
committerKhem Raj <raj.khem@gmail.com>2024-03-17 13:10:11 -0700
commit6a2b29e98d77de46a2885eff15bc8e4bc42e9396 (patch)
tree9c0c7bd1904f209b619daa9def29fc7924adc6d3 /meta-multimedia
parent538b03a3ffaf25c3bfcde076ae6a81ca05b3c166 (diff)
downloadmeta-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')
-rw-r--r--meta-multimedia/recipes-multimedia/spandsp/spandsp/configure.patch56
-rw-r--r--meta-multimedia/recipes-multimedia/spandsp/spandsp/makefile.patch161
-rw-r--r--meta-multimedia/recipes-multimedia/spandsp/spandsp_git.bb50
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 000000000..af504be76
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/spandsp/spandsp/configure.patch
@@ -0,0 +1,56 @@
1From: =?UTF-8?q?J=C3=B6rg=20Sommer?= <joerg.sommer@navimatix.de>
2Date: Thu, 14 Mar 2024 09:41:57 +0100
3Subject: [PATCH 2/2] configure: Replace manual search for libxml by
4 AC_CHECK_LIB
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9The manual search fails if the include directories (and build environment)
10are located somewhere else.
11
12Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
13Upstream-Status: Submitted [https://github.com/freeswitch/spandsp/pull/74]
14---
15
16ERROR: 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
21diff --git a/configure.ac b/configure.ac
22index 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--
552.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 000000000..d3eb047fe
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/spandsp/spandsp/makefile.patch
@@ -0,0 +1,161 @@
1From: =?UTF-8?q?J=C3=B6rg=20Sommer?= <joerg.sommer@navimatix.de>
2Date: Thu, 14 Mar 2024 08:08:13 +0100
3Subject: [PATCH 1/2] configure: Use AX_PROG_CC_FOR_BUILD for cross compiling
4MIME-Version: 1.0
5Content-Type: text/plain; charset=UTF-8
6Content-Transfer-Encoding: 8bit
7
8The 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
10time.
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
15Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
16Upstream-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
22diff --git a/configure.ac b/configure.ac
23index 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=""
82diff --git a/src/Makefile.am b/src/Makefile.am
83index 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--
1602.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 000000000..f115553fd
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/spandsp/spandsp_git.bb
@@ -0,0 +1,50 @@
1SUMMARY = "A DSP library for telephony"
2DESCRIPTION = "\
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"
7HOMEPAGE = "https://www.soft-switch.org/"
8BUGTRACKER = "https://github.com/freeswitch/spandsp/issues"
9SECTION = "libs"
10LICENSE = "LGPL-2.1-only"
11LIC_FILES_CHKSUM = "file://COPYING;md5=8791c23ddf418deb5be264cffb5fa6bc"
12
13DEPENDS = "\
14 libxml2 \
15 tiff \
16 tiff-native \
17"
18
19PV = "3.0.0+git"
20
21SRC_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
29SRCREV = "df1282eb9af538ab1aadb6d66146e258451d4fe4"
30
31S = "${WORKDIR}/git"
32
33inherit autotools
34
35PACKAGECONFIG ?= ""
36
37PACKAGECONFIG[mmx] = "--enable-mmx,--disable-mmx"
38PACKAGECONFIG[sse] = "--enable-sse,--disable-sse"
39PACKAGECONFIG[sse2] = "--enable-sse2,--disable-sse2"
40PACKAGECONFIG[sse3] = "--enable-sse3,--disable-sse3"
41PACKAGECONFIG[ssse3] = "--enable-ssse3,--disable-ssse3"
42PACKAGECONFIG[sse4-1] = "--enable-sse4-1,--disable-sse4-1"
43PACKAGECONFIG[sse4-2] = "--enable-sse4-2,--disable-sse4-2"
44PACKAGECONFIG[avx] = "--enable-avx,--disable-avx"
45PACKAGECONFIG[avx2] = "--enable-avx2,--disable-avx2"
46PACKAGECONFIG[neon] = "--enable-neon,--disable-neon"
47PACKAGECONFIG[fixed-point] = "--enable-fixed-point,--disable-fixed-point"
48PACKAGECONFIG[v32bis] = "--enable-v32bis,--disable-v32bis"
49PACKAGECONFIG[v34] = "--enable-v34,--disable-v34"
50PACKAGECONFIG[sslfax] = "--enable-sslfax,--disable-sslfax"