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 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 6 | def get_waf_parallel_make(d): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 7 | pm = d.getVar('PARALLEL_MAKE') |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 8 | if pm: |
| 9 | # look for '-j' and throw other options (e.g. '-l') away |
| 10 | # because they might have different meaning in bjam |
| 11 | pm = pm.split() |
| 12 | while pm: |
| 13 | v = None |
| 14 | opt = pm.pop(0) |
| 15 | if opt == '-j': |
| 16 | v = pm.pop(0) |
| 17 | elif opt.startswith('-j'): |
| 18 | v = opt[2:].strip() |
| 19 | else: |
| 20 | v = None |
| 21 | |
| 22 | if v: |
| 23 | v = min(64, int(v)) |
| 24 | return '-j' + str(v) |
| 25 | |
| 26 | return "" |
| 27 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 28 | python waf_preconfigure() { |
| 29 | from distutils.version import StrictVersion |
| 30 | srcsubdir = d.getVar('S') |
| 31 | wafbin = os.path.join(srcsubdir, 'waf') |
| 32 | status, result = oe.utils.getstatusoutput(wafbin + " --version") |
| 33 | if status != 0: |
| 34 | bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % status) |
| 35 | return |
| 36 | version = result.split()[1] |
| 37 | if StrictVersion(version) >= StrictVersion("1.8.7"): |
| 38 | d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}") |
| 39 | } |
| 40 | |
| 41 | do_configure[prefuncs] += "waf_preconfigure" |
| 42 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 43 | waf_do_configure() { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 44 | ${S}/waf configure --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | waf_do_compile() { |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 48 | ${S}/waf build ${@get_waf_parallel_make(d)} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | waf_do_install() { |
| 52 | ${S}/waf install --destdir=${D} |
| 53 | } |
| 54 | |
| 55 | EXPORT_FUNCTIONS do_configure do_compile do_install |