From e5a74a3ff08134a2b11f07bd850659d7816fb03d Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sat, 29 Nov 2014 17:23:37 +0100 Subject: [PATCH] configure: fix static link with alsa Use pkg-config to find the alsa library, that will return all the dependent libraries of alsa (e.g. -ldl -lpthread -lrt) as well that can not be deduced in case of a static link. Signed-off-by: "Yann E. MORIN" --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ce8553e5..8a742887 100644 --- a/configure.ac +++ b/configure.ac @@ -99,7 +99,10 @@ AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (GNU/Linux onl HAS_ALSA=1 AM_CONDITIONAL([USE_ALSA], [test 0]) AC_DEFINE([CONFIG_ALSA], 1, [Needed by the compiler.]) - AC_CHECK_LIB([asound], [snd_pcm_open], , AC_MSG_ERROR(ALSA support requires the asound library!))], ) + PKG_CHECK_MODULES( + [ALSA], [alsa], + [LIBS="${ALSA_LIBS} ${LIBS}" + AC_DEFINE([HAVE_LIBASOUND],[1],[Define to 1 if you have ALSA])])]) AM_CONDITIONAL([USE_ALSA], [test "x$HAS_ALSA" = "x1"]) # Look for SNDIO flag