From e14171cc594e8c3dfee8119847c26e10b15bacf4 Mon Sep 17 00:00:00 2001 From: Martin Kelly Date: Mon, 4 Jun 2018 16:06:02 -0700 Subject: meson: enable nativesdk Currently, we can't build meson into SDKs because we don't autogenerate the required meson.cross file. Enable this by using the post-relocate hooks and generating a meson.cross file based on the SDK environment passed into the post-relocate hook. (From OE-Core rev: aabb846b165fec218024a7a57f3c9fdaa2514179) Signed-off-by: Martin Kelly Signed-off-by: Richard Purdie --- .../meson/nativesdk-meson_0.46.1.bb | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 meta/recipes-devtools/meson/nativesdk-meson_0.46.1.bb (limited to 'meta/recipes-devtools/meson/nativesdk-meson_0.46.1.bb') diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.46.1.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.46.1.bb new file mode 100644 index 0000000000..53503aa998 --- /dev/null +++ b/meta/recipes-devtools/meson/nativesdk-meson_0.46.1.bb @@ -0,0 +1,74 @@ +include meson.inc + +inherit nativesdk + +SRC_URI += "file://meson-setup.py \ + file://meson-wrapper" + +def meson_array(var, d): + return "', '".join(d.getVar(var).split()).join(("'", "'")) + +# both are required but not used by meson +MESON_SDK_ENDIAN = "bogus-endian" +MESON_TARGET_ENDIAN = "bogus-endian" + +MESON_TOOLCHAIN_ARGS = "${BUILDSDK_CC_ARCH}${TOOLCHAIN_OPTIONS}" +MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CFLAGS}" +MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CXXFLAGS}" +MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_LDFLAGS}" + +# This logic is similar but not identical to that in meson.bbclass, since it's +# generating for an SDK rather than a cross-compile. Important differences are: +# - We can't set vars like CC, CXX, etc. yet because they will be filled in with +# real paths by meson-setup.sh when the SDK is extracted. +# - Some overrides aren't needed, since the SDK injects paths that take care of +# them. +addtask write_config before do_install +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 <