blob: acbda278a2c2215ecfa278fa3cbbe5ee4b20b578 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001# avoids build breaks when using no-static-libs.inc
2DISABLE_STATIC = ""
3
Brad Bishop6e60e8b2018-02-01 10:27:11 -05004EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}"
5
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05006def get_waf_parallel_make(d):
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007 pm = d.getVar('PARALLEL_MAKE')
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05008 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 Bishopd7bf8c12018-02-25 22:55:05 -050028python 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
41do_configure[prefuncs] += "waf_preconfigure"
42
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043waf_do_configure() {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050044 ${S}/waf configure --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045}
46
47waf_do_compile() {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050048 ${S}/waf build ${@get_waf_parallel_make(d)}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049}
50
51waf_do_install() {
52 ${S}/waf install --destdir=${D}
53}
54
55EXPORT_FUNCTIONS do_configure do_compile do_install