diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-01-27 22:27:17 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-01-27 22:27:17 +0300 |
commit | 98cc5cd6483975b64d80e8323f7f659dd1337d75 (patch) | |
tree | 5fa64e93d57396bc4c76aa3537156205b4b424ac /poky/meta/classes/waf.bbclass | |
parent | 82dbc15a05125a812c140a3c8cff81c366482229 (diff) | |
parent | 8fc454f9beebdd347403145c991697019a593cff (diff) | |
download | openbmc-98cc5cd6483975b64d80e8323f7f659dd1337d75.tar.xz |
Merge tag '0.29' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'poky/meta/classes/waf.bbclass')
-rw-r--r-- | poky/meta/classes/waf.bbclass | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/poky/meta/classes/waf.bbclass b/poky/meta/classes/waf.bbclass index 900244004..188119f35 100644 --- a/poky/meta/classes/waf.bbclass +++ b/poky/meta/classes/waf.bbclass @@ -1,10 +1,20 @@ # avoids build breaks when using no-static-libs.inc DISABLE_STATIC = "" +# What Python interpretter to use. Defaults to Python 3 but can be +# overridden if required. +WAF_PYTHON ?= "python3" + B = "${WORKDIR}/build" +do_configure[cleandirs] += "${B}" EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}" +EXTRA_OEWAF_BUILD ??= "" +# In most cases, you want to pass the same arguments to `waf build` and `waf +# install`, but you can override it if necessary +EXTRA_OEWAF_INSTALL ??= "${EXTRA_OEWAF_BUILD}" + def waflock_hash(d): # Calculates the hash used for the waf lock file. This should include # all of the user controllable inputs passed to waf configure. Note @@ -35,9 +45,10 @@ python waf_preconfigure() { import subprocess from distutils.version import StrictVersion subsrcdir = d.getVar('S') + python = d.getVar('WAF_PYTHON') wafbin = os.path.join(subsrcdir, 'waf') try: - result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT) + result = subprocess.check_output([python, wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT) version = result.decode('utf-8').split()[1] if StrictVersion(version) >= StrictVersion("1.8.7"): d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}") @@ -50,16 +61,16 @@ python waf_preconfigure() { do_configure[prefuncs] += "waf_preconfigure" waf_do_configure() { - (cd ${S} && ./waf configure -o ${B} --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF}) + (cd ${S} && ${WAF_PYTHON} ./waf configure -o ${B} --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF}) } do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+" waf_do_compile() { - (cd ${S} && ./waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)}) + (cd ${S} && ${WAF_PYTHON} ./waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)} ${EXTRA_OEWAF_BUILD}) } waf_do_install() { - (cd ${S} && ./waf install --destdir=${D}) + (cd ${S} && ${WAF_PYTHON} ./waf install --destdir=${D} ${EXTRA_OEWAF_INSTALL}) } EXPORT_FUNCTIONS do_configure do_compile do_install |