1*4882a593SmuzhiyunFrom c154195fa161575363280aac9e928b7225f0de9e Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: "Yann E. MORIN" <yann.morin.1998@free.fr>
3*4882a593SmuzhiyunDate: Sun, 29 Dec 2019 17:42:13 +0100
4*4882a593SmuzhiyunSubject: [PATCH] configure: fix detection of fltk libs
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunChaining calls to AC_CHECK_LIB one in the other, breaks the configure
7*4882a593Smuzhiyunscript, because some internal functions (e.g. ac_fn_c_try_link) would
8*4882a593Smuzhiyunnot be defined before they are needed, leading the build to fail as
9*4882a593Smuzhiyunthus:
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun    checking for snd_tplg_new in -latopology... ./configure: line 4630:
12*4882a593Smuzhiyun    ac_fn_c_try_link: command not found
13*4882a593Smuzhiyun    no
14*4882a593Smuzhiyun    configure: error: No linkable libatopology was found.
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunUsing AC_CHECK_LIB() in sequence (i.e. one after the other) and
17*4882a593Smuzhiyunmemorising the result is not trivial: AC_CHECK_LIB() implements a
18*4882a593Smuzhiyunddefault action-if-found that append to LIBS, but not if the user
19*4882a593Smuzhiyunptrovides their own action-if-found.
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunInstead, AC_SEARH_LIBS() always append to LIBS, *and* run the
22*4882a593Smuzhiyunuser-provided action.
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunSo, we switch to AC_SEARCH_LIBS() and memorise the result for each
25*4882a593Smuzhiyuntest, to eventually test if ether worked.
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunSigned-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
28*4882a593Smuzhiyun---
29*4882a593Smuzhiyun configure.in | 8 ++++----
30*4882a593Smuzhiyun 1 file changed, 4 insertions(+), 4 deletions(-)
31*4882a593Smuzhiyun
32*4882a593Smuzhiyundiff --git a/configure.in b/configure.in
33*4882a593Smuzhiyunindex 9307cc2..55f6864 100644
34*4882a593Smuzhiyun--- a/configure.in
35*4882a593Smuzhiyun+++ b/configure.in
36*4882a593Smuzhiyun@@ -11,10 +11,10 @@ AC_PROG_INSTALL
37*4882a593Smuzhiyun AC_PROG_LN_S
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun dnl Checks for libraries.
40*4882a593Smuzhiyun-AC_CHECK_LIB(fltk,numericsort,,
41*4882a593Smuzhiyun-AC_CHECK_LIB(fltk,fl_numericsort,,
42*4882a593Smuzhiyun-AC_MSG_ERROR("missing fltk"))
43*4882a593Smuzhiyun-)
44*4882a593Smuzhiyun+has_fltk=false
45*4882a593Smuzhiyun+AC_SEARCH_LIBS(numericsort,fltk,has_fltk=true)
46*4882a593Smuzhiyun+AC_SEARCH_LIBS(fl_numericsort,fltk,has_fltk=true)
47*4882a593Smuzhiyun+AS_IF(test "${has_fltk}" = "false", AC_MSG_ERROR("missing fltk"))
48*4882a593Smuzhiyun AM_PATH_ALSA(0.9.0)
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun dnl Checks for header files.
51*4882a593Smuzhiyun--
52*4882a593Smuzhiyun2.20.1
53*4882a593Smuzhiyun
54