[oe-commits] Joshua Lock : gettext enhancements: Make it easier to use the right gettext

git version control git at git.openembedded.org
Wed May 5 23:34:45 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 12a05b660c12d2be2efd44db7372159ab62bd4fd
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=12a05b660c12d2be2efd44db7372159ab62bd4fd

Author: Joshua Lock <josh at linux.intel.com>
Date:   Wed Mar 31 12:19:58 2010 +0100

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 at linux.intel.com>

---

 classes/cross-canadian.bbclass |    2 ++
 classes/cross.bbclass          |    2 ++
 classes/gettext.bbclass        |    5 +++--
 classes/insane.bbclass         |   21 +++++++++++++++++++++
 classes/native.bbclass         |    1 +
 5 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/classes/cross-canadian.bbclass b/classes/cross-canadian.bbclass
index bd738ec..a149fd4 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 57b6e60..f95144c 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 b2ff284..a40e74f 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 af6cec3..2118a27 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 0381e83..b53ae1d 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 = ""





More information about the Openembedded-commits mailing list