[oe] [PATCH 4/5] meson.bbclass: Support building for native

Peter Kjellerstedt peter.kjellerstedt at axis.com
Sat Mar 11 04:58:54 UTC 2017


Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at 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




More information about the Openembedded-devel mailing list