2011-12-24 15:08:34 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. /etc/make.conf
|
|
|
|
|
|
|
|
# just make sure
|
|
|
|
FEATURES="${FEATURES} distcc distcc-pump"
|
2011-12-24 13:26:39 +01:00
|
|
|
|
|
|
|
DISTCC_PATH="/usr/lib/distcc/bin"
|
|
|
|
CUR_CHOST="armv7a-hardfloat-linux-gnueabi"
|
|
|
|
DISTCC_WRAPPER="${CUR_CHOST}-wrapper"
|
|
|
|
|
2011-12-24 15:08:34 +01:00
|
|
|
pushd "${DISTCC_PATH}" > /dev/null || exit 1
|
2011-12-24 13:26:39 +01:00
|
|
|
cur_link=$(readlink cc)
|
|
|
|
if [ "${cur_link}" = "/usr/bin/distcc" ] || [ ! -f "${DISTCC_WRAPPER}" ]; then
|
|
|
|
echo "Fixing links in ${DISTCC_PATH}"
|
|
|
|
rm -f c++ g++ gcc cc || exit 1
|
|
|
|
echo "#!/bin/bash" > "${DISTCC_WRAPPER}"
|
|
|
|
echo "exec /usr/lib/distcc/bin/${CUR_CHOST}-g\${0:\$[-2]} \"\$@\"" >> "${DISTCC_WRAPPER}"
|
|
|
|
chmod a+x "${DISTCC_WRAPPER}" || exit 1
|
|
|
|
ln -s "${DISTCC_WRAPPER}" cc || exit 1
|
|
|
|
ln -s "${DISTCC_WRAPPER}" gcc || exit 1
|
|
|
|
ln -s "${DISTCC_WRAPPER}" g++ || exit 1
|
|
|
|
ln -s "${DISTCC_WRAPPER}" c++ || exit 1
|
|
|
|
fi
|
2011-12-24 15:27:53 +01:00
|
|
|
popd > /dev/null
|
2011-12-24 13:26:39 +01:00
|
|
|
|
|
|
|
export FEATURES PATH
|
2011-12-24 15:08:34 +01:00
|
|
|
exec emerge "$@"
|