diff options
author | Ross Burton <ross.burton@intel.com> | 2018-09-25 14:43:45 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-09-25 23:15:49 +0100 |
commit | 16729efc18ae7b3e4e666672556f23a27330cbd6 (patch) | |
tree | 7b4b07a3f8017ee2036c9935cda766c0de25749a /meta/classes/meson.bbclass | |
parent | ff33ab40aff7ac3720dbe214fed413052388eec9 (diff) | |
download | poky-16729efc18ae7b3e4e666672556f23a27330cbd6.tar.gz |
meson: pass correct endian in the cross file
Meson doesn't care for the value of the endian field, but packages may want to
use it and Meson master now validates the value.
Use siteinfo to obtain the endianism and write the correct value.
(From OE-Core rev: 2f9adf05efdddf8dae9c58976ae56cf32d9e57f0)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/meson.bbclass')
-rw-r--r-- | meta/classes/meson.bbclass | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index e3b452786d..07322cf786 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass | |||
@@ -1,4 +1,4 @@ | |||
1 | inherit python3native | 1 | inherit siteinfo python3native |
2 | 2 | ||
3 | DEPENDS_append = " meson-native ninja-native" | 3 | DEPENDS_append = " meson-native ninja-native" |
4 | 4 | ||
@@ -31,10 +31,6 @@ MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CFLAGS}" | |||
31 | MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CXXFLAGS}" | 31 | MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CXXFLAGS}" |
32 | MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${LDFLAGS}" | 32 | MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${LDFLAGS}" |
33 | 33 | ||
34 | # both are required but not used by meson | ||
35 | MESON_HOST_ENDIAN = "bogus-endian" | ||
36 | MESON_TARGET_ENDIAN = "bogus-endian" | ||
37 | |||
38 | EXTRA_OEMESON_append = " ${PACKAGECONFIG_CONFARGS}" | 34 | EXTRA_OEMESON_append = " ${PACKAGECONFIG_CONFARGS}" |
39 | 35 | ||
40 | MESON_CROSS_FILE = "" | 36 | MESON_CROSS_FILE = "" |
@@ -59,6 +55,16 @@ def meson_cpu_family(var, d): | |||
59 | else: | 55 | else: |
60 | return arch | 56 | return arch |
61 | 57 | ||
58 | def meson_endian(prefix, d): | ||
59 | arch, os = d.getVar(prefix + "_ARCH"), d.getVar(prefix + "_OS") | ||
60 | sitedata = siteinfo_data_for_machine(arch, os, d) | ||
61 | if "endian-little" in sitedata: | ||
62 | return "little" | ||
63 | elif "endian-big" in sitedata: | ||
64 | return "big" | ||
65 | else: | ||
66 | bb.fatal("Cannot determine endianism for %s-%s" % (arch, os)) | ||
67 | |||
62 | addtask write_config before do_configure | 68 | addtask write_config before do_configure |
63 | do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF" | 69 | do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF" |
64 | do_write_config() { | 70 | do_write_config() { |
@@ -86,13 +92,13 @@ gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper' | |||
86 | system = '${HOST_OS}' | 92 | system = '${HOST_OS}' |
87 | cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}' | 93 | cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}' |
88 | cpu = '${HOST_ARCH}' | 94 | cpu = '${HOST_ARCH}' |
89 | endian = '${MESON_HOST_ENDIAN}' | 95 | endian = '${@meson_endian('HOST', d)}' |
90 | 96 | ||
91 | [target_machine] | 97 | [target_machine] |
92 | system = '${TARGET_OS}' | 98 | system = '${TARGET_OS}' |
93 | cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}' | 99 | cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}' |
94 | cpu = '${TARGET_ARCH}' | 100 | cpu = '${TARGET_ARCH}' |
95 | endian = '${MESON_TARGET_ENDIAN}' | 101 | endian = '${@meson_endian('TARGET', d)}' |
96 | EOF | 102 | EOF |
97 | } | 103 | } |
98 | 104 | ||