Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.114
 
1.115
 
MAIN:gmcgarry:20080728144500
 
cc.c
_>127127 char    *tmp3;
 128128 char    *tmp4;
 129129 char    *outfile;
<> 130+char *Bprefix(char *);
130131 char *copy(char *, int),*setsuf(char *, char);
 131132 int getsuf(char *);
 132133 int main(int, char *[]);
     
 !
218219 #ifndef STARTLABEL
 219220 #define STARTLABEL "__start"
 220221 #endif
<> 222+char *incdir = STDINC;
  223+char *libdir = PCCLIBDIR;
221224 
 222225 /* handle gcc warning emulations */
 223226 struct Wflags {
     
 !
536539                         tmp3 = gettmp();
 537540                 tmp4 = gettmp();
 538541         }
<> 542+        if (Bflag) {
  543+                incdir = Bflag;
  544+                libdir = Bflag;
  545+        }
539546         if (signal(SIGINT, SIG_IGN) != SIG_IGN/* interrupt */
 540547                 signal(SIGINT, idexit);
 541548         if (signal(SIGTERM, SIG_IGN) != SIG_IGN)        /* terminate */
     
 !
591598                 for(pv=ptemp; pv <pvt; pv++)
 592599                         av[na++] = *pv;
 593600                 if (!nostdinc)
<>594 -                        av[na++] = "-S", av[na++] = STDINC;
 595 -                av[na++] = "-I" PCCINCDIR;
  601+                        av[na++] = "-S", av[na++] = incdir;
  602+                av[na++] = "-I", av[na++] = PCCINCDIR;
596603                 if (idirafter) {
 597604                         av[na++] = "-I";
 598605                         av[na++] = idirafter;
     
 !
764771                 if (shared) {
 765772                         if (!nostartfiles) {
 766773                                 for (i = 0; startfiles_S[i]; i++)
<>767 -                                        av[j++] = startfiles_S[i];
  774+                                        av[j++] = Bprefix(startfiles_S[i]);
768775                         }
 769776                 } else
 770777 #endif
     
 !
773780 #ifdef CRT0FILE_PROFILE
 774781                                 if (pgflag)
 775782                                 {
<>776 -                                        av[j++] = crt0file_profile;
  783+                                        av[j++] = Bprefix(crt0file_profile);
777784                                 }
 778785                                 else
 779786 #endif
 780787                                 {
 781788 #ifdef CRT0FILE
<>782 -                                        av[j++] = crt0file;
  789+                                        av[j++] = Bprefix(crt0file);
783790 #endif
 784791                                 }
 785792 #ifdef STARTFILES_T
 786793                                 if (Bstatic) {
 787794                                         for (i = 0; startfiles_T[i]; i++)
<>788 -                                                av[j++] = startfiles_T[i];
  795+                                                av[j++] = Bprefix(listartfiles_T[i]);
789796                                 } else
 790797 #endif
 791798                                 {
 792799 #ifdef STARTFILES
 793800                                         for (i = 0; startfiles[i]; i++)
<>794 -                                                av[j++] = startfiles[i];
  801+                                                av[j++] = Bprefix(startfiles[i]);
795802 #endif
 796803                                 }
 797804                         }
     
 !
814821                 if (pthreads)
 815822                         av[j++] = "-lpthread";
 816823                 if (!nostdlib) {
<>817 -                        av[j++] = "-L" PCCLIBDIR;
  824+                        char *s = copy("-L", strlen(libdir));
  825+                        strcat(s, libdir);
  826+                        av[j++] = s;
818827                         if (pgflag) {
 819828                                 for (i = 0; libclibs_profile[i]; i++)
<>820 -                                        av[j++] = libclibs_profile[i];
  829+                                        av[j++] = Bprefix(libclibs_profile[i]);
821830                         } else {
 822831                                 for (i = 0; libclibs[i]; i++)
<>823 -                                        av[j++] = libclibs[i];
  832+                                        av[j++] = Bprefix(libclibs[i]);
824833                         }
 825834                 }
 826835 #ifdef STARTFILES_S
 827836                 if (shared) {
 828837                         for (i = 0; endfiles_S[i]; i++)
<>829 -                                av[j++] = endfiles_S[i];
  838+                                av[j++] = Bprefix(endfiles_S[i]);
830839                 } else
 831840 #endif
 832841                 {
 833842                         if (!nostartfiles) {
 834843 #ifdef STARTFILES_T
 835844                                 if (Bstatic) {
 836845                                         for (i = 0; endfiles_T[i]; i++)
<>837 -                                                av[j++] = endfiles_T[i];
  846+                                                av[j++] = Bprefix(endfiles_T[i]);
838847                                 } else
 839848 #endif
 840849                                 {
 841850 #ifdef STARTFILES
 842851                                         for (i = 0; endfiles[i]; i++)
<>843 -                                                av[j++] = endfiles[i];
  852+                                                av[j++] = Bprefix(endfiles[i]);
844853 #endif
 845854                                 }
 846855                         }
     
 !
921930         dexit(eval);
 922931 }
 923932 
<> 933+char *
  934+Bprefix(char *s)
  935+{
  936+        char *suffix;
  937+        char *str;
  938+
  939+        if (Bflag == NULL || s[0] != '/')
  940+                return s;
  941+
  942+        suffix = strrchr(s, '/');
  943+        if (suffix == NULL)
  944+                suffix = s;
  945+
  946+        str = copy(Bflag, strlen(suffix));
  947+        strcat(str, suffix);
  948+        return str;
  949+}
  950+
<_924951 int
 925952 getsuf(char *s)
 926953 {
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-21 12:22 +0100