diff options
author | Ross Burton <ross.burton@intel.com> | 2019-01-07 15:07:43 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-07 17:45:40 +0000 |
commit | 8596f871ef834a38e3375443f7eb08e43816347a (patch) | |
tree | 48e33b1f1cc368e301052c97b603ae3a38d28262 /meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb | |
parent | fdb5a8b3d437537aee53380091dabe6258667a49 (diff) | |
download | openembedded-core-contrib-8596f871ef834a38e3375443f7eb08e43816347a.tar.gz |
meson: fix nativesdk-meson for multilib SDKs
Multilib SDKs differ only in the environment variables set, so nativesdk-meson's
setup script needs to write a cross file for each environment.
Rename the shipped meson.cross to meson.cross.template, as it cannot be used
directly. Now that post-relocate scripts are called once for each environment,
the generated meson.cross can be prefixed with TARGET_PREFIX to ensure it is
unique.
Finally rewrite the setup script to use string.Template to perform the expansion
instead of hand-coding the logic.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb')
-rw-r--r-- | meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb index 721ee8c8f1..55c57775e0 100644 --- a/meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb +++ b/meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb @@ -5,9 +5,6 @@ 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" @@ -17,32 +14,31 @@ 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: +# The cross file 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 <<EOF +do_install_append() { + install -d ${D}${datadir}/meson + cat >${D}${datadir}/meson/meson.cross.template <<EOF [binaries] -c = @@CC@@ -cpp = @@CXX@@ -ar = @@AR@@ -nm = @@NM@@ -ld = @@LD@@ -strip = @@STRIP@@ +c = @CC +cpp = @CXX +ar = @AR +nm = @NM +ld = @LD +strip = @STRIP pkgconfig = 'pkg-config' [properties] needs_exe_wrapper = true -c_args = @@CFLAGS@@ -c_link_args = @@LDFLAGS@@ -cpp_args = @@CPPFLAGS@@ -cpp_link_args = @@LDFLAGS@@ +c_args = @CFLAGS +c_link_args = @LDFLAGS +cpp_args = @CPPFLAGS +cpp_link_args = @LDFLAGS [host_machine] system = '${SDK_OS}' @@ -50,11 +46,6 @@ cpu_family = '${SDK_ARCH}' cpu = '${SDK_ARCH}' endian = '${MESON_SDK_ENDIAN}' EOF -} - -do_install_append() { - install -d ${D}${datadir}/meson - install -m 0644 ${WORKDIR}/meson.cross ${D}${datadir}/meson/ install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ |