0002-configure-fix-detection-of-fltk-libs.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From c154195fa161575363280aac9e928b7225f0de9e Mon Sep 17 00:00:00 2001
  2. From: "Yann E. MORIN" <yann.morin.1998@free.fr>
  3. Date: Sun, 29 Dec 2019 17:42:13 +0100
  4. Subject: [PATCH] configure: fix detection of fltk libs
  5. Chaining calls to AC_CHECK_LIB one in the other, breaks the configure
  6. script, because some internal functions (e.g. ac_fn_c_try_link) would
  7. not be defined before they are needed, leading the build to fail as
  8. thus:
  9. checking for snd_tplg_new in -latopology... ./configure: line 4630:
  10. ac_fn_c_try_link: command not found
  11. no
  12. configure: error: No linkable libatopology was found.
  13. Using AC_CHECK_LIB() in sequence (i.e. one after the other) and
  14. memorising the result is not trivial: AC_CHECK_LIB() implements a
  15. ddefault action-if-found that append to LIBS, but not if the user
  16. ptrovides their own action-if-found.
  17. Instead, AC_SEARH_LIBS() always append to LIBS, *and* run the
  18. user-provided action.
  19. So, we switch to AC_SEARCH_LIBS() and memorise the result for each
  20. test, to eventually test if ether worked.
  21. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
  22. ---
  23. configure.in | 8 ++++----
  24. 1 file changed, 4 insertions(+), 4 deletions(-)
  25. diff --git a/configure.in b/configure.in
  26. index 9307cc2..55f6864 100644
  27. --- a/configure.in
  28. +++ b/configure.in
  29. @@ -11,10 +11,10 @@ AC_PROG_INSTALL
  30. AC_PROG_LN_S
  31. dnl Checks for libraries.
  32. -AC_CHECK_LIB(fltk,numericsort,,
  33. -AC_CHECK_LIB(fltk,fl_numericsort,,
  34. -AC_MSG_ERROR("missing fltk"))
  35. -)
  36. +has_fltk=false
  37. +AC_SEARCH_LIBS(numericsort,fltk,has_fltk=true)
  38. +AC_SEARCH_LIBS(fl_numericsort,fltk,has_fltk=true)
  39. +AS_IF(test "${has_fltk}" = "false", AC_MSG_ERROR("missing fltk"))
  40. AM_PATH_ALSA(0.9.0)
  41. dnl Checks for header files.
  42. --
  43. 2.20.1