1*4882a593SmuzhiyunFrom 900b1827c55cc6020b3242640075174c2e6b12a5 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3*4882a593SmuzhiyunDate: Wed, 4 Aug 2021 22:16:40 +0200
4*4882a593SmuzhiyunSubject: [PATCH] configure.ac: find sndfile through pkg-config
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunFind sndfile through pkg-config to retrieve sndfile dependencies such as
7*4882a593Smuzhiyunflac and avoid the following static build failure:
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun/tmp/instance-3/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: /tmp/instance-3/output-1/host/bin/../xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libsndfile.a(libsndfile_la-flac.o): in function `flac_byterate':
10*4882a593Smuzhiyunflac.c:(.text+0xfc): undefined reference to `FLAC__StreamDecoderErrorStatusString'
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunFixes:
13*4882a593Smuzhiyun - http://autobuild.buildroot.org/results/92ed30a6855ca11800b779718822bcba4a69c9a3
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunSigned-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
16*4882a593Smuzhiyun[Upstream status: https://github.com/mikebrady/shairport-sync/pull/1263]
17*4882a593Smuzhiyun---
18*4882a593Smuzhiyun configure.ac | 9 ++++++++-
19*4882a593Smuzhiyun 1 file changed, 8 insertions(+), 1 deletion(-)
20*4882a593Smuzhiyun
21*4882a593Smuzhiyundiff --git a/configure.ac b/configure.ac
22*4882a593Smuzhiyunindex f77087c5..9b982c51 100644
23*4882a593Smuzhiyun--- a/configure.ac
24*4882a593Smuzhiyun+++ b/configure.ac
25*4882a593Smuzhiyun@@ -304,7 +304,14 @@ AC_ARG_WITH(convolution, [AS_HELP_STRING([--with-convolution],[choose audio DSP
26*4882a593Smuzhiyun if test "x$with_convolution" = "xyes" ; then
27*4882a593Smuzhiyun   AM_INIT_AUTOMAKE([subdir-objects])
28*4882a593Smuzhiyun   AC_DEFINE([CONFIG_CONVOLUTION], 1, [Include audio DSP convolution support.])
29*4882a593Smuzhiyun-  AC_CHECK_LIB([sndfile], [sf_open], , AC_MSG_ERROR(Convolution support requires the sndfile library -- libsndfile1-dev suggested!))
30*4882a593Smuzhiyun+  if  test "x${with_pkg_config}" = xyes ; then
31*4882a593Smuzhiyun+    PKG_CHECK_MODULES(
32*4882a593Smuzhiyun+      [sndfile], [sndfile],
33*4882a593Smuzhiyun+      [CFLAGS="${sndfile_CFLAGS} ${CFLAGS}"
34*4882a593Smuzhiyun+      LIBS="${sndfile_LIBS} ${LIBS}"], AC_MSG_ERROR(Convolution support requires the sndfile library -- libsndfile1-dev suggested!))
35*4882a593Smuzhiyun+  else
36*4882a593Smuzhiyun+    AC_CHECK_LIB([sndfile], [sf_open], , AC_MSG_ERROR(Convolution support requires the sndfile library -- libsndfile1-dev suggested!))
37*4882a593Smuzhiyun+  fi
38*4882a593Smuzhiyun fi
39*4882a593Smuzhiyun AM_CONDITIONAL([USE_CONVOLUTION], [test "x$with_convolution" = "xyes"])
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun--
42*4882a593Smuzhiyun2.30.2
43*4882a593Smuzhiyun
44