#! /bin/sh
DISTCC_HOME=/usr/local/distcc
name=`basename $0`
if [ "$name" = distcc ]; then
echo "In normal use distcc is not called by its real name." 1>&2
echo "Instead create links to the actual compiler you wish to run, e.g." 1>&2
echo " ln -s distcc gcc" 1>&2
echo "and make sure the link is before the real compiler in your path." 1>&2
exit 1
fi
unset found
IFS=:
for item in $PATH; do
if [ -x "$item/$name" -a ! -d "$item/$name" ]; then
if [ `cd $item; /bin/pwd` != `/bin/pwd` ]; then
found=true
break
fi
fi
done
if [ -n "$found" ]; then
exec "distcc $item/$name $@"
else
echo "$name: not found" 1>&2
fi
exit 1