1From 0e74339bf0751932abf6aa49bf07aa1c035f9ec6 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Sun, 14 Aug 2022 20:31:30 +0200
4Subject: [PATCH] configure.ac: fix build without dlfcn.h
5
6Fix the following static build failure (i.e. without dlfcn.h) raised
7since version 1.2.7 and
8https://github.com/alsa-project/alsa-utils/commit/44d3e8aa44fc12f95bfeef0e3a1051e8f77047b5:
9
10pre-processor.c:28:10: fatal error: dlfcn.h: No such file or directory
11   28 | #include <dlfcn.h>
12      |          ^~~~~~~~~
13
14Fixes:
15 - http://autobuild.buildroot.org/results/1173a1ee28a58ce565a3274f35e868c35bb2e04e
16
17Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
18[Upstream status: https://github.com/alsa-project/alsa-utils/pull/165]
19---
20 configure.ac | 5 ++++-
21 1 file changed, 4 insertions(+), 1 deletion(-)
22
23diff --git a/configure.ac b/configure.ac
24index 20cbb68..6833800 100644
25--- a/configure.ac
26+++ b/configure.ac
27@@ -27,6 +27,9 @@ AC_CHECK_FUNC([snd_ctl_elem_add_enumerated],
28 	      , [AC_ERROR([No user enum control support in alsa-lib])])
29 fi
30
31+
32+AC_CHECK_HEADERS([dlfcn.h])
33+
34 dnl Check components
35 AC_CHECK_HEADERS([alsa/pcm.h], [have_pcm="yes"], [have_pcm="no"],
36   [#include <alsa/asoundlib.h>])
37@@ -74,7 +77,7 @@ AM_CONDITIONAL(HAVE_MIXER, test "$have_mixer" = "yes")
38 AM_CONDITIONAL(HAVE_RAWMIDI, test "$have_rawmidi" = "yes")
39 AM_CONDITIONAL(HAVE_SEQ, test "$have_seq" = "yes")
40 AM_CONDITIONAL(HAVE_UCM, test "$have_ucm" = "yes")
41-AM_CONDITIONAL(HAVE_TOPOLOGY, test "$have_topology" = "yes")
42+AM_CONDITIONAL(HAVE_TOPOLOGY, test "$have_topology" = "yes" -a "$ac_cv_header_dlfcn_h" = "yes")
43 AM_CONDITIONAL(HAVE_SAMPLERATE, test "$have_samplerate" = "yes")
44 AM_CONDITIONAL(HAVE_FFADO, test "$have_ffado" = "yes")
45
46--
472.35.1
48
49