[ccache] Patch: Xcode compatibility

2003-12-02 Thread Brian Poynor
On Fri, Nov 21, 2003 at 03:28:32PM -0800, Sean Gies wrote:
 2. Added a check to the argument processing logic to handle this sort 
 of invocation:
   /usr/share/bin/ccache /usr/bin/distcc /usr/bin/gcc-3.3 ...
 
 In order to handle multiple compiler versions, Xcode uses full paths to 
 invoke an explicit version of distcc or gcc.  This confused ccache 
 because it thought the gcc-3.3 argument to distcc was a source file.

Can you avoid that problem by using CCACHE_PREFIX?

-Brian



[ccache] Patch: Xcode compatibility

2003-12-02 Thread Sean Gies
Looks like mailman ate my attachment.  Here's the patch again: EOT
Index: ccache.c
===
RCS file: /cvsroot/ccache/ccache.c,v
retrieving revision 1.91
diff -u -r1.91 ccache.c
--- ccache.c28 Sep 2003 04:47:59 -  1.91
+++ ccache.c21 Nov 2003 23:03:32 -
@@ -64,6 +64,11 @@

  /* a list of supported file extensions, and the equivalent
 extension for code that has been through the pre-processor
+   
+   i   = C
+   mi  = Objective-C
+   ii  = C++
+   mii = Objective-C++
  */
  static struct {
char *extension;
@@ -74,14 +79,21 @@
{m, mi},
{cc, ii},
{CC, ii},
+   {cp, ii},
+   {CP, ii},
{cpp, ii},
{CPP, ii},
{cxx, ii},
{CXX, ii},
{c++, ii},
{C++, ii},
+   {M, mii},
+   {mm, mii},
+   {MM, mii},
{i, i},
{ii, ii},
+   {mi, mi},
+   {mii, mii},
{NULL, NULL}};

  /*
@@ -616,6 +628,7 @@
int found_c_opt = 0;
int found_S_opt = 0;
struct stat st;
+   int file_missing;
char *e;

stripped_args = args_init(0, NULL);
@@ -729,11 +742,21 @@
/* if an argument isn't a plain file then assume its
   an option, not an input file. This allows us to
   cope better with unusual compiler options */
-   if (stat(argv[i], st) != 0 || !S_ISREG(st.st_mode)) {
+   if ((file_missing = stat(argv[i], st)) != 0 || 
!S_ISREG(st.st_mode)) {
args_add(stripped_args, argv[i]);
continue;   
}

+   /* if the first argument contains distcc and the second 
argument
+  is a regular, executable file, then assume it's the compiler
+  being specified to distcc:
+ ccache distcc gcc ... */
+   if (i == 1  strstr(argv[0], distcc) != NULL  
!file_missing 
+   S_ISREG(st.st_mode)  (st.st_mode  (S_IXUSR | S_IXGRP | 
S_IXOTH))) {
+   args_add(stripped_args, argv[i]);
+   continue;   
+   }
+   
if (input_file) {
if (check_extension(argv[i], NULL)) {
cc_log(multiple input files (%s and %s)\n,
EOT

-Sean

On Nov 21, 2003, at 3:28 PM, Sean Gies wrote:

 Here's a patch I created so that I can use ccache with Apple's Xcode 
 IDE.

 1. Added more extensions to better support Objective-C and 
 Objective-C++.

 2. Added a check to the argument processing logic to handle this sort 
 of invocation:
   /usr/share/bin/ccache /usr/bin/distcc /usr/bin/gcc-3.3 ...

 In order to handle multiple compiler versions, Xcode uses full paths 
 to invoke an explicit version of distcc or gcc.  This confused ccache 
 because it thought the gcc-3.3 argument to distcc was a source file.

 -Sean

 ___
 ccache mailing list
 ccache@lists.samba.org
 http://lists.samba.org/mailman/listinfo/ccache



[ccache] Patch: Xcode compatibility

2003-12-02 Thread Sean Gies
Here's a patch I created so that I can use ccache with Apple's Xcode 
IDE.

1. Added more extensions to better support Objective-C and 
Objective-C++.

2. Added a check to the argument processing logic to handle this sort 
of invocation:
/usr/share/bin/ccache /usr/bin/distcc /usr/bin/gcc-3.3 ...

In order to handle multiple compiler versions, Xcode uses full paths to 
invoke an explicit version of distcc or gcc.  This confused ccache 
because it thought the gcc-3.3 argument to distcc was a source file.

-Sean