summaryrefslogtreecommitdiff
path: root/meta/classes/waf.bbclass
blob: 95f524012ab8b38ecafbd3d7abf74a6bd59e2861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# avoids build breaks when using no-static-libs.inc
DISABLE_STATIC = ""

def get_waf_parallel_make(d):
    pm = d.getVar('PARALLEL_MAKE')
    if pm:
        # look for '-j' and throw other options (e.g. '-l') away
        # because they might have different meaning in bjam
        pm = pm.split()
        while pm:
            v = None
            opt = pm.pop(0)
            if opt == '-j':
                v = pm.pop(0)
            elif opt.startswith('-j'):
                v = opt[2:].strip()
            else:
                v = None

            if v:
                v = min(64, int(v))
                return '-j' + str(v)

    return ""

waf_do_configure() {
	${S}/waf configure --prefix=${prefix} ${EXTRA_OECONF}
}

waf_do_compile()  {
	${S}/waf build ${@get_waf_parallel_make(d)}
}

waf_do_install() {
	${S}/waf install --destdir=${D}
}

EXPORT_FUNCTIONS do_configure do_compile do_install