From 12a05b660c12d2be2efd44db7372159ab62bd4fd Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Wed, 31 Mar 2010 12:19:58 +0100 Subject: gettext enhancements: Make it easier to use the right gettext This patch adds a check to insane to ensure that gettext exists in the dependancy list when it is used in the configure.[ac|in] Further we enhance the gettext class to enable easy addition of the required gettext dependancies by inheriting the gettext class. Signed-off-by: Joshua Lock --- classes/insane.bbclass | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'classes/insane.bbclass') diff --git a/classes/insane.bbclass b/classes/insane.bbclass index af6cec3a96..2118a27fbd 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -456,6 +456,7 @@ python do_qa_staging() { # Check broken config.log files addtask qa_configure after do_configure before do_compile python do_qa_configure() { + configs = [] bb.debug(1, "Checking sanity of the config.log file") for root, dirs, files in os.walk(bb.data.getVar('WORKDIR', d, True)): statement = "grep 'CROSS COMPILE Badness:' %s > /dev/null" % \ @@ -464,4 +465,24 @@ python do_qa_configure() { if os.system(statement) == 0: bb.fatal("""This autoconf log indicates errors, it looked at host includes. Rerun configure task after fixing this. The path was '%s'""" % root) + + if "configure.ac" in files: + configs.append(os.path.join(root,"configure.ac")) + if "configure.in" in files: + configs.append(os.path.join(root, "configure.in")) + + if "gettext" not in bb.data.getVar('P', d, True): + if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('nativesdk', d): + gt = "gettext-native" + elif bb.data.inherits_class('cross-canadian', d): + gt = "gettext-nativesdk" + else: + gt = "gettext" + deps = bb.utils.explode_deps(bb.data.getVar('DEPENDS', d, True) or "") + if gt not in deps: + for config in configs: + gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config + if os.system(gnu) == 0: + bb.note("""Gettext required but not in DEPENDS for file %s. +Missing inherit gettext?""" % config) } -- cgit v1.2.3