]> code.ossystems Code Review - openembedded-core.git/commitdiff
meson.bbclass: fix to build for more projects
authorChen Qi <Qi.Chen@windriver.com>
Mon, 5 Mar 2018 02:02:01 +0000 (10:02 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 6 Mar 2018 14:36:34 +0000 (06:36 -0800)
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.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/meson.bbclass

index 31d32a56f649b995d8b633629d5a3f0bd1ff124a..2d7ee4fffc0490b96c77607859866ab3d7c46dbc 100644 (file)
@@ -41,26 +41,22 @@ MESON_CROSS_FILE = ""
 MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
 MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross"
 
-CCOMPILER ?= "gcc"
-CXXCOMPILER ?= "g++"
-CCOMPILER_toolchain-clang = "clang"
-CXXCOMPILER_toolchain-clang = "clang++"
-
 def meson_array(var, d):
     return "', '".join(d.getVar(var).split()).join(("'", "'"))
 
 addtask write_config before do_configure
-do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS"
+do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF"
 do_write_config() {
     # This needs to be Py to split the args into single-element lists
     cat >${WORKDIR}/meson.cross <<EOF
 [binaries]
-c = '${HOST_PREFIX}${CCOMPILER}'
-cpp = '${HOST_PREFIX}${CXXCOMPILER}'
-ar = '${HOST_PREFIX}ar'
-ld = '${HOST_PREFIX}ld'
-strip = '${HOST_PREFIX}strip'
-readelf = '${HOST_PREFIX}readelf'
+c = [${@meson_array('CC', d)}]
+cpp = [${@meson_array('CXX', d)}]
+ar = [${@meson_array('AR', d)}]
+nm = [${@meson_array('NM', d)}]
+ld = [${@meson_array('LD', d)}]
+strip = [${@meson_array('STRIP', d)}]
+readelf = [${@meson_array('READELF', d)}]
 pkgconfig = 'pkg-config'
 
 [properties]