diff options
author | Ross Burton <ross.burton@intel.com> | 2018-09-25 14:46:16 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-09-25 23:15:49 +0100 |
commit | f0c59c8876986f04ca6a9bbb5ef0bf48591882ed (patch) | |
tree | aaaa382dff8dd83e154a6762872c556f1e7b6b00 | |
parent | 802a7c186719390375fa44b0b9857f7f4ef8f10f (diff) | |
download | poky-f0c59c8876986f04ca6a9bbb5ef0bf48591882ed.tar.gz |
siteinfo: generalise siteinfo
Add a function siteinfo_data_for_machine to look up the data for any arch/os
pair, not just HOST_ARCH-HOST_OS.
(From OE-Core rev: 7429ed8d2a6e48cb3415113ef62348ae211aa189)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/siteinfo.bbclass | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass index 4698e6e474..24585d5842 100644 --- a/meta/classes/siteinfo.bbclass +++ b/meta/classes/siteinfo.bbclass | |||
@@ -15,7 +15,7 @@ | |||
15 | # It is an error for the target not to exist. | 15 | # It is an error for the target not to exist. |
16 | # If 'what' doesn't exist then an empty value is returned | 16 | # If 'what' doesn't exist then an empty value is returned |
17 | # | 17 | # |
18 | def siteinfo_data(d): | 18 | def siteinfo_data_for_machine(arch, os, d): |
19 | archinfo = { | 19 | archinfo = { |
20 | "allarch": "endian-little bit-32", # bogus, but better than special-casing the checks below for allarch | 20 | "allarch": "endian-little bit-32", # bogus, but better than special-casing the checks below for allarch |
21 | "aarch64": "endian-little bit-64 arm-common arm-64", | 21 | "aarch64": "endian-little bit-64 arm-common arm-64", |
@@ -131,15 +131,13 @@ def siteinfo_data(d): | |||
131 | locs = { "archinfo" : archinfo, "osinfo" : osinfo, "targetinfo" : targetinfo, "d" : d} | 131 | locs = { "archinfo" : archinfo, "osinfo" : osinfo, "targetinfo" : targetinfo, "d" : d} |
132 | archinfo, osinfo, targetinfo = bb.utils.better_eval(call, locs) | 132 | archinfo, osinfo, targetinfo = bb.utils.better_eval(call, locs) |
133 | 133 | ||
134 | hostarch = d.getVar("HOST_ARCH") | 134 | target = "%s-%s" % (arch, os) |
135 | hostos = d.getVar("HOST_OS") | ||
136 | target = "%s-%s" % (hostarch, hostos) | ||
137 | 135 | ||
138 | sitedata = [] | 136 | sitedata = [] |
139 | if hostarch in archinfo: | 137 | if arch in archinfo: |
140 | sitedata.extend(archinfo[hostarch].split()) | 138 | sitedata.extend(archinfo[arch].split()) |
141 | if hostos in osinfo: | 139 | if os in osinfo: |
142 | sitedata.extend(osinfo[hostos].split()) | 140 | sitedata.extend(osinfo[os].split()) |
143 | if target in targetinfo: | 141 | if target in targetinfo: |
144 | sitedata.extend(targetinfo[target].split()) | 142 | sitedata.extend(targetinfo[target].split()) |
145 | sitedata.append(target) | 143 | sitedata.append(target) |
@@ -148,6 +146,9 @@ def siteinfo_data(d): | |||
148 | bb.debug(1, "SITE files %s" % sitedata); | 146 | bb.debug(1, "SITE files %s" % sitedata); |
149 | return sitedata | 147 | return sitedata |
150 | 148 | ||
149 | def siteinfo_data(d): | ||
150 | return siteinfo_data_for_machine(d.getVar("HOST_ARCH"), d.getVar("HOST_OS"), d) | ||
151 | |||
151 | python () { | 152 | python () { |
152 | sitedata = set(siteinfo_data(d)) | 153 | sitedata = set(siteinfo_data(d)) |
153 | if "endian-little" in sitedata: | 154 | if "endian-little" in sitedata: |