Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] autotools.bbclass: Fix gettext macro versions issues
Date: Wed, 17 Oct 2012 15:21:39 +0100	[thread overview]
Message-ID: <1350483699.2185.80.camel@ted> (raw)

gettext m4 macros don't use the usual versioning/serial mechanism used by
aclocal. It therefore won't update them over and above any local version of
the macro. Equally, we don't run gettextize due to it doing slightly crazy
things to the build.

When we put the aclocal directory as a -I option to aclocal, if this was
found first compared to any recipe provided macros, the correct version
of the gettext macro would still "win". With the switch so correctly override
the system directory, older recipe provided macros may get used.

This patch manually removes the problematic m4 macros in the case we're using
gettext and need to use the correct m4 macros.

This patch also always ensures the gettext manipulations happen, even in the
-native case since missing or stale gettext files could cause build failures.

(From OE-Core rev: e9645d2bbeabaa5251d49edd659ab320fd66d0ee)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index 7c99bbd..59c5bae 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -166,21 +166,24 @@ autotools_do_configure() {
 		else
 			CONFIGURE_AC=configure.ac
 		fi
-		if ! echo ${EXTRA_OECONF} | grep -q "\-\-disable-nls"; then
-			if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
-				if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
-					: do nothing -- we still have an old unmodified configure.ac
-		    		else
-					bbnote Executing glib-gettextize --force --copy
-					echo "no" | glib-gettextize --force --copy
-				fi
-			else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
-				# We'd call gettextize here if it wasn't so broken...
-					cp ${STAGING_DATADIR}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
-					if [ -d ${S}/po/ -a ! -e ${S}/po/Makefile.in.in ]; then
-						cp ${STAGING_DATADIR}/gettext/po/Makefile.in.in ${S}/po/
-					fi
+		if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
+			if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
+				: do nothing -- we still have an old unmodified configure.ac
+	    		else
+				bbnote Executing glib-gettextize --force --copy
+				echo "no" | glib-gettextize --force --copy
+			fi
+		else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
+			# We'd call gettextize here if it wasn't so broken...
+				cp ${STAGING_DATADIR}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
+				if [ -d ${S}/po/ ]; then
+					cp ${STAGING_DATADIR}/gettext/po/Makefile.in.in ${S}/po/
 				fi
+				for i in gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4; do
+					for j in `find ${S} -name $i | grep -v aclocal-copy`; do
+						rm $j
+					done
+				done
 			fi
 		fi
 		mkdir -p m4





             reply	other threads:[~2012-10-17 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17 14:21 Richard Purdie [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-10-11 10:02 [PATCH] autotools.bbclass: Fix gettext macro versions issues Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350483699.2185.80.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox