summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-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