All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/alsa-utils: needs dynamic library
@ 2022-08-12 13:21 Fabrice Fontaine
  2022-08-14 10:27 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2022-08-12 13:21 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, Fabrice Fontaine

alsa-utils 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>
---
 package/alsa-utils/Config.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/package/alsa-utils/Config.in b/package/alsa-utils/Config.in
index 2d7062b0ca..14c78bee9d 100644
--- a/package/alsa-utils/Config.in
+++ b/package/alsa-utils/Config.in
@@ -1,11 +1,12 @@
-comment "alsa-utils needs a toolchain w/ threads"
+comment "alsa-utils needs a toolchain w/ threads, dynamic library"
 	depends on BR2_USE_MMU # fork
-	depends on !BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
 
 menuconfig BR2_PACKAGE_ALSA_UTILS
 	bool "alsa-utils"
 	depends on BR2_USE_MMU # fork
 	depends on BR2_TOOLCHAIN_HAS_THREADS # alsa-lib
+	depends on !BR2_STATIC_LIBS # dlfcn.h
 	select BR2_PACKAGE_ALSA_LIB
 	help
 	  This package contains the command line utilities for the ALSA
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/alsa-utils: needs dynamic library
  2022-08-12 13:21 [Buildroot] [PATCH 1/1] package/alsa-utils: needs dynamic library Fabrice Fontaine
@ 2022-08-14 10:27 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-14 10:27 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Bernd Kuhls, buildroot

Hello Fabrice,

On Fri, 12 Aug 2022 15:21:44 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> alsa-utils 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>

I think alsa-utils could potentially be useful even in small systems
that require static linking, so it's perhaps worth implementing a
slightly better solution.

<dlfcn.h> is only used in topology/, i.e. when configure.ac detects
that topology.h is installed by alsa-lib. What about adding an
AC_CHECK_HEADERS([dlfcn.h]) ?

Something like this:

diff --git a/configure.ac b/configure.ac
index 20cbb68..c1592b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,8 @@ 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 +76,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")
 

Of course, we would need BR2_PACKAGE_ALSA_UTILS_ALSATPLG to have a
dependency on !BR2_STATIC_LIBS.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-14 10:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-12 13:21 [Buildroot] [PATCH 1/1] package/alsa-utils: needs dynamic library Fabrice Fontaine
2022-08-14 10:27 ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.