summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-03-05 10:02:01 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-06 06:43:10 -0800
commitd1e6aa57f7ee44b92c3a2ec740b806c17254814a (patch)
treea9f18a9cb18d1a97d010c35534324aa834e1927d /meta
parent40cdf6dd789d3f4977b31898e23db52d3bf7a657 (diff)
downloadpoky-d1e6aa57f7ee44b92c3a2ec740b806c17254814a.tar.gz
meson.bbclass: fix to build for more projects
We should use the value of CC for the c compiler setting in cross compilation configuration file for meson. For example, if we only use ${HOST_PREFIX}gcc instead of ${CC}, we would meet the following do_compile failure for systemd. cc1: fatal error: linux/capability.h: No such file or directory Do the same change for LD, AR, NM, STRIP and READELF. (From OE-Core rev: 177bd96a531fcc85e62baff04aba327e2bccee07) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/meson.bbclass20
1 files changed, 8 insertions, 12 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index 31d32a56f6..2d7ee4fffc 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -41,26 +41,22 @@ MESON_CROSS_FILE = ""
41MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross" 41MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
42MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross" 42MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross"
43 43
44CCOMPILER ?= "gcc"
45CXXCOMPILER ?= "g++"
46CCOMPILER_toolchain-clang = "clang"
47CXXCOMPILER_toolchain-clang = "clang++"
48
49def meson_array(var, d): 44def meson_array(var, d):
50 return "', '".join(d.getVar(var).split()).join(("'", "'")) 45 return "', '".join(d.getVar(var).split()).join(("'", "'"))
51 46
52addtask write_config before do_configure 47addtask write_config before do_configure
53do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS" 48do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF"
54do_write_config() { 49do_write_config() {
55 # This needs to be Py to split the args into single-element lists 50 # This needs to be Py to split the args into single-element lists
56 cat >${WORKDIR}/meson.cross <<EOF 51 cat >${WORKDIR}/meson.cross <<EOF
57[binaries] 52[binaries]
58c = '${HOST_PREFIX}${CCOMPILER}' 53c = [${@meson_array('CC', d)}]
59cpp = '${HOST_PREFIX}${CXXCOMPILER}' 54cpp = [${@meson_array('CXX', d)}]
60ar = '${HOST_PREFIX}ar' 55ar = [${@meson_array('AR', d)}]
61ld = '${HOST_PREFIX}ld' 56nm = [${@meson_array('NM', d)}]
62strip = '${HOST_PREFIX}strip' 57ld = [${@meson_array('LD', d)}]
63readelf = '${HOST_PREFIX}readelf' 58strip = [${@meson_array('STRIP', d)}]
59readelf = [${@meson_array('READELF', d)}]
64pkgconfig = 'pkg-config' 60pkgconfig = 'pkg-config'
65 61
66[properties] 62[properties]