diff options
author | csilvers <csilvers@01de4be4-8c4a-0410-9132-4925637da917> | 2008-04-11 22:36:40 +0000 |
---|---|---|
committer | csilvers <csilvers@01de4be4-8c4a-0410-9132-4925637da917> | 2008-04-11 22:36:40 +0000 |
commit | 6b117b70f948dc72b107dab6d3e9ac99be297b6d (patch) | |
tree | 1726969de95d86fc5647af1eeb99ea0489ba91c4 /contrib/distcc.sh | |
parent | 204634dc3c7d4662fab0132140f1ac59e8c9312b (diff) | |
download | distcc-6b117b70f948dc72b107dab6d3e9ac99be297b6d.tar.gz |
The first step of moving everything in the distcc directory to the top
level. I'm doing this in two stages, because I don't understand svn
enough to be confident to do it in one. This first stage just copies
all the files from distcc/FOO to FOO. Now there are two copies of
each file under distcc; the Makefile/etc uses the one in distcc and
ignores the one at the top level.
The next commit will delete everything under distcc, and rewrite the
Makefile/etc to use the top-level versions instead.
git-svn-id: http://distcc.googlecode.com/svn/trunk@22 01de4be4-8c4a-0410-9132-4925637da917
Diffstat (limited to 'contrib/distcc.sh')
-rw-r--r-- | contrib/distcc.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/contrib/distcc.sh b/contrib/distcc.sh new file mode 100644 index 0000000..b6b3307 --- /dev/null +++ b/contrib/distcc.sh @@ -0,0 +1,40 @@ +#! /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 ]; 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 |