]> code.ossystems Code Review - openembedded-core.git/commitdiff
autotools.bbclass: Fix m4 file race
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 3 Aug 2011 15:06:43 +0000 (16:06 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 3 Aug 2011 16:40:23 +0000 (17:40 +0100)
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@linuxfoundation.org>
meta/classes/autotools.bbclass

index e5c13ae691cc0be9cefc98778b33e0156efe3733..8f65b709fd52770196e938ce58ba6f3980e64bd6 100644 (file)
@@ -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