diff options
Diffstat (limited to 'meta/classes/waf.bbclass')
-rw-r--r-- | meta/classes/waf.bbclass | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass index 8e6d754c29..900244004e 100644 --- a/meta/classes/waf.bbclass +++ b/meta/classes/waf.bbclass | |||
@@ -5,6 +5,32 @@ B = "${WORKDIR}/build" | |||
5 | 5 | ||
6 | EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}" | 6 | EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}" |
7 | 7 | ||
8 | def waflock_hash(d): | ||
9 | # Calculates the hash used for the waf lock file. This should include | ||
10 | # all of the user controllable inputs passed to waf configure. Note | ||
11 | # that the full paths for ${B} and ${S} are used; this is OK and desired | ||
12 | # because a change to either of these should create a unique lock file | ||
13 | # to prevent collisions. | ||
14 | import hashlib | ||
15 | h = hashlib.sha512() | ||
16 | def update(name): | ||
17 | val = d.getVar(name) | ||
18 | if val is not None: | ||
19 | h.update(val.encode('utf-8')) | ||
20 | update('S') | ||
21 | update('B') | ||
22 | update('prefix') | ||
23 | update('EXTRA_OECONF') | ||
24 | return h.hexdigest() | ||
25 | |||
26 | # Use WAFLOCK to specify a separate lock file. The build is already | ||
27 | # sufficiently isolated by setting the output directory, this ensures that | ||
28 | # bitbake won't step on toes of any other configured context in the source | ||
29 | # directory (e.g. if the source is coming from externalsrc and was previously | ||
30 | # configured elsewhere). | ||
31 | export WAFLOCK = ".lock-waf_oe_${@waflock_hash(d)}_build" | ||
32 | BB_HASHBASE_WHITELIST += "WAFLOCK" | ||
33 | |||
8 | python waf_preconfigure() { | 34 | python waf_preconfigure() { |
9 | import subprocess | 35 | import subprocess |
10 | from distutils.version import StrictVersion | 36 | from distutils.version import StrictVersion |