From f40757781ffca285053ef2fa8ea9e0971fd65678 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Mon, 22 Jul 2024 15:17:50 +0200 Subject: [PATCH] package/pkg-meson: support building both libraries 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 Signed-off-by: Thomas Petazzoni --- 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 \