From: Norbert Lange <nolange79@gmail.com>
To: buildroot@buildroot.org
Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>,
Norbert Lange <nolange79@gmail.com>
Subject: [Buildroot] [PATCH v3 1/2] package/pkg-meson: separate infrastructure logic from package
Date: Fri, 3 Dec 2021 22:54:37 +0100 [thread overview]
Message-ID: <20211203215438.213437-1-nolange79@gmail.com> (raw)
Move all logic related to handling meson packages to the
package/pkg-meson file. This now mirrors the other build
systems and keeps the package itself clean.
Correctly prefix variables with PKG_MESON_
Signed-off-by: Norbert Lange <nolange79@gmail.com>
---
v2->v3:
- rebase, split up the moving
v1->v2:
- squash 2 commits, really hard to separate as moving and renaming
variables from 2 to one location affects alot code.
- use TOOLCHAIN_POST_INSTALL_STAGING_HOOKS again.
- consistently use double quotes for sed patterns
Signed-off-by: Norbert Lange <nolange79@gmail.com>
---
package/meson/meson.mk | 38 --------------------------------------
package/pkg-meson.mk | 40 +++++++++++++++++++++++++++++++++++++++-
2 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/package/meson/meson.mk b/package/meson/meson.mk
index a8c846126a..5553c15d91 100644
--- a/package/meson/meson.mk
+++ b/package/meson/meson.mk
@@ -13,44 +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_m68k),y)
-HOST_MESON_TARGET_CPU_FAMILY = m68k
-else ifeq ($(BR2_microblazeel)$(BR2_microblazebe),y)
-HOST_MESON_TARGET_CPU_FAMILY = microblaze
-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_sh4)$(BR2_sh4eb)$(BR2_sh4a)$(BR2_sh4aeb),y)
-HOST_MESON_TARGET_CPU_FAMILY = sh4
-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
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 16a90d157b..4914486665 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -185,9 +185,47 @@ 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_m68k),y)
+PKG_MESON_TARGET_CPU_FAMILY = m68k
+else ifeq ($(BR2_microblazeel)$(BR2_microblazebe),y)
+PKG_MESON_TARGET_CPU_FAMILY = microblaze
+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_sh4)$(BR2_sh4eb)$(BR2_sh4a)$(BR2_sh4aeb),y)
+PKG_MESON_TARGET_CPU_FAMILY = sh4
+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
+
+HOST_MESON_TARGET_ENDIAN = $(call qstrip,$(call LOWERCASE,$(BR2_ENDIAN)))
+HOST_MESON_TARGET_CPU = $(GCC_TARGET_CPU)
+
# 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.
--
2.33.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next reply other threads:[~2021-12-03 21:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 21:54 Norbert Lange [this message]
2021-12-03 21:54 ` [Buildroot] [PATCH v3 2/2] package/pkg-meson: improve generation of cross-compilation file Norbert Lange
2022-01-31 23:00 ` Arnout Vandecappelle
2022-02-01 22:53 ` Peter Seiderer
2022-01-31 22:43 ` [Buildroot] [PATCH v3 1/2] package/pkg-meson: separate infrastructure logic from package Arnout Vandecappelle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211203215438.213437-1-nolange79@gmail.com \
--to=nolange79@gmail.com \
--cc=buildroot@buildroot.org \
--cc=eric.le.bihan.dev@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.