Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | # avoids build breaks when using no-static-libs.inc |
| 2 | DISABLE_STATIC = "" |
| 3 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 4 | EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}" |
| 5 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 6 | python waf_preconfigure() { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 7 | import subprocess |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 8 | from distutils.version import StrictVersion |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 9 | subsrcdir = d.getVar('S') |
| 10 | wafbin = os.path.join(subsrcdir, 'waf') |
| 11 | try: |
| 12 | result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT) |
| 13 | version = result.decode('utf-8').split()[1] |
| 14 | if StrictVersion(version) >= StrictVersion("1.8.7"): |
| 15 | d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}") |
| 16 | except subprocess.CalledProcessError as e: |
| 17 | bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % e.returncode) |
| 18 | except FileNotFoundError: |
| 19 | bb.fatal("waf does not exist in %s" % subsrcdir) |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | do_configure[prefuncs] += "waf_preconfigure" |
| 23 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 24 | waf_do_configure() { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 25 | ${S}/waf configure --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | } |
| 27 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 28 | do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 29 | waf_do_compile() { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 30 | ${S}/waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | waf_do_install() { |
| 34 | ${S}/waf install --destdir=${D} |
| 35 | } |
| 36 | |
| 37 | EXPORT_FUNCTIONS do_configure do_compile do_install |