kumquat-buildroot/package/shairport-sync/0003-fix-static-link-popt.patch
Yann E. MORIN ac1ac9e628 package/shairport-sync: fix static builds
Because shairport-sync uses AC_CHECK_LIB to find some of the needed
libraries (opensl, alsa, popt...), it fails to bring in the dependencies
of those libraries; for example, -lssl requires -lz.

When doing a dynamically-linked build, those dependent libraries are
pulled in thanks to the DT_NEEDED ELF tags, but those are not available
in static libraries.

Use PKG_CHECK_MODULES instead of AC_CHECK_LIB, and emulate the results
of AC_CJECK_LIB (i.e. set the HAVE_LIBxxx and the LIBS variable
appropriately) to minimise the amount of code touched.

This should fix:
    http://autobuild.buildroot.net/results/1a5/1a56dbff3583bed0d693508dfc16859086846ecd/
    http://autobuild.buildroot.net/results/6d5/6d5a8157592f7a2c9469bf71b0453796ef982ab1/

At the same time, remove a comment at the end of a variable assignment,
since this has proven to cause some problems.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jörg Krause <jkrause@posteo.de>
Cc: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-11-30 23:59:24 +01:00

26 lines
1.1 KiB
Diff

configure: fix static link with popt
Use pkg-config to find the popt library.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Patch applied upstream:
https://github.com/mikebrady/shairport-sync/commit/1f759e57e8c0682613eaaf89a46fdf6db4c6b5cd
diff -durN shairport-sync-2.1.8.orig/configure.ac shairport-sync-2.1.8/configure.ac
--- shairport-sync-2.1.8.orig/configure.ac 2014-11-29 14:14:36.655955733 +0100
+++ shairport-sync-2.1.8/configure.ac 2014-11-29 14:16:21.072719327 +0100
@@ -31,7 +31,10 @@
AC_CHECK_LIB([daemon],[daemon_log], , AC_MSG_ERROR(libdaemon needed))
AC_CHECK_LIB([pthread],[pthread_create], , AC_MSG_ERROR(pthread library needed))
AC_CHECK_LIB([m],[exp], , AC_MSG_ERROR(maths library needed))
-AC_CHECK_LIB([popt],[poptGetContext], , AC_MSG_ERROR(libpopt needed))
+PKG_CHECK_MODULES(
+ [POPT], [popt],
+ [LIBS="${POPT_LIBS} ${LIBS}"
+ AC_DEFINE([HAVE_LIBPOPT],[1],[Define to 1 if you have popt])])
# Look for piddir flag
AC_ARG_WITH(piddir, [ --with-piddir=<pathname> Specify a pathname to a directory in which to write the PID file.], [