meson: Strip quotes from BR2_ENDIAN
authorGleb Mazovetskiy <glex.spb@gmail.com>
Wed, 11 Mar 2020 18:38:33 +0000 (18:38 +0000)
committerYann E. MORIN <yann.morin.1998@free.fr>
Wed, 11 Mar 2020 21:51:15 +0000 (22:51 +0100)
The values in the cross-compilation file are expected to be quoted with
single quotes, which we have in our template.

However, the endian value we are injecting comes from Kconfig, so it is
double-quoted, and those quotes end up in the cross-compilation files we
generate (the internal one, and the SDK one):

    endian = '"little"'

So qstrip the value before we inject it.

Propagate the fix to the two generated files by using the same variable
HOST_MESON_TARGET_ENDIAN in both cases, rather than replicating the
(flawed) logic.

While at it, also use the common GCC_TARGET_CPU variable for the SDK
file too.

Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
Reviewed-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/meson/meson.mk
package/pkg-meson.mk

index 29c7ed180059c8862b9592e096c71bfca57756b1..845ce8fb716a777154b4e4d295cfc02ea68ae911 100644 (file)
@@ -13,7 +13,7 @@ MESON_SETUP_TYPE = setuptools
 HOST_MESON_DEPENDENCIES = host-ninja
 HOST_MESON_NEEDS_HOST_PYTHON = python3
 
-HOST_MESON_TARGET_ENDIAN = $(call LOWERCASE,$(BR2_ENDIAN))
+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
index 416129f6fed0d73ce242d78d0141614622dee0dd..a0b467caba2b085fc3caf8be2358e87ab4f08e97 100644 (file)
@@ -69,8 +69,8 @@ define $(2)_CONFIGURE_CMDS
        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@%$$(GCC_TARGET_CPU)%g' \
-           -e 's%@TARGET_ENDIAN@%$$(call LOWERCASE,$$(BR2_ENDIAN))%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-comma-list,$$($(2)_CFLAGS))%g' \
            -e 's%@TARGET_LDFLAGS@%$$(call make-comma-list,$$($(2)_LDFLAGS))%g' \
            -e 's%@TARGET_CXXFLAGS@%$$(call make-comma-list,$$($(2)_CXXFLAGS))%g' \