From kde-devel Thu May 23 02:29:42 2002 From: Ian Reinhart Geiser Date: Thu, 23 May 2002 02:29:42 +0000 To: kde-devel Subject: C++ Support for distcc X-MARC-Message: https://marc.info/?l=kde-devel&m=102212102526985 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------Boundary-00=_ILLJEK3M0IJDM3FMRPIP" --------------Boundary-00=_ILLJEK3M0IJDM3FMRPIP Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit Content-Disposition: inline Greetings, There has been some buzz as of late about doing distributed builds for doing KDE builds faster. Team Builder unfortunately is not a realistic option for the masses of KDE developers out there and up until this patch neither was distcc. The attached patch allows distcc to compile most known C++ extentions supported by gcc, these include cxx, cpp, cc, C and cp. There are also attached two scripts that allow distcc to interact with libtool a little better. For some reason libtool is not a fan of distcc g++ in some instances in our build system. To use them, put them in your path and do an: export CC='distc' export CXX='distc++' I have tested this with kdesupport, arts and kdelibs so far with mostly success. There are a few problems with object files not being found, but I am still trying to nail down why this is happening. They don't seem to appear on my SMP system, but do when I am using distcc. Please if you are interested test the following patches. I have also CCed the author of distcc to have these patches merged in to the main source. Cheers -ian reinhart geiser --------------Boundary-00=_ILLJEK3M0IJDM3FMRPIP Content-Type: text/x-diff; charset="us-ascii"; name="distcc-c++-support.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="distcc-c++-support.patch" --- distcc-0.2/src/arg.c Thu May 16 03:56:34 2002 +++ /mnt/network/home/geiseri/distcc-0.2/src/arg.c Wed May 22 17:37:28 2002 @@ -67,7 +67,7 @@ char *slash; char *o; int l; - + char *s; if ((slash = strrchr(sfile, '/'))) sfile = slash+1; if ((l = strlen(sfile)) < 3) { @@ -76,7 +76,8 @@ } o = strdup(sfile); - strcpy(&o[l - 2], ".o"); + s = rindex(o,'.'); + strcpy(s, ".o"); *ofile = o; return 0; @@ -134,8 +135,12 @@ goto GOT_OUTPUT; } } else { - if (str_endswith(".i", a) || str_endswith(".c", a)) { + if (str_endswith(".i", a) || str_endswith(".c", a) + || str_endswith(".cpp",a) || str_endswith(".cc",a) + || str_endswith(".cxx",a) || str_endswith(".C",a) + || str_endswith(".cp", a) || str_endswith("c++",a)) { rs_trace("found input file \"%s\"", a); + rs_log_notice("found input file \"%s\"", a); if (*input_file) { rs_log_notice("do we have two inputs? i give up"); return -1; @@ -309,7 +314,10 @@ rs_trace("command before: %s", dcc_argv_tostr(a)); for (i =0; a[i]; i++) - if (str_endswith(".c", a[i]) || str_endswith(".i", a[i])) { + if (str_endswith(".c", a[i]) || str_endswith(".i", a[i]) + || str_endswith(".cpp",a[i]) || str_endswith(".cc",a[i]) + || str_endswith(".cxx",a[i]) || str_endswith(".C",a[i]) + || str_endswith(".cp", a[i]) || str_endswith("c++",a[i])) { rs_trace("changed input from \"%s\" to \"%s\"", a[i], ifname); a[i] = ifname; rs_trace("command after: %s", dcc_argv_tostr(a)); --------------Boundary-00=_ILLJEK3M0IJDM3FMRPIP Content-Type: application/x-shellscript; name="distc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="distc" #!/bin/sh distcc gcc $* --------------Boundary-00=_ILLJEK3M0IJDM3FMRPIP Content-Type: text/plain; charset="us-ascii"; name="distc++" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="distc++" !/bin/sh distcc g++ $* --------------Boundary-00=_ILLJEK3M0IJDM3FMRPIP-- >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<