diff options
author | Joshua Lock <josh@linux.intel.com> | 2010-03-31 12:19:58 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-05-05 15:05:40 +0100 |
commit | 12a05b660c12d2be2efd44db7372159ab62bd4fd (patch) | |
tree | b9e5cc9aa7cc90fd86ea22a1c8d82c557208ebf2 | |
parent | d1a8b276c0f7c2838816071bca797bb56fcccef7 (diff) |
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 <josh@linux.intel.com>
-rw-r--r-- | classes/cross-canadian.bbclass | 2 | ||||
-rw-r--r-- | classes/cross.bbclass | 2 | ||||
-rw-r--r-- | classes/gettext.bbclass | 5 | ||||
-rw-r--r-- | classes/insane.bbclass | 21 | ||||
-rw-r--r-- | classes/native.bbclass | 1 |
5 files changed, 29 insertions, 2 deletions
diff --git a/classes/cross-canadian.bbclass b/classes/cross-canadian.bbclass index bd738ecd4d..a149fd44b7 100644 --- a/classes/cross-canadian.bbclass +++ b/classes/cross-canadian.bbclass @@ -31,6 +31,8 @@ CFLAGS = "${BUILDSDK_CFLAGS}" CXXFLAGS = "${BUILDSDK_CFLAGS}" LDFLAGS = "${BUILDSDK_LDFLAGS}" +DEPENDS_GETTEXT = "gettext-native gettext-nativesdk" + # Change to place files in SDKPATH prefix = "${SDKPATH}" exec_prefix = "${SDKPATH}" diff --git a/classes/cross.bbclass b/classes/cross.bbclass index 57b6e6057f..f95144cfcb 100644 --- a/classes/cross.bbclass +++ b/classes/cross.bbclass @@ -35,6 +35,8 @@ LDFLAGS_build-darwin = "-L${STAGING_LIBDIR_NATIVE}" TOOLCHAIN_OPTIONS = "" +DEPENDS_GETTEXT = "gettext-native" + # Path mangling needed by the cross packaging # Note that we use := here to ensure that libdir and includedir are # target paths, not CROSS_DIR paths. diff --git a/classes/gettext.bbclass b/classes/gettext.bbclass index b2ff2849fa..a40e74f819 100644 --- a/classes/gettext.bbclass +++ b/classes/gettext.bbclass @@ -1,4 +1,3 @@ -DEPENDS =+ "gettext-native" def gettext_after_parse(d): # Remove the NLS bits if USE_NLS is no. if bb.data.getVar('USE_NLS', d, 1) == 'no': @@ -12,5 +11,7 @@ python () { gettext_after_parse(d) } -DEPENDS =+ "gettext-native" +DEPENDS_GETTEXT = "gettext gettext-native" + +DEPENDS =+ "${DEPENDS_GETTEXT}" EXTRA_OECONF += "--enable-nls" 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) } diff --git a/classes/native.bbclass b/classes/native.bbclass index 0381e83fc7..b53ae1d102 100644 --- a/classes/native.bbclass +++ b/classes/native.bbclass @@ -40,6 +40,7 @@ STAGING_BINDIR = "${STAGING_BINDIR_NATIVE}" STAGING_BINDIR_CROSS = "${STAGING_BINDIR_NATIVE}" STAGING_DIR_JAVA = "${STAGING_DATADIR_JAVA_NATIVE}" +DEPENDS_GETTEXT = "gettext-native" # Don't use site files for native builds export CONFIG_SITE = "" |