autotools: Enhance gettext handling to better work with SCM versions of code

Submitted by Richard Purdie on Oct. 12, 2011, 1:42 p.m. | Patch ID: 13067


Message ID 1318426962.23801.168.camel@ted
State New, archived
Headers show

Commit Message

Richard Purdie Oct. 12, 2011, 1:42 p.m.
If we pull SCM based code using gettext, in the
po directory can be missing. We therefore need to add this if
its not already present. We could use gettextize if it wasn't
so broken (for example requiring user input on stdin and installing
way more files that we ever care about such as the m4 files).

We also have a problem if a recipe sets a different AUX dir, for
now fix this by allowing recipes to specify when this is being done
using the AUTOTOOLS_AUXDIR variable. Ultimately we could likely
figure this out automatically.

Signed-off-by: Richard Purdie <>

Patch hide | download patch | download mbox

diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index a4ce851..0413322 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -80,6 +80,8 @@  oe_runconf () {
 autotools_do_configure() {
 	case ${PN} in
@@ -144,7 +146,11 @@  autotools_do_configure() {
 			      echo "no" | glib-gettextize --force --copy
 			  else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
-			    cp ${STAGING_DATADIR}/gettext/config.rpath ${S}/
+                            # We'd call gettextize here if it wasn't so broken...
+			    cp ${STAGING_DATADIR}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
+			    if [ ! -e ${S}/po/ ]; then
+			      cp ${STAGING_DATADIR}/gettext/po/ ${S}/po/
+                            fi