Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: openembedded-devel@lists.openembedded.org
Subject: [PATCH 4/5] meson.bbclass: Support building for native
Date: Sat, 11 Mar 2017 05:58:54 +0100	[thread overview]
Message-ID: <20170311045855.3665-4-pkj@axis.com> (raw)
In-Reply-To: <20170311045855.3665-1-pkj@axis.com>

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta-oe/classes/meson.bbclass | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/meta-oe/classes/meson.bbclass b/meta-oe/classes/meson.bbclass
index 8da06da7f..e3489dd12 100644
--- a/meta-oe/classes/meson.bbclass
+++ b/meta-oe/classes/meson.bbclass
@@ -9,9 +9,11 @@ do_configure[cleandirs] = "${B}"
 # Where the meson.build build configuration is
 MESON_SOURCEPATH = "${S}"
 
-# These variables in the environment override the *native* tools not the cross,
-# so they need to be unexported.
-CC[unexport] = "1"
+# These variables in the environment override the *native* tools, not the cross.
+export CC = "${BUILD_CC}"
+export CXX = "${BUILD_CXX}"
+export LD = "${BUILD_LD}"
+export AR = "${BUILD_AR}"
 
 def noprefix(var, d):
     return d.getVar(var, True).replace(d.getVar('prefix', True) + '/', '', 1)
@@ -37,6 +39,9 @@ MESON_TARGET_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'big',
 
 EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}"
 
+MESON_CROSS_FILE = ""
+MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
+
 def meson_array(var, d):
     return "', '".join(d.getVar(var, True).split()).join(("'", "'"))
 
@@ -75,7 +80,7 @@ EOF
 CONFIGURE_FILES = "meson.build"
 
 meson_do_configure() {
-    if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" --cross-file ${WORKDIR}/meson.cross ${EXTRA_OEMESON}; then
+    if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" ${MESON_CROSS_FILE} ${EXTRA_OEMESON}; then
         cat ${B}/meson-logs/meson-log.txt
         bbfatal_log meson failed
     fi
-- 
2.12.0



  parent reply	other threads:[~2017-03-11  4:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-11  4:58 [PATCH 1/5] meson: Update to 0.37.1 Peter Kjellerstedt
2017-03-11  4:58 ` [PATCH 2/5] meson.bbclass: Add support for more standard installation directories Peter Kjellerstedt
2017-03-11  4:58 ` [PATCH 3/5] meson.bbclass: Make changes to meson.build files trigger reconfiguration Peter Kjellerstedt
2017-03-11  4:58 ` Peter Kjellerstedt [this message]
2017-03-11  4:58 ` [PATCH 5/5] meson.bbclass: Use the correct C++ compiler when cross compiling Peter Kjellerstedt
2017-03-11  5:11   ` Khem Raj
2017-03-11  5:24     ` Peter Kjellerstedt

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=20170311045855.3665-4-pkj@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox