summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2006-04-09 14:40:06 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-04-09 14:40:06 +0000
commita5c3a9436b228963eb6a55bc400b63b4de00a50d (patch)
treea98d9873ca01b51b7cb35458386dcf6dbb3d8bfe /classes
parent7f1876ad185bce0c40b9782b3890fe453ac7c2c9 (diff)
parent6c017fb69b4276eb50a578aad2a279567bcaf7e1 (diff)
merge of b40b9fb8b17f69ba321fa34167b8ddb37dc72ec2
and e6a2ccb39d3b001fdcc1071ba1860678a1fe8647
Diffstat (limited to 'classes')
-rw-r--r--classes/sanity.bbclass64
1 files changed, 45 insertions, 19 deletions
diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass
index f82af18d74..f03564c607 100644
--- a/classes/sanity.bbclass
+++ b/classes/sanity.bbclass
@@ -2,11 +2,9 @@
# Sanity check the users setup for common misconfigurations
#
-BB_MIN_VERSION = "1.3.3"
-
def raise_sanity_error(msg):
import bb
- bb.fatal("Openembedded's config sanity checker detected a potential misconfiguration.\nEither fix cause of this error or at your own risk disable the checker (see sanity.conf).\n%s" % msg)
+ bb.fatal("Openembedded's config sanity checker detected a potential misconfiguration.\nEither fix the cause of this error or at your own risk disable the checker (see sanity.conf).\n%s" % msg)
def check_conf_exists(fn, data):
import bb, os
@@ -22,37 +20,41 @@ def check_conf_exists(fn, data):
return True
return False
-addhandler check_sanity_eventhandler
-python check_sanity_eventhandler() {
+def check_app_exists(app, d):
+ from bb import which, data
+
+ app = data.expand(app, d)
+ path = data.getVar('PATH', d)
+ return len(which(path, app)) != 0
+
+
+def check_sanity(e):
from bb import note, error, data, __version__
from bb.event import Handled, NotHandled, getName
from distutils.version import LooseVersion
import os
- sanity_checked = bb.data.getVar('SANITY_CHECKED', e.data)
- if sanity_checked == "1":
- return
-
# Check the bitbake version meets minimum requirements
- minversion = bb.data.getVar('BB_MIN_VERSION', e.data , True)
+ minversion = data.getVar('BB_MIN_VERSION', e.data , True)
if not minversion:
# Hack: BB_MIN_VERSION hasn't been parsed yet so return
# and wait for the next call
+ print "Foo %s" % minversion
return
- if (LooseVersion(bb.__version__) < LooseVersion(minversion)):
- raise_sanity_error('Bitbake version %s is required and version %s was found' % (minversion, bb.__version__))
+ if (LooseVersion(__version__) < LooseVersion(minversion)):
+ raise_sanity_error('Bitbake version %s is required and version %s was found' % (minversion, __version__))
# Check TARGET_ARCH is set
- if bb.data.getVar('TARGET_ARCH', e.data, True) == 'INVALID':
+ if data.getVar('TARGET_ARCH', e.data, True) == 'INVALID':
raise_sanity_error('Please set TARGET_ARCH directly, or choose a MACHINE or DISTRO that does so.')
# Check TARGET_OS is set
- if bb.data.getVar('TARGET_OS', e.data, True) == 'INVALID':
+ if data.getVar('TARGET_OS', e.data, True) == 'INVALID':
raise_sanity_error('Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.')
# Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf
- if "diffstat-native" not in bb.data.getVar('ASSUME_PROVIDED', e.data, True).split():
+ if "diffstat-native" not in data.getVar('ASSUME_PROVIDED', e.data, True).split():
raise_sanity_error('Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf')
# Check the MACHINE is valid
@@ -62,8 +64,32 @@ python check_sanity_eventhandler() {
# Check the distro is valid
if not check_conf_exists("conf/distro/${DISTRO}.conf", e.data):
raise_sanity_error('Please set a valid DISTRO in your local.conf')
-
- bb.data.setVar('SANITY_CHECKED', "1", e.data)
- return
-}
+ if not check_app_exists("${MAKE}", e.data):
+ raise_sanity_error('GNU make missing. Please install GNU make')
+
+ if not check_app_exists('${BUILD_PREFIX}gcc', e.data):
+ raise_sanity_error('C Host-Compiler is missing, please install one' )
+
+ if not check_app_exists('${BUILD_PREFIX}g++', e.data):
+ raise_sanity_error('C++ Host-Compiler is missing, please install one' )
+
+ if not check_app_exists('patch', e.data):
+ raise_sanity_error('Please install the patch utility, preferable GNU patch.')
+
+ if not check_app_exists('diffstat', e.data):
+ raise_sanity_error('Please install the diffstat utilits')
+
+ if not check_app_exists('texi2html', e.data):
+ raise_sanity_error('Please install the texi2html binary')
+
+addhandler check_sanity_eventhandler
+python check_sanity_eventhandler() {
+ from bb import note, error, data, __version__
+ from bb.event import getName
+
+ if getName(e) == "BuildStarted":
+ check_sanity(e)
+
+ return NotHandled
+}