dpatel      02/09/17 14:43:14

  Modified:    gcc      gcc.c
  Log:
  cpp-precomp needs to know about GCC built-in macros. Until now,
  they communicated through specs file. But now GCC does not emit
  predefined macros into specs file. So this patch teaches driver
  to provide these macros on the command line.
  
  Reviewed by: Zem
  
  Revision  Changes    Path
  1.143     +36 -0     gcc3/gcc/gcc.c
  
  Index: gcc.c
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/gcc/gcc.c,v
  retrieving revision 1.142
  retrieving revision 1.143
  diff -u -r1.142 -r1.143
  --- gcc.c     2002/09/10 20:53:22     1.142
  +++ gcc.c     2002/09/17 21:43:14     1.143
  @@ -5351,6 +5351,42 @@
                      do_spec_1 (tmpstr, 1, NULL);
                      do_spec_1 (" ", 0, NULL);         /* fh */
                       }
  +                  if (!strcmp(arches[current_arch].name, "ppc")) 
  +                    {
  +                   sprintf (tmpstr, "-D__PPC__");
  +                   do_spec_1 (tmpstr, 1, NULL);
  +                   do_spec_1 (" ", 0, NULL);         
  +
  +                   sprintf (tmpstr, "-D__POWERPC__");
  +                   do_spec_1 (tmpstr, 1, NULL);
  +                   do_spec_1 (" ", 0, NULL);         
  +
  +                   sprintf (tmpstr, "-D__BIG_ENDIAN__");
  +                   do_spec_1 (tmpstr, 1, NULL);
  +                   do_spec_1 (" ", 0, NULL);         
  +
  +                   sprintf (tmpstr, "-D__NATURAL_ALIGNMENT__");
  +                   do_spec_1 (tmpstr, 1, NULL);
  +                   do_spec_1 (" ", 0, NULL);         
  +                    }
  +                  else if (!strcmp(arches[current_arch].name, "i386")) 
  +                    {
  +                   sprintf (tmpstr, "-D__i386__");
  +                   do_spec_1 (tmpstr, 1, NULL);
  +                   do_spec_1 (" ", 0, NULL);         
  +
  +                   sprintf (tmpstr, "-D__LITTLE_ENDIAN__");
  +                   do_spec_1 (tmpstr, 1, NULL);
  +                   do_spec_1 (" ", 0, NULL);         
  +                    }
  +
  +               sprintf (tmpstr, "-D__MACH__");
  +               do_spec_1 (tmpstr, 1, NULL);
  +               do_spec_1 (" ", 0, NULL);             
  +
  +               sprintf (tmpstr, "-D__APPLE__");
  +               do_spec_1 (tmpstr, 1, NULL);
  +               do_spec_1 (" ", 0, NULL);             
   
                  sprintf (tmpstr, "-D__SIZE_TYPE__=%s", SIZE_TYPE);
                  do_spec_1 (tmpstr, 1, NULL);
  
  
  


Reply via email to