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" <yann.morin.1998@free.fr>
This commit is contained in:
Yann E. MORIN
2014-11-29 17:23:37 +01:00
parent 2a430ec434
commit e5a74a3ff0
+4 -1
View File
@@ -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