Răsfoiți Sursa

package/alsa-utils: fix static build

alsatplg needs dynamic library since bump to version 1.2.7 in commit
4dc8563363d639255217ffc59482eaccf93a1b51 and
https://github.com/alsa-project/alsa-utils/commit/44d3e8aa44fc12f95bfeef0e3a1051e8f77047b5:

pre-processor.c:28:10: fatal error: dlfcn.h: No such file or directory
   28 | #include <dlfcn.h>
      |          ^~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/1173a1ee28a58ce565a3274f35e868c35bb2e04e

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Fabrice Fontaine 3 ani în urmă
părinte
comite
085407351d

+ 48 - 0
package/alsa-utils/0003-configure.ac-fix-build-without-dlfcn.h.patch

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

+ 4 - 0
package/alsa-utils/Config.in

@@ -45,6 +45,10 @@ config BR2_PACKAGE_ALSA_UTILS_ALSAUCM
 
 config BR2_PACKAGE_ALSA_UTILS_ALSATPLG
 	bool "alsatplg"
+	depends on !BR2_STATIC_LIBS # dlfcn.h
+
+comment "alsatplg needs a toolchain w/ dynamic library"
+	depends on BR2_STATIC_LIBS
 
 config BR2_PACKAGE_ALSA_UTILS_AMIDI
 	bool "amidi"

+ 3 - 0
package/alsa-utils/alsa-utils.mk

@@ -15,6 +15,9 @@ ALSA_UTILS_DEPENDENCIES = host-pkgconf alsa-lib \
 	$(if $(BR2_PACKAGE_LIBSAMPLERATE),libsamplerate) \
 	$(TARGET_NLS_DEPENDENCIES)
 
+# We're patching configure.ac
+ALSA_UTILS_AUTORECONF = YES
+
 ifeq ($(BR2_PACKAGE_ALSA_UTILS_ALSACTL),y)
 ALSA_UTILS_SELINUX_MODULES += alsa
 endif