Skip to contentSkip to conversation

package/pkg-meson.mk: fix generation of pkg_config_static prop

PATCH New Norbert Lange 6 participants 12 messages Sep 15, 2020 – Oct 2, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 package/pkg-meson.mk: fix generation of pkg_config_static prop

fixes following in the generated cross-complation.conf file:
pkg_config_static = '$(if $(BR2_STATIC_LIBS),true,false)'

---
v1->v2:
- truly fix the issue, missed one double $

---
 package/pkg-meson.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-meson.mk +1 -1
index c3fe6df5d0..3a34ba703b 100644
@@ -195,7 +195,7 @@ define PKG_MESON_INSTALL_CROSS_CONF
 	    -e "s%@TARGET_CXXFLAGS@%$(call make-sq-comma-list,$(TARGET_CXXFLAGS))@PKG_TARGET_CFLAGS@%g" \
 	    -e 's%@HOST_DIR@%$(HOST_DIR)%g' \
 	    -e 's%@STAGING_DIR@%$(STAGING_DIR)%g' \
-	    -e 's%@STATIC@%$$(if $$(BR2_STATIC_LIBS),true,false)%g' \
+	    -e 's%@STATIC@%$(if $(BR2_STATIC_LIBS),true,false)%g' \
 	    $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
 	    > $(HOST_DIR)/etc/meson/cross-compilation.conf.in
 	sed -e 's%@PKG_TARGET_CFLAGS@%%g' \
Signature · 1 line
2.28.0
#1 lore raw

PATCH v2 2/3 package/meson: use specific BR variables for cross-compilation.conf

dont depend on specific names of compiler tools, but use existing Buildroot variables.

---
 package/meson/cross-compilation.conf.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
package/meson/cross-compilation.conf.in +5 -5
index e9344e2b2f..67c5da8156 100644
@@ -4,11 +4,11 @@
 # - Buildroot's 'target' is Meson's 'host'
 
 [binaries]
-c = '@TARGET_CROSS at gcc'
-cpp = '@TARGET_CROSS at g++'
-ar = '@TARGET_CROSS at ar'
-strip = '@TARGET_CROSS at strip'
-pkgconfig = '@HOST_DIR@/bin/pkgconf'
+c = '@TARGET_CC@'
+cpp = '@TARGET_CXX@'
+ar = '@TARGET_AR@'
+strip = '@TARGET_STRIP@'
+pkgconfig = '@PKG_CONFIG_HOST_BINARY@'
 g-ir-compiler = '@STAGING_DIR@/usr/bin/g-ir-compiler'
 g-ir-scanner = '@STAGING_DIR@/usr/bin/g-ir-scanner'
 
Signature · 1 line
2.28.0
#2 lore raw

PATCH v2 2/3 package/meson: use specific BR variables for cross-compilation.conf

Quoted 18 lines · Norbert Lange

dont depend on specific names of compiler tools, but use existing Buildroot variables.

---
 package/meson/cross-compilation.conf.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
package/meson/cross-compilation.conf.in +0 -2
index e9344e2b2f..67c5da8156 100644
@@ -4,11 +4,11 @@
 # - Buildroot's 'target' is Meson's 'host'
 
 [binaries]
-c = '@TARGET_CROSS at gcc'
-cpp = '@TARGET_CROSS at g++'

package/meson/cross-compilation.conf.in line 13

Quoted 10 lines
package/meson/cross-compilation.conf.in +5 -3
-ar = '@TARGET_CROSS at ar'
-strip = '@TARGET_CROSS at strip'
-pkgconfig = '@HOST_DIR@/bin/pkgconf'
+c = '@TARGET_CC@'
+cpp = '@TARGET_CXX@'
+ar = '@TARGET_AR@'
+strip = '@TARGET_STRIP@'
+pkgconfig = '@PKG_CONFIG_HOST_BINARY@'
 g-ir-compiler = '@STAGING_DIR@/usr/bin/g-ir-compiler'
 g-ir-scanner = '@STAGING_DIR@/usr/bin/g-ir-scanner'

