summaryrefslogtreecommitdiffstats
path: root/meta/classes/meson.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-09-25 14:43:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-25 23:15:49 +0100
commit16729efc18ae7b3e4e666672556f23a27330cbd6 (patch)
tree7b4b07a3f8017ee2036c9935cda766c0de25749a /meta/classes/meson.bbclass
parentff33ab40aff7ac3720dbe214fed413052388eec9 (diff)
downloadpoky-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.bbclass20
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 @@
1inherit python3native 1inherit siteinfo python3native
2 2
3DEPENDS_append = " meson-native ninja-native" 3DEPENDS_append = " meson-native ninja-native"
4 4
@@ -31,10 +31,6 @@ MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CFLAGS}"
31MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CXXFLAGS}" 31MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CXXFLAGS}"
32MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${LDFLAGS}" 32MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${LDFLAGS}"
33 33
34# both are required but not used by meson
35MESON_HOST_ENDIAN = "bogus-endian"
36MESON_TARGET_ENDIAN = "bogus-endian"
37
38EXTRA_OEMESON_append = " ${PACKAGECONFIG_CONFARGS}" 34EXTRA_OEMESON_append = " ${PACKAGECONFIG_CONFARGS}"
39 35
40MESON_CROSS_FILE = "" 36MESON_CROSS_FILE = ""
@@ -59,6 +55,16 @@ def meson_cpu_family(var, d):
59 else: 55 else:
60 return arch 56 return arch
61 57
58def 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
62addtask write_config before do_configure 68addtask write_config before do_configure
63do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF" 69do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF"
64do_write_config() { 70do_write_config() {
@@ -86,13 +92,13 @@ gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
86system = '${HOST_OS}' 92system = '${HOST_OS}'
87cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}' 93cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}'
88cpu = '${HOST_ARCH}' 94cpu = '${HOST_ARCH}'
89endian = '${MESON_HOST_ENDIAN}' 95endian = '${@meson_endian('HOST', d)}'
90 96
91[target_machine] 97[target_machine]
92system = '${TARGET_OS}' 98system = '${TARGET_OS}'
93cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}' 99cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}'
94cpu = '${TARGET_ARCH}' 100cpu = '${TARGET_ARCH}'
95endian = '${MESON_TARGET_ENDIAN}' 101endian = '${@meson_endian('TARGET', d)}'
96EOF 102EOF
97} 103}
98 104