summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorChristopher Larson <kergoth@gmail.com>2012-04-26 23:32:31 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-03 15:48:01 +0100
commit5d540ca3142b24f3d181bb712b0905cfd1a7af4b (patch)
treeb573fd418fc812e295bbb6b5d0cb7f29d28c630c /meta/classes/base.bbclass
parentb877b1a8bfae609a37fd865017d41c1824c63944 (diff)
downloadpoky-5d540ca3142b24f3d181bb712b0905cfd1a7af4b.tar.gz
bitbake.conf: shift build config summary control to here
(From OE-Core rev: 164df0708d9add81be7d1fd56d487253062756d8) Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass50
1 files changed, 34 insertions, 16 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index a984eae5bc..07ef9a2316 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -225,6 +225,27 @@ def get_layers_branch_rev(d):
225 return layers_branch_rev 225 return layers_branch_rev
226 226
227 227
228BUILDCFG_FUNCS ??= "buildcfg_vars get_layers_branch_rev buildcfg_neededvars"
229BUILDCFG_FUNCS[type] = "list"
230
231def buildcfg_vars(d):
232 statusvars = oe.data.typed_value('BUILDCFG_VARS', d)
233 for var in statusvars:
234 value = d.getVar(var, True)
235 if value is not None:
236 yield '%-17s = "%s"' % (var, value)
237
238def buildcfg_neededvars(d):
239 needed_vars = oe.data.typed_value("BUILDCFG_NEEDEDVARS", d)
240 pesteruser = []
241 for v in needed_vars:
242 val = d.getVar(v, True)
243 if not val or val == 'INVALID':
244 pesteruser.append(v)
245
246 if pesteruser:
247 bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
248
228addhandler base_eventhandler 249addhandler base_eventhandler
229python base_eventhandler() { 250python base_eventhandler() {
230 from bb.event import getName 251 from bb.event import getName
@@ -232,22 +253,19 @@ python base_eventhandler() {
232 name = getName(e) 253 name = getName(e)
233 254
234 if name.startswith("BuildStarted"): 255 if name.startswith("BuildStarted"):
235 e.data.setVar( 'BB_VERSION', bb.__version__) 256 e.data.setVar('BB_VERSION', bb.__version__)
236 statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TUNE_FEATURES', 'TARGET_FPU'] 257 statuslines = []
237 statuslines = ["%-17s = \"%s\"" % (i, e.data.getVar(i, True) or '') for i in statusvars] 258 for func in oe.data.typed_value('BUILDCFG_FUNCS', e.data):
238 259 g = globals()
239 statuslines += get_layers_branch_rev(e.data) 260 if func not in g:
240 statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines) 261 bb.warn("Build configuration function '%s' does not exist" % func)
241 bb.plain(statusmsg) 262 else:
242 263 flines = g[func](e.data)
243 needed_vars = [ "TARGET_ARCH", "TARGET_OS" ] 264 if flines:
244 pesteruser = [] 265 statuslines.extend(flines)
245 for v in needed_vars: 266
246 val = e.data.getVar(v, True) 267 statusheader = e.data.getVar('BUILDCFG_HEADER', True)
247 if not val or val == 'INVALID': 268 bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
248 pesteruser.append(v)
249 if pesteruser:
250 bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
251 269
252 if name == "ConfigParsed": 270 if name == "ConfigParsed":
253 generate_git_config(e) 271 generate_git_config(e)