#! /bin/sh
# This file, contributed by Dimitri PAPADOPOULOS-ORFANOS <papadopo@shfj.cea.fr>
# may be installed as "cc" somewhere on your $PATH ahead of the real gcc. That
# allows you to just use regular Makefiles without modifying them to change
# hardcoded calls to cc.
# This script will be a bit slow because of the overhead of running
# things through a shell. In a future release, this function should
# be supported directly by distcc, which should be a bit faster.
DISTCC_HOME=/usr/local/distcc
name=`basename $0`
if [ "$name" = distcc ]; thenecho"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
fiunset found
IFS=:
for item in $PATH; doif [ -x "$item/$name" -a ! -d "$item/$name" ]; thenif [ `cd $item; /bin/pwd` != `/bin/pwd` ]; then
found=true
breakfifidoneif [ -n "$found" ]; thenexec"distcc $item/$name $@"elseecho"$name: not found" 1>&2
fiexit 1