Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/pkg-meson: support building both libraries
@ 2024-07-22 13:17 Fabrice Fontaine
  2024-07-22 16:23 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2024-07-22 13:17 UTC (permalink / raw)
  To: buildroot; +Cc: Eric Le Bihan, Fabrice Fontaine

meson supports building both libraries (i.e. static and shared).
This will avoid the following build failure with flashrom and
BR2_SHARED_STATIC_LIBS raised since bump to version 1.4.0-rc2 in commit
8637884057ddc3c1aeb9f0dd285fc6fcf378c26b:

../output-1/build/flashrom-1.4.0-rc2/meson.build:18:2: ERROR: Problem encountered:
    Cannot build cli_classic with shared libflashrom. Use \'-Dclassic_cli=disabled\' to disable the cli,
    or use \'--default-library=both\' to also build the classic_cli

Fixes: 8637884057ddc3c1aeb9f0dd285fc6fcf378c26b
 - http://autobuild.buildroot.org/results/6d484857ff1674bf81986505827e54f3f1b9aaec

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/pkg-meson.mk | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 65cabf23ba..bc805b799c 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -82,6 +82,14 @@ else
 PKG_MESON_TARGET_FC = /bin/false
 endif
 
+ifeq ($(BR2_STATIC_LIBS),y)
+PKG_MESON_DEFAULT_LIBRARY=static
+else ifeq ($(BR2_SHARED_LIBS),y)
+PKG_MESON_DEFAULT_LIBRARY=shared
+else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
+PKG_MESON_DEFAULT_LIBRARY=both
+endif
+
 # Generates sed patterns for patching the cross-compilation.conf template,
 # since Flags might contain commas the arguments are passed indirectly by
 # variable name (stripped to deal with whitespaces).
@@ -152,7 +160,7 @@ define $(2)_CONFIGURE_CMDS
 	$$(MESON) setup \
 		--prefix=/usr \
 		--libdir=lib \
-		--default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
+		--default-library=$(PKG_MESON_DEFAULT_LIBRARY) \
 		--buildtype=$(if $(BR2_ENABLE_RUNTIME_DEBUG),debug,release) \
 		--cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
 		-Db_pie=false \
-- 
2.43.0

_______________________________________________
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/pkg-meson: support building both libraries
  2024-07-22 13:17 [Buildroot] [PATCH 1/1] package/pkg-meson: support building both libraries Fabrice Fontaine
@ 2024-07-22 16:23 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-22 16:23 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Eric Le Bihan, buildroot

On Mon, 22 Jul 2024 15:17:50 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> meson supports building both libraries (i.e. static and shared).
> This will avoid the following build failure with flashrom and
> BR2_SHARED_STATIC_LIBS raised since bump to version 1.4.0-rc2 in commit
> 8637884057ddc3c1aeb9f0dd285fc6fcf378c26b:
> 
> ../output-1/build/flashrom-1.4.0-rc2/meson.build:18:2: ERROR: Problem encountered:
>     Cannot build cli_classic with shared libflashrom. Use \'-Dclassic_cli=disabled\' to disable the cli,
>     or use \'--default-library=both\' to also build the classic_cli
> 
> Fixes: 8637884057ddc3c1aeb9f0dd285fc6fcf378c26b
>  - http://autobuild.buildroot.org/results/6d484857ff1674bf81986505827e54f3f1b9aaec
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/pkg-meson.mk | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)

Applied to master, thanks. I'm guessing this could cause a bit of
breakage, but let's see how much :-)

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

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

end of thread, other threads:[~2024-07-22 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-22 13:17 [Buildroot] [PATCH 1/1] package/pkg-meson: support building both libraries Fabrice Fontaine
2024-07-22 16:23 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox