phase1: use wrappers for ccache
750174c0cee95925dd322f37c211577d0ebc0dc4 attempted to inject ccache
into the CC environment, but that doesn't work as the CC/CXX variables
are processed by the build system, in order to extract the path to an
executable file.
This commit works around that situation by creating two simple wrapper
scripts on the slave. The remaining logic is unchanged:
When tryccache is False, CC/CXX point to the regular compilers and no
ccache injection is performed.
When tryccache is True, CC/CXX point to their respective wrapper, and
CCACHE is set to the path to ccache (if it exists, empty otherwise),
CCC/CCXX point to the original compilers, and the wrappers will execute
'${CCACHE} ${CCC} "$@"' or '${CCACHE} ${CCXX} "$@"'. If ${CCACHE} is
unset, this falls back to plain compilers.
i.e. ccache is only used if tryccache=True AND ccache has been found on
the slave.
Use 'exec' to avoid lingering shell during execution.
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>