Merge oe-devel@oe-devel.bkbits.net:openembedded
authorChris Larson <clarson@kergoth.com>
Wed, 9 Feb 2005 23:41:53 +0000 (23:41 +0000)
committerChris Larson <clarson@kergoth.com>
Wed, 9 Feb 2005 23:41:53 +0000 (23:41 +0000)
into odin.sc.ti.com:/home/kergoth/code/user/oe/openembedded

2005/02/09 17:41:25-06:00 ti.com!kergoth
- At the beginning of a build, display an 'OE Build Configuration',
  showing some important variables and their values, to make it easy
  to spot an incorrect setup.
- Change the default TARGET_ARCH and TARGET_OS to no longer be the BUILD
  versions.  It used to make sense, given the primary configuration file
  resided in the core.  Now that its in our metadata, we can change that,
  and also make the build abort with an obvious error if either are not set.

BKrev: 420a9fc1QNq7YE9IOvWAuHnCbfBZuw

classes/base.bbclass
conf/bitbake.conf

index a2ed7a7..e6f8e43 100644 (file)
@@ -491,6 +491,23 @@ python base_eventhandler() {
        elif name == "UnsatisfiedDep":
                msg += "package %s: dependency %s %s" % (e.pkg, e.dep, name[:-3].lower())
        note(msg)
+
+       if name.startswith("BuildStarted"):
+               statusvars = ['TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO',
+                             'TARGET_FPU']
+               statuslines = ["%-13s = \"%s\"" % (i, bb.data.getVar(i, e.data, 1) or '') for i in statusvars]
+               statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines)
+               print statusmsg
+
+               needed_vars = [ "TARGET_ARCH", "TARGET_OS" ]
+               pesteruser = []
+               for v in needed_vars:
+                       val = bb.data.getVar(v, e.data, 1)
+                       if not val or val == 'INVALID':
+                               pesteruser.append(v)
+               if pesteruser:
+                       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))
+
        if not data in e.__dict__:
                return NotHandled
 
@@ -499,6 +516,7 @@ python base_eventhandler() {
                logfile = file(log, "a")
                logfile.write("%s\n" % msg)
                logfile.close()
+
        return NotHandled
 }
 
index 8bd4719..7c91245 100644 (file)
@@ -37,8 +37,8 @@ HOST_SYS = "${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}"
 HOST_PREFIX = "${TARGET_PREFIX}"
 HOST_CC_ARCH = "${TARGET_CC_ARCH}"
 
-TARGET_ARCH = "${BUILD_ARCH}"
-TARGET_OS = "${BUILD_OS}"
+TARGET_ARCH = "INVALID"
+TARGET_OS = "INVALID"
 TARGET_VENDOR = "${BUILD_VENDOR}"
 TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
 TARGET_PREFIX = "${TARGET_SYS}-"