xfce4-battery-plugin: tune the pandora hack
[openembedded.git] / recipes / dietlibc / dietlibc-0.32 / ccache.patch
1 Index: dietlibc-0.32/diet.c
2 ===================================================================
3 --- dietlibc-0.32.orig/diet.c   2009-03-17 00:17:58.000000000 +0100
4 +++ dietlibc-0.32/diet.c        2009-10-02 14:12:14.306929201 +0200
5 @@ -132,7 +132,12 @@
6      }
7    }
8    {
9 -    char *cc=argv[1];
10 +    char *cc;
11 +    if (!strcmp(argv[1],"ccache")) {
12 +       cc=argv[2];
13 +    } else {
14 +       cc=argv[1];
15 +    }
16      char *tmp=strchr(cc,0)-2;
17      char *tmp2,*tmp3;
18      if (tmp<cc) goto donttouch;
19 @@ -144,7 +149,7 @@
20        if (tmp3<tmp2) tmp2=tmp3;
21        if (tmp2-cc>90) error("platform name too long!\n");
22        shortplatform=platform+len;
23 -      memmove(shortplatform,argv[1],(size_t)(tmp2-cc));
24 +      memmove(shortplatform,cc,(size_t)(tmp2-cc));
25        platform[tmp2-cc+len]=0;
26        if (shortplatform[0]=='i' && shortplatform[2]=='8' && shortplatform[3]=='6') shortplatform[1]='3';
27      } else {
28 @@ -291,6 +296,9 @@
29  
30        dest=newargv;
31        *dest++=argv[1];
32 +      if (strcmp(argv[1],"ccache") == 0) {
33 +        *dest++=argv[2];
34 +      }
35        if (argv[2]) {
36         if (!strcmp(argv[2],"-V")) {
37           *dest++=argv[2];
38 @@ -300,9 +308,9 @@
39         } else if (!memcmp(argv[2],"-V",2)) {
40           *dest++=argv[2];
41           ++argv;
42 -         --argc;
43         }
44        }
45 +
46  #ifndef __DYN_LIB
47        if (_link) { *dest++=(char*)nostdlib; *dest++=dashstatic; *dest++=dashL; }
48  #else
49 @@ -320,7 +328,15 @@
50  #ifdef WANT_DYNAMIC
51        if (_link) { *dest++=d; }
52  #endif
53 -      for (i=2; i<argc; ++i) {
54 +      if (strcmp(argv[1],"ccache") == 0) {
55 +          i=3;
56 +      } else {
57 +          i=2;
58 +      }
59 +      for (i; i<argc; ++i) {
60 +        if (strstr(argv[i],"isystem") != NULL)
61 +          continue;
62 +
63         if (!strcmp(argv[i],"-pthread")) {
64           *dest++="-D_REENTRANT";
65           if (_link) *dest++="-lpthread";
66 @@ -333,6 +349,8 @@
67               continue;
68           }
69         *dest++=argv[i];
70 +       *dest--;
71 +       *dest++;
72        }
73  #ifndef __DYN_LIB
74        if (compile || _link) {