0001-Fix-pkg-config-for-static-linking.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From 2abf7d2e5c533bf4d7407c2c8057a329cd49a3cd Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
  3. Date: Tue, 24 Nov 2015 21:57:27 +0100
  4. Subject: [PATCH 1/1] Fix pkg-config for static linking
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Static linking userspace programs such as MPD against libaudiofile fails if
  9. FLAC is available, because libaudiofile is linked against FLAC, but this isn't
  10. expressed in the pkg-config file:
  11. [..]
  12. arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libaudiofile.a(FLAC.o): In function `FLACDecoder::reset2()':
  13. FLAC.cpp:(.text+0x58): undefined reference to `FLAC__stream_decoder_seek_absolute'
  14. /home/buildroot/build/instance-1/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libaudiofile.a(FLAC.o): In function `FLACEncoder::sync2()':
  15. FLAC.cpp:(.text+0x88): undefined reference to `FLAC__stream_encoder_finish'
  16. /home/buildroot/build/instance-1/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libaudiofile.a(FLAC.o): In function `FLACDecoder::~FLACDecoder()':
  17. FLAC.cpp:(.text+0xc4): undefined reference to `FLAC__stream_decoder_delete'
  18. /home/buildroot/build/instance-1/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libaudiofile.a(FLAC.o): In function `FLACEncoder::~FLACEncoder()':
  19. FLAC.cpp:(.text+0x164): undefined reference to `FLAC__stream_encoder_delete'
  20. /home/buildroot/build/instance-1/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libaudiofile.a(FLAC.o): In function `FLACDecoder::runPull()':
  21. [..]
  22. The Libs.private field is specifically designed for such usage:
  23. From pkg-config documentation:
  24. Libs.private:
  25. This line should list any private libraries in use. Private
  26. libraries are libraries which are not exposed through your
  27. library, but are needed in the case of static linking.
  28. Therefore, this patch adds a reference to FLAC as well as to lcov in the
  29. Libs.private field of the pkg-config file.
  30. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
  31. ---
  32. audiofile.pc.in | 2 +-
  33. 1 file changed, 1 insertion(+), 1 deletion(-)
  34. diff --git a/audiofile.pc.in b/audiofile.pc.in
  35. index ad5956a..d6055ef 100644
  36. --- a/audiofile.pc.in
  37. +++ b/audiofile.pc.in
  38. @@ -8,5 +8,5 @@ Description: audiofile
  39. Requires:
  40. Version: @VERSION@
  41. Libs: -L${libdir} -laudiofile
  42. -Libs.private: -lm
  43. +Libs.private: @FLAC_LIBS@ @COVERAGE_LIBS@ -lm
  44. Cflags: -I${includedir}
  45. --
  46. 2.6.2