0001-configure.ac-find-sndfile-through-pkg-config.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 900b1827c55cc6020b3242640075174c2e6b12a5 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Wed, 4 Aug 2021 22:16:40 +0200
  4. Subject: [PATCH] configure.ac: find sndfile through pkg-config
  5. Find sndfile through pkg-config to retrieve sndfile dependencies such as
  6. flac and avoid the following static build failure:
  7. /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':
  8. flac.c:(.text+0xfc): undefined reference to `FLAC__StreamDecoderErrorStatusString'
  9. Fixes:
  10. - http://autobuild.buildroot.org/results/92ed30a6855ca11800b779718822bcba4a69c9a3
  11. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  12. [Upstream status: https://github.com/mikebrady/shairport-sync/pull/1263]
  13. ---
  14. configure.ac | 9 ++++++++-
  15. 1 file changed, 8 insertions(+), 1 deletion(-)
  16. diff --git a/configure.ac b/configure.ac
  17. index f77087c5..9b982c51 100644
  18. --- a/configure.ac
  19. +++ b/configure.ac
  20. @@ -304,7 +304,14 @@ AC_ARG_WITH(convolution, [AS_HELP_STRING([--with-convolution],[choose audio DSP
  21. if test "x$with_convolution" = "xyes" ; then
  22. AM_INIT_AUTOMAKE([subdir-objects])
  23. AC_DEFINE([CONFIG_CONVOLUTION], 1, [Include audio DSP convolution support.])
  24. - AC_CHECK_LIB([sndfile], [sf_open], , AC_MSG_ERROR(Convolution support requires the sndfile library -- libsndfile1-dev suggested!))
  25. + if test "x${with_pkg_config}" = xyes ; then
  26. + PKG_CHECK_MODULES(
  27. + [sndfile], [sndfile],
  28. + [CFLAGS="${sndfile_CFLAGS} ${CFLAGS}"
  29. + LIBS="${sndfile_LIBS} ${LIBS}"], AC_MSG_ERROR(Convolution support requires the sndfile library -- libsndfile1-dev suggested!))
  30. + else
  31. + AC_CHECK_LIB([sndfile], [sf_open], , AC_MSG_ERROR(Convolution support requires the sndfile library -- libsndfile1-dev suggested!))
  32. + fi
  33. fi
  34. AM_CONDITIONAL([USE_CONVOLUTION], [test "x$with_convolution" = "xyes"])
  35. --
  36. 2.30.2