blob: 299dec107f46f9cac310fb4f1470a6c7d49cca36 [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.
WAF_NO_PREFORK="1" 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
}