blob: d20a78dc6e40623766953a607a445eb4d57dbfbc [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7inherit python3native
8
9DEPENDS += "python3-scons-native"
10
11EXTRA_OESCONS ?= ""
Patrick Williams864cc432023-02-09 14:54:44 -060012# This value below is derived from $(getconf ARG_MAX)
13SCONS_MAXLINELENGTH ?= "MAXLINELENGTH=2097152"
14EXTRA_OESCONS:append = " ${SCONS_MAXLINELENGTH}"
Patrick Williams92b42cb2022-09-03 06:53:57 -050015do_configure() {
16 if [ -n "${CONFIGURESTAMPFILE}" -a "${S}" = "${B}" ]; then
17 if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then
18 ${STAGING_BINDIR_NATIVE}/scons --directory=${S} --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS}
19 fi
20
21 mkdir -p `dirname ${CONFIGURESTAMPFILE}`
22 echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
23 fi
24}
25
26scons_do_compile() {
27 ${STAGING_BINDIR_NATIVE}/scons --directory=${S} ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
28 die "scons build execution failed."
29}
30
31scons_do_install() {
32 ${STAGING_BINDIR_NATIVE}/scons --directory=${S} install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} install || \
33 die "scons install execution failed."
34}
35
Patrick Williams864cc432023-02-09 14:54:44 -060036do_configure[vardepsexclude] = "SCONS_MAXLINELENGTH"
37do_compile[vardepsexclude] = "SCONS_MAXLINELENGTH"
38do_install[vardepsexclude] = "SCONS_MAXLINELENGTH"
39
Patrick Williams92b42cb2022-09-03 06:53:57 -050040EXPORT_FUNCTIONS do_compile do_install