diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-02 17:36:38 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-05 15:50:19 +0000 |
commit | b924b499ecd28bb433a12fb327f0e63d66db97b5 (patch) | |
tree | 5023fbc0b6ca49646f1828fce88ffe9f196e4f2a | |
parent | b2d55fa5b5bc991c62e982eb53d99408c769656a (diff) | |
download | poky-b924b499ecd28bb433a12fb327f0e63d66db97b5.tar.gz |
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>
-rw-r--r-- | meta/classes/autotools.bbclass | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass index 883eb06e26..01e49c98bf 100644 --- a/meta/classes/autotools.bbclass +++ b/meta/classes/autotools.bbclass | |||
@@ -130,28 +130,51 @@ autotools_postconfigure(){ | |||
130 | 130 | ||
131 | EXTRACONFFUNCS ??= "" | 131 | EXTRACONFFUNCS ??= "" |
132 | 132 | ||
133 | do_configure[prefuncs] += "autotools_preconfigure ${EXTRACONFFUNCS}" | 133 | do_configure[prefuncs] += "autotools_preconfigure autotools_copy_aclocals ${EXTRACONFFUNCS}" |
134 | do_configure[postfuncs] += "autotools_postconfigure" | 134 | do_configure[postfuncs] += "autotools_postconfigure" |
135 | 135 | ||
136 | ACLOCALDIR = "${B}/aclocal-copy" | 136 | ACLOCALDIR = "${B}/aclocal-copy" |
137 | 137 | ||
138 | autotools_copy_aclocal () { | 138 | python autotools_copy_aclocals () { |
139 | # Remove any previous copy of the m4 macros | 139 | s = d.getVar("S", True) |
140 | rm -rf ${ACLOCALDIR}/ | 140 | if not os.path.exists(s + "/configure.in") and not os.path.exists(s + "/configure.ac"): |
141 | 141 | return | |
142 | # The aclocal directory could get modified by other processes | 142 | |
143 | # uninstalling data from the sysroot. See Yocto #861 for details. | 143 | taskdepdata = d.getVar("BB_TASKDEPDATA", False) |
144 | # We avoid this by taking a copy here and then files cannot disappear. | 144 | pn = d.getVar("PN", True) |
145 | # We copy native first, then target. This avoids certain races since cp-noerror | 145 | aclocaldir = d.getVar("ACLOCALDIR", True) |
146 | # won't overwrite existing files. | 146 | oe.path.remove(aclocaldir) |
147 | mkdir -p ${ACLOCALDIR}/ | 147 | bb.utils.mkdirhier(aclocaldir) |
148 | if [ -d ${STAGING_DATADIR_NATIVE}/aclocal ]; then | 148 | configuredeps = [] |
149 | cp-noerror ${STAGING_DATADIR_NATIVE}/aclocal/ ${ACLOCALDIR}/ | 149 | for dep in taskdepdata: |
150 | fi | 150 | data = taskdepdata[dep] |
151 | if [ -d ${STAGING_DATADIR}/aclocal -a "${STAGING_DATADIR_NATIVE}/aclocal" != "${STAGING_DATADIR}/aclocal" ]; then | 151 | if data[1] == "do_configure" and data[0] != pn: |
152 | cp-noerror ${STAGING_DATADIR}/aclocal/ ${ACLOCALDIR}/ | 152 | configuredeps.append(data[0]) |
153 | fi | 153 | |
154 | cp = [] | ||
155 | for c in configuredeps: | ||
156 | if c.endswith("-native"): | ||
157 | manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}-%s.populate_sysroot" % c) | ||
158 | elif c.startswith("nativesdk-"): | ||
159 | manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${SDK_ARCH}-%s.populate_sysroot" % c) | ||
160 | elif c.endswith("-cross") or c.endswith("-cross-initial") or c.endswith("-crosssdk") or c.endswith("-crosssdk-initial"): | ||
161 | continue | ||
162 | else: | ||
163 | manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${MACHINE}-%s.populate_sysroot" % c) | ||
164 | try: | ||
165 | f = open(manifest, "r") | ||
166 | for l in f: | ||
167 | if "/aclocal/" in l and l.strip().endswith(".m4"): | ||
168 | cp.append(l.strip()) | ||
169 | except: | ||
170 | bb.warn("%s not found" % manifest) | ||
171 | |||
172 | for c in cp: | ||
173 | t = os.path.join(aclocaldir, os.path.basename(c)) | ||
174 | if not os.path.exists(t): | ||
175 | os.symlink(c, t) | ||
154 | } | 176 | } |
177 | autotools_copy_aclocals[vardepsexclude] += "MACHINE" | ||
155 | 178 | ||
156 | autotools_do_configure() { | 179 | autotools_do_configure() { |
157 | # WARNING: gross hack follows: | 180 | # WARNING: gross hack follows: |
@@ -168,7 +191,6 @@ autotools_do_configure() { | |||
168 | if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then | 191 | if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then |
169 | olddir=`pwd` | 192 | olddir=`pwd` |
170 | cd ${S} | 193 | cd ${S} |
171 | autotools_copy_aclocal | ||
172 | ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/" | 194 | ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/" |
173 | if [ x"${acpaths}" = xdefault ]; then | 195 | if [ x"${acpaths}" = xdefault ]; then |
174 | acpaths= | 196 | acpaths= |