1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 00:59:48 +00:00

autotools: Limit aclocal files to those in dependencies

We still occasionally see race issues with cp-noerror, and it copies
too many files, we should limit the the m4 files to those explicitly in
the DEPENDS for the recipe.

This change takes advantage of the BB_TASKDEPDATA data from bitbake to
only copy in those files listed in the manifest of the recipes in DEPENDS.

I've had this testing locally for some time, its ready for wider
review/testing.

(From OE-Core rev: 79ea036de331bde65a88fb777647dc099ef05acf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2014-03-02 17:36:38 +00:00
parent b2d55fa5b5
commit b924b499ec
+39 -17
View File
@@ -130,28 +130,51 @@ autotools_postconfigure(){
EXTRACONFFUNCS ??= "" EXTRACONFFUNCS ??= ""
do_configure[prefuncs] += "autotools_preconfigure ${EXTRACONFFUNCS}" do_configure[prefuncs] += "autotools_preconfigure autotools_copy_aclocals ${EXTRACONFFUNCS}"
do_configure[postfuncs] += "autotools_postconfigure" do_configure[postfuncs] += "autotools_postconfigure"
ACLOCALDIR = "${B}/aclocal-copy" ACLOCALDIR = "${B}/aclocal-copy"
autotools_copy_aclocal () { python autotools_copy_aclocals () {
# Remove any previous copy of the m4 macros s = d.getVar("S", True)
rm -rf ${ACLOCALDIR}/ if not os.path.exists(s + "/configure.in") and not os.path.exists(s + "/configure.ac"):
return
# The aclocal directory could get modified by other processes taskdepdata = d.getVar("BB_TASKDEPDATA", False)
# uninstalling data from the sysroot. See Yocto #861 for details. pn = d.getVar("PN", True)
# We avoid this by taking a copy here and then files cannot disappear. aclocaldir = d.getVar("ACLOCALDIR", True)
# We copy native first, then target. This avoids certain races since cp-noerror oe.path.remove(aclocaldir)
# won't overwrite existing files. bb.utils.mkdirhier(aclocaldir)
mkdir -p ${ACLOCALDIR}/ configuredeps = []
if [ -d ${STAGING_DATADIR_NATIVE}/aclocal ]; then for dep in taskdepdata:
cp-noerror ${STAGING_DATADIR_NATIVE}/aclocal/ ${ACLOCALDIR}/ data = taskdepdata[dep]
fi if data[1] == "do_configure" and data[0] != pn:
if [ -d ${STAGING_DATADIR}/aclocal -a "${STAGING_DATADIR_NATIVE}/aclocal" != "${STAGING_DATADIR}/aclocal" ]; then configuredeps.append(data[0])
cp-noerror ${STAGING_DATADIR}/aclocal/ ${ACLOCALDIR}/
fi cp = []
for c in configuredeps:
if c.endswith("-native"):
manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}-%s.populate_sysroot" % c)
elif c.startswith("nativesdk-"):
manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${SDK_ARCH}-%s.populate_sysroot" % c)
elif c.endswith("-cross") or c.endswith("-cross-initial") or c.endswith("-crosssdk") or c.endswith("-crosssdk-initial"):
continue
else:
manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${MACHINE}-%s.populate_sysroot" % c)
try:
f = open(manifest, "r")
for l in f:
if "/aclocal/" in l and l.strip().endswith(".m4"):
cp.append(l.strip())
except:
bb.warn("%s not found" % manifest)
for c in cp:
t = os.path.join(aclocaldir, os.path.basename(c))
if not os.path.exists(t):
os.symlink(c, t)
} }
autotools_copy_aclocals[vardepsexclude] += "MACHINE"
autotools_do_configure() { autotools_do_configure() {
# WARNING: gross hack follows: # WARNING: gross hack follows:
@@ -168,7 +191,6 @@ autotools_do_configure() {
if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
olddir=`pwd` olddir=`pwd`
cd ${S} cd ${S}
autotools_copy_aclocal
ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/" ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/"
if [ x"${acpaths}" = xdefault ]; then if [ x"${acpaths}" = xdefault ]; then
acpaths= acpaths=