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-08 11:16:45 +0000 |
| commit | c2556c44ecfb21c3fefddf12f9d9abdf482b90c7 (patch) | |
| tree | 85b6c90b72f4fdf94e3859b0acc08d72c8078838 /meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb | |
| parent | 3bda6b8e0aa2656818e36a95e32252dc0e434105 (diff) | |
| download | poky-c2556c44ecfb21c3fefddf12f9d9abdf482b90c7.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.
(From OE-Core rev: 8596f871ef834a38e3375443f7eb08e43816347a)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 | |||
| 5 | SRC_URI += "file://meson-setup.py \ | 5 | SRC_URI += "file://meson-setup.py \ |
| 6 | file://meson-wrapper" | 6 | file://meson-wrapper" |
| 7 | 7 | ||
| 8 | def meson_array(var, d): | ||
| 9 | return "', '".join(d.getVar(var).split()).join(("'", "'")) | ||
| 10 | |||
| 11 | # both are required but not used by meson | 8 | # both are required but not used by meson |
| 12 | MESON_SDK_ENDIAN = "bogus-endian" | 9 | MESON_SDK_ENDIAN = "bogus-endian" |
| 13 | MESON_TARGET_ENDIAN = "bogus-endian" | 10 | MESON_TARGET_ENDIAN = "bogus-endian" |
| @@ -17,32 +14,31 @@ MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CFLAGS}" | |||
| 17 | MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CXXFLAGS}" | 14 | MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CXXFLAGS}" |
| 18 | MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_LDFLAGS}" | 15 | MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_LDFLAGS}" |
| 19 | 16 | ||
| 20 | # This logic is similar but not identical to that in meson.bbclass, since it's | 17 | # The cross file logic is similar but not identical to that in meson.bbclass, |
| 21 | # generating for an SDK rather than a cross-compile. Important differences are: | 18 | # since it's generating for an SDK rather than a cross-compile. Important |
| 19 | # differences are: | ||
| 22 | # - We can't set vars like CC, CXX, etc. yet because they will be filled in with | 20 | # - We can't set vars like CC, CXX, etc. yet because they will be filled in with |
| 23 | # real paths by meson-setup.sh when the SDK is extracted. | 21 | # real paths by meson-setup.sh when the SDK is extracted. |
| 24 | # - Some overrides aren't needed, since the SDK injects paths that take care of | 22 | # - Some overrides aren't needed, since the SDK injects paths that take care of |
| 25 | # them. | 23 | # them. |
| 26 | addtask write_config before do_install | 24 | do_install_append() { |
| 27 | do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF" | 25 | install -d ${D}${datadir}/meson |
| 28 | do_write_config() { | 26 | cat >${D}${datadir}/meson/meson.cross.template <<EOF |
| 29 | # This needs to be Py to split the args into single-element lists | ||
| 30 | cat >${WORKDIR}/meson.cross <<EOF | ||
| 31 | [binaries] | 27 | [binaries] |
| 32 | c = @@CC@@ | 28 | c = @CC |
| 33 | cpp = @@CXX@@ | 29 | cpp = @CXX |
| 34 | ar = @@AR@@ | 30 | ar = @AR |
| 35 | nm = @@NM@@ | 31 | nm = @NM |
| 36 | ld = @@LD@@ | 32 | ld = @LD |
| 37 | strip = @@STRIP@@ | 33 | strip = @STRIP |
| 38 | pkgconfig = 'pkg-config' | 34 | pkgconfig = 'pkg-config' |
| 39 | 35 | ||
| 40 | [properties] | 36 | [properties] |
| 41 | needs_exe_wrapper = true | 37 | needs_exe_wrapper = true |
| 42 | c_args = @@CFLAGS@@ | 38 | c_args = @CFLAGS |
| 43 | c_link_args = @@LDFLAGS@@ | 39 | c_link_args = @LDFLAGS |
| 44 | cpp_args = @@CPPFLAGS@@ | 40 | cpp_args = @CPPFLAGS |
| 45 | cpp_link_args = @@LDFLAGS@@ | 41 | cpp_link_args = @LDFLAGS |
| 46 | 42 | ||
| 47 | [host_machine] | 43 | [host_machine] |
| 48 | system = '${SDK_OS}' | 44 | system = '${SDK_OS}' |
| @@ -50,11 +46,6 @@ cpu_family = '${SDK_ARCH}' | |||
| 50 | cpu = '${SDK_ARCH}' | 46 | cpu = '${SDK_ARCH}' |
| 51 | endian = '${MESON_SDK_ENDIAN}' | 47 | endian = '${MESON_SDK_ENDIAN}' |
| 52 | EOF | 48 | EOF |
| 53 | } | ||
| 54 | |||
| 55 | do_install_append() { | ||
| 56 | install -d ${D}${datadir}/meson | ||
| 57 | install -m 0644 ${WORKDIR}/meson.cross ${D}${datadir}/meson/ | ||
| 58 | 49 | ||
| 59 | install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d | 50 | install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d |
| 60 | install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ | 51 | install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/ |