This changes host/bin/pkgconf to host/bin/pkg-config, but that shouldn't be a problem, given meson only uses this pkgconfig to find target packages and not host packages (for that meson would look it up in a native-file instead of a cross-file).

Also @PKG_CONFIG_HOST_BINARY@ won't be replaced if patch 3 isn't applied, so this isn't bisectable. Maybe it must be merged with patch 3 ?

#3 lore raw

PATCH v2 2/3 package/meson: use specific BR variables for cross-compilation.conf

Am Di., 15. Sept. 2020 um 16:05 Uhr schrieb Nicolas Cavallari <[email protected]>:

Quoted 27 lines · Norbert Lange
Quoted 25 lines

dont depend on specific names of compiler tools, but use existing Buildroot variables.

---
 package/meson/cross-compilation.conf.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
package/meson/cross-compilation.conf.in +4 -5
index e9344e2b2f..67c5da8156 100644
@@ -4,11 +4,11 @@
 # - Buildroot's 'target' is Meson's 'host'
 
 [binaries]
-c = '@TARGET_CROSS at gcc'
-cpp = '@TARGET_CROSS at g++'
-ar = '@TARGET_CROSS at ar'
-strip = '@TARGET_CROSS at strip'
-pkgconfig = '@HOST_DIR@/bin/pkgconf'
+c = '@TARGET_CC@'
+cpp = '@TARGET_CXX@'
+ar = '@TARGET_AR@'
+strip = '@TARGET_STRIP@'
Quoted 8 lines

package/meson/cross-compilation.conf.in line 13

Quoted 3 lines
package/meson/cross-compilation.conf.in +1 -0
+pkgconfig = '@PKG_CONFIG_HOST_BINARY@'
 g-ir-compiler = '@STAGING_DIR@/usr/bin/g-ir-compiler'
 g-ir-scanner = '@STAGING_DIR@/usr/bin/g-ir-scanner'

This changes host/bin/pkgconf to host/bin/pkg-config, but that shouldn't be a problem, given meson only uses this pkgconfig to find target packages and not host packages (for that meson would look it up in a native-file instead of a cross-file).

Well, its used by all other build systems, so this makes more sense to me, otherwise, shouldn't PKG_CONFIG_HOST_BINARY be changed to pkgconfig?

Quoted 3 lines

Also @PKG_CONFIG_HOST_BINARY@ won't be replaced if patch 3 isn't applied, so this isn't bisectable. Maybe it must be merged with patch 3 ?

Yeah, I did actually split this off as doing too much in a single patch was often critized.
can fix PATCH #2 or merge it again. Gonnna wait for more feedback

Norbert

#4 lore raw

PATCH v2 2/3 package/meson: use specific BR variables for cross-compilation.conf

Quoted 7 lines · On Tue, 15 Sep 2020 17:46:18 +0200 Norbert Lange <[email protected]> wrote:
Quoted 4 lines

This changes host/bin/pkgconf to host/bin/pkg-config, but that shouldn't be a problem, given meson only uses this pkgconfig to find target packages and not host packages (for that meson would look it up in a native-file instead of a cross-file).

Well, its used by all other build systems, so this makes more sense to me, otherwise, shouldn't PKG_CONFIG_HOST_BINARY be changed to pkgconfig?

No, for Meson things are special, and it should really point to pkgconf directly, and not to Buildroot's pkg-config wrapper around pkgconf.

Otherwise, what you're doing essentially reverts
4e0bc29993376613d200e892d491e31ea5a49622.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH v2 2/3 package/meson: use specific BR variables for cross-compilation.conf

Quoted 8 lines · Thomas Petazzoni
Quoted 5 lines · On Tue, 15 Sep 2020 17:46:18 +0200 Norbert Lange <[email protected]> wrote:
Quoted 4 lines

This changes host/bin/pkgconf to host/bin/pkg-config, but that shouldn't be a problem, given meson only uses this pkgconfig to find target packages and not host packages (for that meson would look it up in a native-file instead of a cross-file).

Quoted 8 lines
Quoted 2 lines

Well, its used by all other build systems, so this makes more sense to me, otherwise, shouldn't PKG_CONFIG_HOST_BINARY be changed to pkgconfig?

No, for Meson things are special, and it should really point to pkgconf directly, and not to Buildroot's pkg-config wrapper around pkgconf.

Otherwise, what you're doing essentially reverts
4e0bc29993376613d200e892d491e31ea5a49622.

We have already established that 4e0bc299 doesn't work:

https://marc.info/?l=buildroot&m=158853516017526&w=2

And i can confirm that the situation hasn't changed in 2020.08, the logs from my first message in this thread are unchanged in 2020.08
https://marc.info/?l=buildroot&m=158849499805939&w=2

but this is probably another topic.

#6 lore raw

PATCH v2 3/3 package/pkg-meson: move crosscompilation support out of package

In reply to Norbert Lange

install the cross-compilation.conf file when setting up the toolchain, not as part of host-meson.
This allows external usage of the buildroot toolchain through meson, whether the host-meson package is built or not (similar to other build systems).

Removed a few variables, as they were only used to communicate between meson package and pkg-meson and are needed anymore.

---
 package/meson/meson.mk                        | 32 -------
 package/pkg-meson.mk                          | 90 ++++++++++++-------
 .../misc}/cross-compilation.conf.in           |  0
 3 files changed, 60 insertions(+), 62 deletions(-)
 rename {package/meson => support/misc}/cross-compilation.conf.in (100%)
package/meson/meson.mk +0 -32
index 8633a2f717..acbd21b6f1 100644
@@ -13,38 +13,6 @@ MESON_SETUP_TYPE = setuptools
 HOST_MESON_DEPENDENCIES = host-ninja
 HOST_MESON_NEEDS_HOST_PYTHON = python3
 
-HOST_MESON_TARGET_ENDIAN = $(call qstrip,$(call LOWERCASE,$(BR2_ENDIAN)))
-HOST_MESON_TARGET_CPU = $(GCC_TARGET_CPU)
-
-# https://mesonbuild.com/Reference-tables.html#cpu-families
-ifeq ($(BR2_arcle)$(BR2_arceb),y)
-HOST_MESON_TARGET_CPU_FAMILY = arc
-else ifeq ($(BR2_arm)$(BR2_armeb),y)
-HOST_MESON_TARGET_CPU_FAMILY = arm
-else ifeq ($(BR2_aarch64)$(BR2_aarch64_be),y)
-HOST_MESON_TARGET_CPU_FAMILY = aarch64
-else ifeq ($(BR2_i386),y)
-HOST_MESON_TARGET_CPU_FAMILY = x86
-else ifeq ($(BR2_mips)$(BR2_mipsel),y)
-HOST_MESON_TARGET_CPU_FAMILY = mips
-else ifeq ($(BR2_mips64)$(BR2_mips64el),y)
-HOST_MESON_TARGET_CPU_FAMILY = mips64
-else ifeq ($(BR2_powerpc),y)
-HOST_MESON_TARGET_CPU_FAMILY = ppc
-else ifeq ($(BR2_powerpc64)$(BR2_powerpc64le),y)
-HOST_MESON_TARGET_CPU_FAMILY = ppc64
-else ifeq ($(BR2_riscv),y)
-HOST_MESON_TARGET_CPU_FAMILY = riscv64
-else ifeq ($(BR2_sparc),y)
-HOST_MESON_TARGET_CPU_FAMILY = sparc
-else ifeq ($(BR2_sparc64),y)
-HOST_MESON_TARGET_CPU_FAMILY = sparc64
-else ifeq ($(BR2_x86_64),y)
-HOST_MESON_TARGET_CPU_FAMILY = x86_64
-else
-HOST_MESON_TARGET_CPU_FAMILY = $(ARCH)
-endif
-
 # Avoid interpreter shebang longer than 128 chars
 define HOST_MESON_SET_INTERPRETER
 	$(SED) '1s:.*:#!/usr/bin/env python3:' $(HOST_DIR)/bin/meson
package/pkg-meson.mk +60 -30

119 lines not on this page · raw message

support/misc/cross-compilation.conf.in renamed from package/meson/cross-compilation.conf.in +0 -0
similarity index 100%
rename from package/meson/cross-compilation.conf.in
rename to support/misc/cross-compilation.conf.in
Signature · 1 line
2.28.0
#7 lore raw

PATCH v2 3/3 package/pkg-meson: move crosscompilation support out of package

should prolly change back the last line to TOOLCHAIN_POST_INSTALL_STAGING_HOOKS += PKG_MESON_INSTALL_CROSS_CONF

it was changed in 48d2606e28c41e22971e2b6ee163a6cedf041813, but I believe with this patchset the point is no longer valid, we are using TARGET_CXX which should point to the right spot, and source template 'support/misc/cross-compilation.conf.in' is now always used.

Am Di., 15. Sept. 2020 um 12:05 Uhr schrieb Norbert Lange <[email protected]>:

Quoted 192 lines

install the cross-compilation.conf file when setting up the toolchain, not as part of host-meson.
This allows external usage of the buildroot toolchain through meson, whether the host-meson package is built or not (similar to other build systems).

Removed a few variables, as they were only used to communicate between meson package and pkg-meson and are needed anymore.

---
 package/meson/meson.mk                        | 32 -------
 package/pkg-meson.mk                          | 90 ++++++++++++-------
 .../misc}/cross-compilation.conf.in           |  0
 3 files changed, 60 insertions(+), 62 deletions(-)
 rename {package/meson => support/misc}/cross-compilation.conf.in (100%)
package/meson/meson.mk +0 -32
index 8633a2f717..acbd21b6f1 100644
@@ -13,38 +13,6 @@ MESON_SETUP_TYPE = setuptools
 HOST_MESON_DEPENDENCIES = host-ninja
 HOST_MESON_NEEDS_HOST_PYTHON = python3
 
-HOST_MESON_TARGET_ENDIAN = $(call qstrip,$(call LOWERCASE,$(BR2_ENDIAN)))
-HOST_MESON_TARGET_CPU = $(GCC_TARGET_CPU)
-
-# https://mesonbuild.com/Reference-tables.html#cpu-families
-ifeq ($(BR2_arcle)$(BR2_arceb),y)
-HOST_MESON_TARGET_CPU_FAMILY = arc
-else ifeq ($(BR2_arm)$(BR2_armeb),y)
-HOST_MESON_TARGET_CPU_FAMILY = arm
-else ifeq ($(BR2_aarch64)$(BR2_aarch64_be),y)
-HOST_MESON_TARGET_CPU_FAMILY = aarch64
-else ifeq ($(BR2_i386),y)
-HOST_MESON_TARGET_CPU_FAMILY = x86
-else ifeq ($(BR2_mips)$(BR2_mipsel),y)
-HOST_MESON_TARGET_CPU_FAMILY = mips
-else ifeq ($(BR2_mips64)$(BR2_mips64el),y)
-HOST_MESON_TARGET_CPU_FAMILY = mips64
-else ifeq ($(BR2_powerpc),y)
-HOST_MESON_TARGET_CPU_FAMILY = ppc
-else ifeq ($(BR2_powerpc64)$(BR2_powerpc64le),y)
-HOST_MESON_TARGET_CPU_FAMILY = ppc64
-else ifeq ($(BR2_riscv),y)
-HOST_MESON_TARGET_CPU_FAMILY = riscv64
-else ifeq ($(BR2_sparc),y)
-HOST_MESON_TARGET_CPU_FAMILY = sparc
-else ifeq ($(BR2_sparc64),y)
-HOST_MESON_TARGET_CPU_FAMILY = sparc64
-else ifeq ($(BR2_x86_64),y)
-HOST_MESON_TARGET_CPU_FAMILY = x86_64
-else
-HOST_MESON_TARGET_CPU_FAMILY = $(ARCH)
-endif
-
 # Avoid interpreter shebang longer than 128 chars
 define HOST_MESON_SET_INTERPRETER
        $(SED) '1s:.*:#!/usr/bin/env python3:' $(HOST_DIR)/bin/meson
package/pkg-meson.mk +60 -30
index 3a34ba703b..a9ded9fe5a 100644
@@ -57,29 +57,17 @@ $(2)_NINJA_ENV              ?=
 ifndef $(2)_CONFIGURE_CMDS
 ifeq ($(4),target)
 
-$(2)_CFLAGS ?= $$(TARGET_CFLAGS)
-$(2)_LDFLAGS ?= $$(TARGET_LDFLAGS)
-$(2)_CXXFLAGS ?= $$(TARGET_CXXFLAGS)
-
 # Configure package for target
 #
 #
 define $(2)_CONFIGURE_CMDS
        rm -rf $$($$(PKG)_SRCDIR)/build
        mkdir -p $$($$(PKG)_SRCDIR)/build
-       sed -e 's%@TARGET_CROSS@%$$(TARGET_CROSS)%g' \
-           -e 's%@TARGET_ARCH@%$$(HOST_MESON_TARGET_CPU_FAMILY)%g' \
-           -e 's%@TARGET_CPU@%$$(HOST_MESON_TARGET_CPU)%g' \
-           -e 's%@TARGET_ENDIAN@%$$(HOST_MESON_TARGET_ENDIAN)%g' \
-           -e "s%@TARGET_CFLAGS@%$$(call make-sq-comma-list,$$($(2)_CFLAGS))%g" \
-           -e "s%@TARGET_LDFLAGS@%$$(call make-sq-comma-list,$$($(2)_LDFLAGS))%g" \
-           -e "s%@TARGET_CXXFLAGS@%$$(call make-sq-comma-list,$$($(2)_CXXFLAGS))%g" \
-           -e 's%@HOST_DIR@%$$(HOST_DIR)%g' \
-           -e 's%@STAGING_DIR@%$$(STAGING_DIR)%g' \
-           -e 's%@STATIC@%$$(if $$(BR2_STATIC_LIBS),true,false)%g' \
-           -e "/^\[binaries\]$$$$/s:$$$$:$$(foreach x,$$($(2)_MESON_EXTRA_BINARIES),\n$$(x)):" \
+       sed -e "/^\[binaries\]$$$$/s:$$$$:$$(foreach x,$$($(2)_MESON_EXTRA_BINARIES),\n$$(x)):" \
            -e "/^\[properties\]$$$$/s:$$$$:$$(foreach x,$$($(2)_MESON_EXTRA_PROPERTIES),\n$$(x)):" \
-           package/meson/cross-compilation.conf.in \
+           $$(call PKG_MESON_CROSSCONFIG_SED,$$(if $$($(2)_CFLAGS),$(2)_CFLAGS,TARGET_CFLAGS), \
+                   $$(if $$($(2)_CXXFLAGS),$(2)_CXXFLAGS,TARGET_CXXFLAGS), \
+                   $$(if $$($(2)_LDFLAGS),$(2)_LDFLAGS,TARGET_LDFLAGS)) \
            > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
        PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
                --prefix=/usr \
@@ -178,30 +166,72 @@ meson-package = $(call inner-meson-package,$(pkgname),$(call UPPERCASE,$(pkgname
 host-meson-package = $(call inner-meson-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
 
 ################################################################################
-# Generation of the Meson cross-compilation.conf file
+# Generation of the Meson compile flags and cross-compilation file
 ################################################################################
 
+# https://mesonbuild.com/Reference-tables.html#cpu-families
+ifeq ($(BR2_arcle)$(BR2_arceb),y)
+PKG_MESON_TARGET_CPU_FAMILY = arc
+else ifeq ($(BR2_arm)$(BR2_armeb),y)
+PKG_MESON_TARGET_CPU_FAMILY = arm
+else ifeq ($(BR2_aarch64)$(BR2_aarch64_be),y)
+PKG_MESON_TARGET_CPU_FAMILY = aarch64
+else ifeq ($(BR2_i386),y)
+PKG_MESON_TARGET_CPU_FAMILY = x86
+else ifeq ($(BR2_mips)$(BR2_mipsel),y)
+PKG_MESON_TARGET_CPU_FAMILY = mips
+else ifeq ($(BR2_mips64)$(BR2_mips64el),y)
+PKG_MESON_TARGET_CPU_FAMILY = mips64
+else ifeq ($(BR2_powerpc),y)
+PKG_MESON_TARGET_CPU_FAMILY = ppc
+else ifeq ($(BR2_powerpc64)$(BR2_powerpc64le),y)
+PKG_MESON_TARGET_CPU_FAMILY = ppc64
+else ifeq ($(BR2_riscv),y)
+PKG_MESON_TARGET_CPU_FAMILY = riscv64
+else ifeq ($(BR2_sparc),y)
+PKG_MESON_TARGET_CPU_FAMILY = sparc
+else ifeq ($(BR2_sparc64),y)
+PKG_MESON_TARGET_CPU_FAMILY = sparc64
+else ifeq ($(BR2_x86_64),y)
+PKG_MESON_TARGET_CPU_FAMILY = x86_64
+else
+PKG_MESON_TARGET_CPU_FAMILY = $(ARCH)
+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).
+# Aruments are variable containing cflags, cxxflags, ldflags.
+define PKG_MESON_CROSSCONFIG_SED
+        -e "s%@TARGET_CROSS@%$(TARGET_CROSS)%g" \
+        -e "s%@TARGET_CC@%$(TARGET_CC)%g" \
+        -e "s%@TARGET_CXX@%$(TARGET_CXX)%g" \
+        -e "s%@TARGET_AR@%$(TARGET_AR)%g" \
+        -e "s%@TARGET_STRIP@%$(TARGET_STRIP)%g" \
+        -e "s%@TARGET_ARCH@%$(PKG_MESON_TARGET_CPU_FAMILY)%g" \
+        -e "s%@TARGET_CPU@%$(GCC_TARGET_CPU)%g" \
+        -e "s%@TARGET_ENDIAN@%$(call LOWERCASE,$(BR2_ENDIAN))%g" \
+        -e "s%@TARGET_CFLAGS@%$(call make-sq-comma-list,$($(strip $(1))))%g" \
+        -e "s%@TARGET_LDFLAGS@%$(call make-sq-comma-list,$($(strip $(3))))%g" \
+        -e "s%@TARGET_CXXFLAGS@%$(call make-sq-comma-list,$($(strip $(2))))%g" \
+        -e "s%@HOST_DIR@%$(HOST_DIR)%g" \
+        -e "s%@PKG_CONFIG_HOST_BINARY@%$(PKG_CONFIG_HOST_BINARY)%g" \
+        -e "s%@STAGING_DIR@%$(STAGING_DIR)%g" \
+        -e 's%@STATIC@%$(if $(BR2_STATIC_LIBS),true,false)%g' \
+        $(TOPDIR)/support/misc/cross-compilation.conf.in
+endef
+
 # Generate a Meson cross-compilation.conf suitable for use with the
 # SDK; also install the file as a template for users to add their
 # own flags if they need to.
 define PKG_MESON_INSTALL_CROSS_CONF
        mkdir -p $(HOST_DIR)/etc/meson
-       sed -e 's%@TARGET_CROSS@%$(TARGET_CROSS)%g' \
-           -e 's%@TARGET_ARCH@%$(HOST_MESON_TARGET_CPU_FAMILY)%g' \
-           -e 's%@TARGET_CPU@%$(HOST_MESON_TARGET_CPU)%g' \
-           -e 's%@TARGET_ENDIAN@%$(HOST_MESON_TARGET_ENDIAN)%g' \
-           -e "s%@TARGET_CFLAGS@%$(call make-sq-comma-list,$(TARGET_CFLAGS))@PKG_TARGET_CFLAGS@%g" \
+       sed -e "s%@TARGET_CFLAGS@%$(call make-sq-comma-list,$(TARGET_CFLAGS))@PKG_TARGET_CFLAGS@%g" \
            -e "s%@TARGET_LDFLAGS@%$(call make-sq-comma-list,$(TARGET_LDFLAGS))@PKG_TARGET_CFLAGS@%g" \
            -e "s%@TARGET_CXXFLAGS@%$(call make-sq-comma-list,$(TARGET_CXXFLAGS))@PKG_TARGET_CFLAGS@%g" \
-           -e 's%@HOST_DIR@%$(HOST_DIR)%g' \
-           -e 's%@STAGING_DIR@%$(STAGING_DIR)%g' \
-           -e 's%@STATIC@%$(if $(BR2_STATIC_LIBS),true,false)%g' \
-           $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
+           $(call PKG_MESON_CROSSCONFIG_SED) \
            > $(HOST_DIR)/etc/meson/cross-compilation.conf.in
-       sed -e 's%@PKG_TARGET_CFLAGS@%%g' \
-           -e 's%@PKG_TARGET_LDFLAGS@%%g' \
-           -e 's%@PKG_TARGET_CXXFLAGS@%%g' \
-           $(HOST_DIR)/etc/meson/cross-compilation.conf.in \
+       sed $(call PKG_MESON_CROSSCONFIG_SED,TARGET_CFLAGS,TARGET_CXXFLAGS,TARGET_LDFLAGS) \
            > $(HOST_DIR)/etc/meson/cross-compilation.conf
 endef
 
support/misc/cross-compilation.conf.in renamed from package/meson/cross-compilation.conf.in +0 -1
similarity index 100%
rename from package/meson/cross-compilation.conf.in
rename to support/misc/cross-compilation.conf.in
--

2.28.0

#8 lore raw

PATCH v2 1/3 package/pkg-meson.mk: fix generation of pkg_config_static prop

In reply to Norbert Lange

Hello Norbert,

Quoted 16 lines · Norbert Lange

fixes following in the generated cross-complation.conf file:
pkg_config_static = '$(if $(BR2_STATIC_LIBS),true,false)'

---
v1->v2:

(quoted diff) +0 -2
-   truly fix the issue, missed one double $
---
 package/pkg-meson.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-meson.mk +0 -0
index c3fe6df5d0..3a34ba703b 100644

package/pkg-meson.mk define PKG_MESON_INSTALL_CROSS_CONF · line 201

Quoted 8 lines
package/pkg-meson.mk +1 -1
@@ -195,7 +195,7 @@ define PKG_MESON_INSTALL_CROSS_CONF
 	    -e "s%@TARGET_CXXFLAGS@%$(call make-sq-comma-list,$(TARGET_CXXFLAGS))@PKG_TARGET_CFLAGS@%g" \
 	    -e 's%@HOST_DIR@%$(HOST_DIR)%g' \
 	    -e 's%@STAGING_DIR@%$(STAGING_DIR)%g' \
-	    -e 's%@STATIC@%$$(if $$(BR2_STATIC_LIBS),true,false)%g' \
+	    -e 's%@STATIC@%$(if $(BR2_STATIC_LIBS),true,false)%g' \
 	    $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
 	    > $(HOST_DIR)/etc/meson/cross-compilation.conf.in
 	sed -e 's%@PKG_TARGET_CFLAGS@%%g' \

Regards,
Peter

#9 lore raw

PATCH v2 1/3 package/pkg-meson.mk: fix generation of pkg_config_static prop

Hello Norbert,

second sight, two nitpicks below...

Quoted 5 lines · Peter Seiderer

Hello Norbert,

Quoted 1 line · Norbert Lange

fixes following in the generated file:

s/cross-complation.conf/cross-compilation.conf/

Quoted 1 line
Quoted 1 line

pkg_config_static = '$(if $(BR2_STATIC_LIBS),true,false)'

Maybe a short sentence about only the 'host/etc/meson/cross-compilation.conf' (unused internally by buildroot) is affected, the per-package one (used by buildroot) are correct...

Bug introduced by (wrong) cut and paste from the per-package lines (where the double $$ is needed)...

Regards,
Peter

Quoted 31 lines
Quoted 14 lines

---
v1->v2:

(quoted diff) +0 -2
-   truly fix the issue, missed one double $
---
 package/pkg-meson.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-meson.mk +0 -0
index c3fe6df5d0..3a34ba703b 100644

package/pkg-meson.mk define PKG_MESON_INSTALL_CROSS_CONF · line 201

Quoted 8 lines
package/pkg-meson.mk +1 -1
@@ -195,7 +195,7 @@ define PKG_MESON_INSTALL_CROSS_CONF
 	    -e "s%@TARGET_CXXFLAGS@%$(call make-sq-comma-list,$(TARGET_CXXFLAGS))@PKG_TARGET_CFLAGS@%g" \
 	    -e 's%@HOST_DIR@%$(HOST_DIR)%g' \
 	    -e 's%@STAGING_DIR@%$(STAGING_DIR)%g' \
-	    -e 's%@STATIC@%$$(if $$(BR2_STATIC_LIBS),true,false)%g' \
+	    -e 's%@STATIC@%$(if $(BR2_STATIC_LIBS),true,false)%g' \
 	    $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
 	    > $(HOST_DIR)/etc/meson/cross-compilation.conf.in
 	sed -e 's%@PKG_TARGET_CFLAGS@%%g' \

Regards,
Peter
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#10 lore raw

PATCH v2 1/3 package/pkg-meson.mk: fix generation of pkg_config_static prop

In reply to Norbert Lange

Norbert, All,

On 2020-09-15 12:05 +0200, Norbert Lange spake thusly:

Quoted 4 lines

fixes following in the generated cross-complation.conf file:
pkg_config_static = '$(if $(BR2_STATIC_LIBS),true,false)'

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 27 lines

---
v1->v2:

(quoted diff) +0 -2
-   truly fix the issue, missed one double $
---
 package/pkg-meson.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-meson.mk +1 -1
index c3fe6df5d0..3a34ba703b 100644
@@ -195,7 +195,7 @@ define PKG_MESON_INSTALL_CROSS_CONF
 	    -e "s%@TARGET_CXXFLAGS@%$(call make-sq-comma-list,$(TARGET_CXXFLAGS))@PKG_TARGET_CFLAGS@%g" \
 	    -e 's%@HOST_DIR@%$(HOST_DIR)%g' \
 	    -e 's%@STAGING_DIR@%$(STAGING_DIR)%g' \
-	    -e 's%@STATIC@%$$(if $$(BR2_STATIC_LIBS),true,false)%g' \
+	    -e 's%@STATIC@%$(if $(BR2_STATIC_LIBS),true,false)%g' \
 	    $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
 	    > $(HOST_DIR)/etc/meson/cross-compilation.conf.in
 	sed -e 's%@PKG_TARGET_CFLAGS@%%g' \
Signature · 6 lines
2.28.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#11 lore raw

PATCH v2 1/3 package/pkg-meson.mk: fix generation of pkg_config_static prop

In reply to Norbert Lange
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Norbert" == Norbert Lange <[email protected]> writes:

fixes following in the generated cross-complation.conf file:
pkg_config_static = '$(if $(BR2_STATIC_LIBS),true,false)'

Committed to 2020.02.x, 2020.05.x and 2020.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard