xref: /OK3568_Linux_fs/yocto/poky/meta/classes/scons.bbclass (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyuninherit python3native
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunDEPENDS += "python3-scons-native"
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunEXTRA_OESCONS ?= ""
6*4882a593Smuzhiyun# This value below is derived from $(getconf ARG_MAX)
7*4882a593SmuzhiyunSCONS_MAXLINELENGTH ?= "MAXLINELENGTH=2097152"
8*4882a593SmuzhiyunEXTRA_OESCONS:append = " ${SCONS_MAXLINELENGTH}"
9*4882a593Smuzhiyundo_configure() {
10*4882a593Smuzhiyun	if [ -n "${CONFIGURESTAMPFILE}" -a "${S}" = "${B}" ]; then
11*4882a593Smuzhiyun		if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then
12*4882a593Smuzhiyun			${STAGING_BINDIR_NATIVE}/scons --directory=${S} --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS}
13*4882a593Smuzhiyun		fi
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun		mkdir -p `dirname ${CONFIGURESTAMPFILE}`
16*4882a593Smuzhiyun		echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
17*4882a593Smuzhiyun	fi
18*4882a593Smuzhiyun}
19*4882a593Smuzhiyun
20*4882a593Smuzhiyunscons_do_compile() {
21*4882a593Smuzhiyun	${STAGING_BINDIR_NATIVE}/scons --directory=${S} ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
22*4882a593Smuzhiyun	die "scons build execution failed."
23*4882a593Smuzhiyun}
24*4882a593Smuzhiyun
25*4882a593Smuzhiyunscons_do_install() {
26*4882a593Smuzhiyun	${STAGING_BINDIR_NATIVE}/scons --directory=${S} install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} install || \
27*4882a593Smuzhiyun	die "scons install execution failed."
28*4882a593Smuzhiyun}
29*4882a593Smuzhiyun
30*4882a593Smuzhiyundo_configure[vardepsexclude] = "SCONS_MAXLINELENGTH"
31*4882a593Smuzhiyundo_compile[vardepsexclude] = "SCONS_MAXLINELENGTH"
32*4882a593Smuzhiyundo_install[vardepsexclude] = "SCONS_MAXLINELENGTH"
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunEXPORT_FUNCTIONS do_compile do_install
35