diff options
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/autotools.bbclass | 67 |
1 files changed, 48 insertions, 19 deletions
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass index 5fda03df80..4c32c84fa8 100644 --- a/meta/classes/autotools.bbclass +++ b/meta/classes/autotools.bbclass | |||
@@ -137,6 +137,8 @@ do_configure[postfuncs] += "autotools_postconfigure" | |||
137 | ACLOCALDIR = "${WORKDIR}/aclocal-copy" | 137 | ACLOCALDIR = "${WORKDIR}/aclocal-copy" |
138 | 138 | ||
139 | python autotools_copy_aclocals () { | 139 | python autotools_copy_aclocals () { |
140 | import copy | ||
141 | |||
140 | s = d.getVar("AUTOTOOLS_SCRIPT_PATH", True) | 142 | s = d.getVar("AUTOTOOLS_SCRIPT_PATH", True) |
141 | if not os.path.exists(s + "/configure.in") and not os.path.exists(s + "/configure.ac"): | 143 | if not os.path.exists(s + "/configure.in") and not os.path.exists(s + "/configure.ac"): |
142 | if not d.getVar("AUTOTOOLS_COPYACLOCAL", False): | 144 | if not d.getVar("AUTOTOOLS_COPYACLOCAL", False): |
@@ -165,36 +167,63 @@ python autotools_copy_aclocals () { | |||
165 | if start is None: | 167 | if start is None: |
166 | bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?") | 168 | bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?") |
167 | 169 | ||
168 | # We need to find configure tasks which are either from <target> -> <target> | 170 | # We need to figure out which m4 files we need to expose to this do_configure task. |
169 | # or <native> -> <native> but not <target> -> <native> unless they're direct | 171 | # This needs to match what would get restored from sstate, which is controlled |
170 | # dependencies. This mirrors what would get restored from sstate. | 172 | # ultimately by calls from bitbake to setscene_depvalid(). |
171 | done = [start] | 173 | # That function expects a setscene dependency tree. We build a dependency tree |
172 | next = [start] | 174 | # condensed to do_populate_sysroot -> do_populate_sysroot dependencies, similar to |
175 | # that used by setscene tasks. We can then call into setscene_depvalid() and decide | ||
176 | # which dependencies we can "see" and should expose the m4 files for. | ||
177 | setscenedeps = copy.deepcopy(taskdepdata) | ||
178 | |||
179 | start = set([start]) | ||
180 | |||
181 | # Create collapsed do_populate_sysroot -> do_populate_sysroot tree | ||
182 | for dep in taskdepdata: | ||
183 | data = setscenedeps[dep] | ||
184 | if data[1] != "do_populate_sysroot": | ||
185 | for dep2 in setscenedeps: | ||
186 | data2 = setscenedeps[dep2] | ||
187 | if dep in data2[3]: | ||
188 | data2[3].update(setscenedeps[dep][3]) | ||
189 | data2[3].remove(dep) | ||
190 | if dep in start: | ||
191 | start.update(setscenedeps[dep][3]) | ||
192 | start.remove(dep) | ||
193 | del setscenedeps[dep] | ||
194 | |||
195 | # Remove circular references | ||
196 | for dep in setscenedeps: | ||
197 | if dep in setscenedeps[dep][3]: | ||
198 | setscenedeps[dep][3].remove(dep) | ||
199 | |||
200 | # Direct dependencies should be present and can be depended upon | ||
201 | for dep in start: | ||
202 | configuredeps.append(setscenedeps[dep][0]) | ||
203 | |||
204 | # Call into setscene_depvalid for each sub-dependency and only copy m4 files | ||
205 | # for ones that would be restored from sstate. | ||
206 | done = list(start) | ||
207 | next = list(start) | ||
173 | while next: | 208 | while next: |
174 | new = [] | 209 | new = [] |
175 | for dep in next: | 210 | for dep in next: |
176 | data = taskdepdata[dep] | 211 | data = setscenedeps[dep] |
177 | for datadep in data[3]: | 212 | for datadep in data[3]: |
178 | if datadep in done: | 213 | if datadep in done: |
179 | continue | 214 | continue |
180 | if (not data[0].endswith("-native")) and taskdepdata[datadep][0].endswith("-native") and dep != start: | 215 | taskdeps = {} |
216 | taskdeps[dep] = setscenedeps[dep][:2] | ||
217 | taskdeps[datadep] = setscenedeps[datadep][:2] | ||
218 | retval = setscene_depvalid(datadep, taskdeps, [], d) | ||
219 | if retval: | ||
220 | bb.note("Skipping setscene dependency %s for m4 macro copying" % datadep) | ||
181 | continue | 221 | continue |
182 | done.append(datadep) | 222 | done.append(datadep) |
183 | new.append(datadep) | 223 | new.append(datadep) |
184 | if taskdepdata[datadep][1] == "do_configure": | 224 | configuredeps.append(setscenedeps[datadep][0]) |
185 | configuredeps.append(taskdepdata[datadep][0]) | ||
186 | next = new | 225 | next = new |
187 | 226 | ||
188 | #configuredeps2 = [] | ||
189 | #for dep in taskdepdata: | ||
190 | # data = taskdepdata[dep] | ||
191 | # if data[1] == "do_configure" and data[0] != pn: | ||
192 | # configuredeps2.append(data[0]) | ||
193 | #configuredeps.sort() | ||
194 | #configuredeps2.sort() | ||
195 | #bb.warn(str(configuredeps)) | ||
196 | #bb.warn(str(configuredeps2)) | ||
197 | |||
198 | cp = [] | 227 | cp = [] |
199 | if nodeps: | 228 | if nodeps: |
200 | bb.warn("autotools: Unable to find task dependencies, -b being used? Pulling in all m4 files") | 229 | bb.warn("autotools: Unable to find task dependencies, -b being used? Pulling in all m4 files") |