blob: c022a52ce6273c02f1177039260da32a4f61c1ce [file] [log] [blame]
#!/bin/bash
# Adds a hook to pre_src_prepare to override the arguments to WAF
# in order to support cross compilation.
cros_pre_src_prepare_cross() {
case "${ARCH}" in
"amd64")
# No need to cross compile for this case.
;;
"arm" | "arm64")
local waf="${T}/waf"
cat<<EOF>"${waf}"
#!/bin/sh
# WAF_BINARY must be set from the ebuild.
exec "${WAF_BINARY}" "\$@" --cross-compile --cross-answers="${BASHRC_FILESDIR}/${ARCH}_waf_config_answers"
EOF
chmod a+rx "${waf}"
WAF_BINARY="${waf}"
;;
*)
die "${P} does not support cross-compiling for ${ARCH}"
;;
esac
}