1*4882a593SmuzhiyunFrom 06109c84ab6930265287049c4bf9405e7ebc4986 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3*4882a593SmuzhiyunDate: Wed, 4 Aug 2021 10:27:16 +0200
4*4882a593SmuzhiyunSubject: [PATCH] configure.ac: fix static linking with sndfile
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunUse SOX_FMT_PKG to retrieve sndfile dependencies (e.g. flac, opus or
7*4882a593Smuzhiyunvorbis). This will fix the following static build failure:
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunconfigure:14720: checking for sf_open_virtual in -lsndfile
10*4882a593Smuzhiyunconfigure:14745: /tmp/instance-1/output-1/host/bin/xtensa-buildroot-linux-uclibc-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mlongcalls -mauto-litpools -Os -g0  -static -Wall -Wmissing-prototypes -Wstrict-prototypes  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -static -Wl,--as-needed conftest.c -lsndfile    >&5
11*4882a593Smuzhiyunconftest.c:73:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
12*4882a593Smuzhiyun   73 | char sf_open_virtual ();
13*4882a593Smuzhiyun      | ^~~~
14*4882a593Smuzhiyunconftest.c:75:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
15*4882a593Smuzhiyun   75 | main ()
16*4882a593Smuzhiyun      | ^~~~
17*4882a593Smuzhiyun/tmp/instance-1/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: /tmp/instance-1/output-1/host/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libsndfile.a(libsndfile_la-flac.o): in function `flac_byterate':
18*4882a593Smuzhiyunflac.c:(.text+0xfc): undefined reference to `FLAC__StreamDecoderErrorStatusString'
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunFixes:
21*4882a593Smuzhiyun - http://autobuild.buildroot.org/results/4bc58ed68b29642876bb02710d0cd4f31540de86
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunSigned-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
24*4882a593Smuzhiyun[Upstream status: not sent yet (waiting for feedback on third patch)]
25*4882a593Smuzhiyun---
26*4882a593Smuzhiyun configure.ac | 2 +-
27*4882a593Smuzhiyun 1 file changed, 1 insertion(+), 1 deletion(-)
28*4882a593Smuzhiyun
29*4882a593Smuzhiyundiff --git a/configure.ac b/configure.ac
30*4882a593Smuzhiyunindex 8ae3202c..26510769 100644
31*4882a593Smuzhiyun--- a/configure.ac
32*4882a593Smuzhiyun+++ b/configure.ac
33*4882a593Smuzhiyun@@ -117,7 +117,7 @@ SOX_FMT_REQ([mp3], [MAD LAME TWOLAME])
34*4882a593Smuzhiyun SOX_FMT_PKG([oggvorbis], [ogg vorbis vorbisenc vorbisfile])
35*4882a593Smuzhiyun SOX_FMT_PKG([opus], [opusfile])
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun-SOX_DL_LIB([libsndfile], [sndfile.h], [sndfile], [sf_open_virtual])
38*4882a593Smuzhiyun+SOX_FMT_PKG([libsndfile], [sndfile])
39*4882a593Smuzhiyun SOX_FMT_REQ([sndfile], [LIBSNDFILE])
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun SOX_FMT_LIB([wavpack], [wavpack/wavpack.h], [wavpack], [WavpackGetSampleRate])
42*4882a593Smuzhiyun--
43*4882a593Smuzhiyun2.30.2
44*4882a593Smuzhiyun
45