[distcc] compiler extension patch

Cesar Oliveira cesar.d.o at vif.com
Sun Aug 27 04:54:02 GMT 2006


Hello everyone,

The patch we are presenting is from Tom Aratyn and Cesar Oliveira, and is
focused on getting distcc to work with Microsoft's cl compiler. This patch
simply adds mulitple compiler support to distcc so that it is possible to
add support for other compilers - this is not the final product so there is
no support for cl (yet! We're working on it!). We have made some changes to
the code's architecture that makes it simple for anyone to add another
compiler to distcc. For the sake of compatibility we have written the patch
to ALWAYS default to gcc.

The patch works via a virtual table (as Martin suggested) and is set by
dcc_set_compiler() which receives the first element of the of argv[] after
the compiler name has been set inside it (we've had to make some small
modifications to ensure that this is the case in all test apps).

We would also like any feedback on forcing a certain compiler through the
use of an environment variable (or possibly an option but we're somewhat
inclined to use an environment variable). For example, instead of distcc
cl.exe main.c An environment variable could specify the cl compiler. This
environment variable should be checked before distcc defaults to gcc.

Finally, we've tested this on Windows XP Pro with cygwin, Linux, and OS X
and we've passed all test (except one in cygwin where gcc, not distcc, seg
faults with an empty pre-processed file). To our understanding, the current
release fails three tests on cygwin (including the gcc seg fault).

Any constructive ideas/comments are welcome,
Cesar and Tom

-------------- next part --------------
A non-text attachment was scrubbed...
Name: distcc.patch
Type: text/x-patch
Size: 20902 bytes
Desc: not available
Url : http://lists.samba.org/archive/distcc/attachments/20060827/e73a17a6/distcc.bin


More information about the distcc mailing list