Also, I added the -x option for compiling preprocessed code again if there was an -x option on the original command line. Otherwise, when compiling Objective-C code on a different machine, distcc wouldn't recognize the code as preprocessed Objective-C.
Bernhard. On Fri, Jun 11, 2010 at 15:18, Bernhard Bauer <bau...@google.com> wrote: > Hi Joel, > > I finally got around to rewriting the third patch. I added a special > case to process_args that matches distcc's behavior (if the first > argument to distcc is neither a source/object file nor an option, it's > treated as the compiler). > > You can find the patch at http://github.com/sheepmaster/ccache . > > Bernhard. > > > On Mon, May 17, 2010 at 14:27, Bernhard Bauer <bau...@google.com> wrote: >> On Sunday, May 16, 2010, Joel Rosdahl wrote: >>> On 2010-05-12 15:52, Bernhard Bauer wrote: >>>> attached are some patches needed to make compiling under Mac OS X with >>>> Xcode/distcc work. >>> >>> Thanks! >>> >>>> 0001-Add-Objective-C-to-the-mapping-from-source-files-to-.patch >>> >>> Sure. Applied. >>> >>>> 0002-Add-fpreprocessed-option-for-compiling-preprocessed-.patch >>> >>> Is this needed because GCC doesn't add -fpreprocessed implicitly like it >>> does for .i/.ii/.mi files? >>> >>> The patch looks OK, except that it seems that -fpreprocessed was added >>> in GCC 3.0, so GCC 2.95 wouldn't be supported anymore if we add the flag >>> unconditionally. I don't know if anyone still uses GCC 2.95, but maybe >>> we could do it like this instead: >>> >>> --- a/ccache.c >>> +++ b/ccache.c >>> @@ -497,6 +497,14 @@ static void to_cache(ARGS *args) >>> putenv("DEPENDENCIES_OUTPUT"); >>> >>> if (compile_preprocessed_source_code) { >>> + char *p = strrchr(i_tmpfile, '.'); >>> + if (p && strcmp(p, ".mii") == 0) { >>> + /* >>> + * GCC doesn't add -fpreprocessed implicitly for >>> .mii >>> + * files, so we have to add it ourselves. >>> + */ >>> + args_add(args, "-fpreprocessed"); >>> + } >>> args_add(args, i_tmpfile); >>> } else { >>> args_add(args, input_file); >>> >>> What do you think? >> >> Or maybe it got confused by the -x option added by xcodebuild (for >> which I used Dirk Best's preliminary patch, so I didn't repeat it >> here). I'll find out which one is the case. >> >>>> 0003-Fix-a-bug-where-a-compiler-invocation-with-distcc-di.patch >>> >>> I'm don't think that's a good idea, since the executable flag can be set >>> on source code files as well, either by mistake or because the file >>> system (for instance vfat) may display all files as executable. >>> >>> Maybe you set CCACHE_PREFIX to distcc instead? See >>> . >> >> The problem is that distcc is called directly by xcodebuild, so I'm >> masquerading ccache as distcc via a symlink. Maybe the proper way here >> is to change the command line parsing so that it can cope with an >> additional argument when called as distcc. >> >> Bernhard. >> >>> ccache mailing list >>> ccache@lists.samba.org >>> https://lists.samba.org/mailman/listinfo/ccache >>> >> > _______________________________________________ ccache mailing list ccache@lists.samba.org https://lists.samba.org/mailman/listinfo/ccache