diff options
-rw-r--r-- | meta/classes/waf.bbclass | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass index c3e744e5de..bdbdc56767 100644 --- a/meta/classes/waf.bbclass +++ b/meta/classes/waf.bbclass | |||
@@ -26,16 +26,17 @@ def get_waf_parallel_make(d): | |||
26 | return "" | 26 | return "" |
27 | 27 | ||
28 | python waf_preconfigure() { | 28 | python waf_preconfigure() { |
29 | import subprocess | ||
29 | from distutils.version import StrictVersion | 30 | from distutils.version import StrictVersion |
30 | srcsubdir = d.getVar('S') | 31 | subsrcdir = d.getVar('S') |
31 | wafbin = os.path.join(srcsubdir, 'waf') | 32 | wafbin = os.path.join(subsrcdir, 'waf') |
32 | status, result = oe.utils.getstatusoutput(wafbin + " --version") | 33 | try: |
33 | if status != 0: | 34 | result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT) |
34 | bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % status) | 35 | version = result.decode('utf-8').split()[1] |
35 | return | 36 | if StrictVersion(version) >= StrictVersion("1.8.7"): |
36 | version = result.split()[1] | 37 | d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}") |
37 | if StrictVersion(version) >= StrictVersion("1.8.7"): | 38 | except subprocess.CalledProcessError as e: |
38 | d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}") | 39 | bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % e.returncode) |
39 | } | 40 | } |
40 | 41 | ||
41 | do_configure[prefuncs] += "waf_preconfigure" | 42 | do_configure[prefuncs] += "waf_preconfigure" |