blob: 8e6d754c299bbcb0cd3d4ec038f9d1612eb7c069 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001# avoids build breaks when using no-static-libs.inc
2DISABLE_STATIC = ""
3
Brad Bishop19323692019-04-05 15:28:33 -04004B = "${WORKDIR}/build"
5
Brad Bishop6e60e8b2018-02-01 10:27:11 -05006EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}"
7
Brad Bishopd7bf8c12018-02-25 22:55:05 -05008python waf_preconfigure() {
Brad Bishop316dfdd2018-06-25 12:45:53 -04009 import subprocess
Brad Bishopd7bf8c12018-02-25 22:55:05 -050010 from distutils.version import StrictVersion
Brad Bishop316dfdd2018-06-25 12:45:53 -040011 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 Bishopd7bf8c12018-02-25 22:55:05 -050022}
23
24do_configure[prefuncs] += "waf_preconfigure"
25
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026waf_do_configure() {
Brad Bishop19323692019-04-05 15:28:33 -040027 (cd ${S} && ./waf configure -o ${B} --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF})
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028}
29
Brad Bishop316dfdd2018-06-25 12:45:53 -040030do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031waf_do_compile() {
Brad Bishop19323692019-04-05 15:28:33 -040032 (cd ${S} && ./waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)})
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033}
34
35waf_do_install() {
Brad Bishop19323692019-04-05 15:28:33 -040036 (cd ${S} && ./waf install --destdir=${D})
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037}
38
39EXPORT_FUNCTIONS do_configure do_compile do_install