diff options
-rw-r--r-- | meta/classes-recipe/waf.bbclass | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/meta/classes-recipe/waf.bbclass b/meta/classes-recipe/waf.bbclass index 70bf3be8fd..01707c8e2c 100644 --- a/meta/classes-recipe/waf.bbclass +++ b/meta/classes-recipe/waf.bbclass | |||
@@ -54,11 +54,21 @@ python waf_preconfigure() { | |||
54 | wafbin = os.path.join(subsrcdir, 'waf') | 54 | wafbin = os.path.join(subsrcdir, 'waf') |
55 | try: | 55 | try: |
56 | result = subprocess.check_output([python, wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT) | 56 | result = subprocess.check_output([python, wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT) |
57 | version = result.decode('utf-8').split()[1] | 57 | # Output looks like: |
58 | if not bb.utils.is_semver(version): | 58 | # # output from lower modules (e.g. warnings, ...) |
59 | # waf X.Y.Z ... | ||
60 | # So, look for the line starting with "waf " | ||
61 | version = None | ||
62 | for line in result.decode('utf-8').split("\n"): | ||
63 | if line.startswith("waf "): | ||
64 | version = line.split()[1] | ||
65 | break | ||
66 | |||
67 | if not version or not bb.utils.is_semver(version): | ||
59 | bb.warn("Unable to parse \"waf --version\" output. Assuming waf version without bindir/libdir support.") | 68 | bb.warn("Unable to parse \"waf --version\" output. Assuming waf version without bindir/libdir support.") |
60 | bb.warn("waf·--version·output = \n%s" % result.decode('utf-8')) | 69 | bb.warn("waf·--version·output = \n%s" % result.decode('utf-8')) |
61 | elif bb.utils.vercmp_string_op(version, "1.8.7", ">="): | 70 | elif bb.utils.vercmp_string_op(version, "1.8.7", ">="): |
71 | bb.note("waf version is high enough to add --bindir and --libdir") | ||
62 | d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}") | 72 | d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}") |
63 | except subprocess.CalledProcessError as e: | 73 | except subprocess.CalledProcessError as e: |
64 | bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % e.returncode) | 74 | bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % e.returncode) |