0002-alsa-lib-conditionally-enable-libdl-in-AM_PATH_ALSA-.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From 2aba563bd077fda94fb9c2c33002ee0ac119b345 Mon Sep 17 00:00:00 2001
  2. From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
  3. Date: Fri, 13 Apr 2018 09:13:46 +0200
  4. Subject: [PATCH] alsa-lib: conditionally enable libdl in AM_PATH_ALSA m4 macro
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. The AM_PATH_ALSA macro in utils/alsa.m4 unconditionally uses -ldl. This
  9. breaks compilation of alsa-utils (and probably other packages using this
  10. macro) for targets that do not support dynamic loading, such as for
  11. Blackfin FLAT binaries.
  12. This patch updates the macro to check if dlopen is available, and use that
  13. result to conditionally add -ldl to the list of libraries.
  14. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
  15. [Jörg: update for 1.1.6]
  16. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
  17. Upstream: http://mailman.alsa-project.org/pipermail/alsa-devel/2018-November/141377.html
  18. ---
  19. utils/alsa.m4 | 4 +++-
  20. 1 file changed, 3 insertions(+), 1 deletion(-)
  21. diff --git a/utils/alsa.m4 b/utils/alsa.m4
  22. index e12310df..a5c5a292 100644
  23. --- a/utils/alsa.m4
  24. +++ b/utils/alsa.m4
  25. @@ -44,6 +44,8 @@ if test "$alsa_inc_prefix" != "" ; then
  26. fi
  27. AC_MSG_RESULT($ALSA_CFLAGS)
  28. +AC_CHECK_LIB(c, dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")])
  29. +
  30. dnl add any special lib dirs
  31. AC_MSG_CHECKING(for ALSA LDFLAGS)
  32. if test "$alsa_prefix" != "" ; then
  33. @@ -52,7 +54,7 @@ if test "$alsa_prefix" != "" ; then
  34. fi
  35. dnl add the alsa library
  36. -ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
  37. +ALSA_LIBS="$ALSA_LIBS -lasound -lm $LIBDL -lpthread"
  38. LIBS="$ALSA_LIBS $LIBS"
  39. AC_MSG_RESULT($ALSA_LIBS)
  40. --
  41. 2.14.3