blob: 19e93761b3909ed7914299d475e572df75ae50b6 [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
Brad Bishopd7bf8c12018-02-25 22:55:05 -05006python waf_preconfigure() {
Brad Bishop316dfdd2018-06-25 12:45:53 -04007 import subprocess
Brad Bishopd7bf8c12018-02-25 22:55:05 -05008 from distutils.version import StrictVersion
Brad Bishop316dfdd2018-06-25 12:45:53 -04009 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 Bishopd7bf8c12018-02-25 22:55:05 -050020}
21
22do_configure[prefuncs] += "waf_preconfigure"
23
Patrick Williamsc124f4f2015-09-15 14:41:29 -050024waf_do_configure() {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050025 ${S}/waf configure --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026}
27
Brad Bishop316dfdd2018-06-25 12:45:53 -040028do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029waf_do_compile() {
Brad Bishop316dfdd2018-06-25 12:45:53 -040030 ${S}/waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031}
32
33waf_do_install() {
34 ${S}/waf install --destdir=${D}
35}
36
37EXPORT_FUNCTIONS do_configure do_compile do_install