board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / alsa-lib / 0004-conditional-enabling-of-libdl-in-m4.patch
blobc533419baa2951225954feb08f08470adc96df84
1 alsa-lib: conditionally enable libdl in AM_PATH_ALSA m4 macro
3 The AM_PATH_ALSA macro in utils/alsa.m4 unconditionally uses -ldl. This
4 breaks compilation of alsa-utils (and probably other packages using this
5 macro) for targets that do not support dynamic loading, such as for
6 Blackfin FLAT binaries.
8 This patch updates the macro to check if dlopen is available, and use that
9 result to conditionally add -ldl to the list of libraries.
11 Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
13 ---
15 diff --git a/utils/alsa.m4 b/utils/alsa.m4
16 --- a/utils/alsa.m4
17 +++ b/utils/alsa.m4
18 @@ -44,6 +44,8 @@ if test "$alsa_inc_prefix" != "" ; then
20 AC_MSG_RESULT($ALSA_CFLAGS)
22 +AC_CHECK_LIB(c, dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")])
24 dnl add any special lib dirs
25 AC_MSG_CHECKING(for ALSA LDFLAGS)
26 if test "$alsa_prefix" != "" ; then
27 @@ -52,7 +54,7 @@ if test "$alsa_prefix" != "" ; then
30 dnl add the alsa library
31 -ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
32 +ALSA_LIBS="$ALSA_LIBS -lasound -lm $LIBDL -lpthread"
33 LIBS="$ALSA_LIBS $LIBS"
34 AC_MSG_RESULT($ALSA_LIBS)