[oe-commits] Richard Purdie : autotools.bbclass: Fix m4 file race

git version control git at git.openembedded.org
Wed Aug 3 16:47:31 UTC 2011


Module: openembedded-core.git
Branch: master
Commit: 6a4778e21341f031569f561e7699d2c616b60af0
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=6a4778e21341f031569f561e7699d2c616b60af0

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Wed Aug  3 16:06:43 2011 +0100

autotools.bbclass: Fix m4 file race

If something removes .m4 files from the aclocal directory whilst aclocal is
running it gets upset. To avoid this we need to take a copy of the aclocal
directory and build against this instead.

[YOCTO #861]

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/autotools.bbclass |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index e5c13ae..8f65b70 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -111,8 +111,13 @@ autotools_do_configure() {
 			if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then
 				acpaths="$acpaths -I${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV"
 			fi
+			# The aclocal directory could get modified by other processes 
+			# uninstalling data from the sysroot. See Yocto #861 for details.
+			# We avoid this by taking a copy here and then files cannot disappear.
 			if [ -d ${STAGING_DATADIR}/aclocal ]; then
-				acpaths="$acpaths -I ${STAGING_DATADIR}/aclocal"
+				mkdir -p ${B}/aclocal-copy/
+				cp ${STAGING_DATADIR}/aclocal/* ${B}/aclocal-copy/
+				acpaths="$acpaths -I ${B}/aclocal-copy/"
 			fi
 			# autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
 			# like it was auto-generated.  Work around this by blowing it away





More information about the Openembedded-commits mailing list