From 9fbeba39f1a8342d042b71f43d225e6eebd4ad7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Mon, 8 Aug 2016 08:37:06 +0200 Subject: [PATCH] compiler wrapper: add ccache or distcc prefix (#4575) Closes #4574 --- common/hooks/pre-configure/02-script-wrapper.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/common/hooks/pre-configure/02-script-wrapper.sh b/common/hooks/pre-configure/02-script-wrapper.sh index de408aa84be..c13021ce5cb 100644 --- a/common/hooks/pre-configure/02-script-wrapper.sh +++ b/common/hooks/pre-configure/02-script-wrapper.sh @@ -89,16 +89,22 @@ install_wrappers() { } install_cross_wrappers() { - local fname + local fname prefix + + if [ -n "$XBPS_CCACHE" ]; then + [ -x "/usr/bin/ccache" ] && prefix="/usr/bin/ccache " + elif [ -n "$XBPS_DISTCC" ]; then + [ -x "/usr/bin/distcc" ] && prefix="/usr/bin/distcc " + fi for fname in cc gcc; do - sed -e "s,@BIN@,/usr/bin/$XBPS_CROSS_TRIPLET-gcc,g" \ + sed -e "s,@BIN@,${prefix}/usr/bin/$XBPS_CROSS_TRIPLET-gcc,g" \ ${XBPS_COMMONDIR}/wrappers/cross-cc > \ ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname} chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname} done for fname in c++ g++; do - sed -e "s,@BIN@,/usr/bin/$XBPS_CROSS_TRIPLET-g++,g" \ + sed -e "s,@BIN@,${prefix}/usr/bin/$XBPS_CROSS_TRIPLET-g++,g" \ ${XBPS_COMMONDIR}/wrappers/cross-cc > \ ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname} chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname}