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