home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / gc24sdif / gcc_240.dif < prev    next >
Encoding:
Text File  |  1993-07-24  |  62.4 KB  |  2,326 lines

  1. RCS file: /net/acae127/home/bammi/etc/src/master/gnu/gcc/c-lex.c,v
  2. retrieving revision 1.1.1.1
  3. diff -c -r1.1.1.1 c-lex.c
  4. *** 1.1.1.1    1993/05/18 23:51:34
  5. --- c-lex.c    1993/05/21 12:35:17
  6. ***************
  7. *** 474,485 ****
  8. --- 474,487 ----
  9.       case '\r':
  10.         /* ANSI C says the effects of a carriage return in a source file
  11.            are undefined.  */
  12. + #ifndef atarist /* but not on an atarist, though hopefully we should'nt see it */
  13.         if (pedantic && !newline_warning)
  14.           {
  15.             warning ("carriage return in source file");
  16.             warning ("(we only warn about the first carriage return)");
  17.             newline_warning = 1;
  18.           }
  19. + #endif
  20.         c = getc (finput);
  21.         break;
  22.   
  23. ===================================================================
  24. RCS file: /net/acae127/home/bammi/etc/src/master/gnu/gcc/calls.c,v
  25. retrieving revision 1.1.1.1
  26. diff -c -r1.1.1.1 calls.c
  27. *** 1.1.1.1    1993/05/18 23:51:36
  28. --- calls.c    1993/05/21 12:35:20
  29. ***************
  30. *** 2023,2028 ****
  31. --- 2023,2034 ----
  32.   
  33.     argvec = (struct arg *) alloca (nargs * sizeof (struct arg));
  34.   
  35. + /* how would you do this RIGHT ?? fake a DECL node? dunno... */
  36. + #ifdef ENCODE_SECTION_INFO
  37. +   /* mark it as a function (to be in the text section that is) */
  38. +   SYMBOL_REF_FLAG (fun) = 1;
  39. + #endif
  40.     INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun);
  41.   
  42.     args_size.constant = 0;
  43. ===================================================================
  44. RCS file: /net/acae127/home/bammi/etc/src/master/gnu/gcc/cccp.c,v
  45. retrieving revision 1.1.1.1
  46. diff -c -r1.1.1.1 cccp.c
  47. *** 1.1.1.1    1993/05/18 23:51:37
  48. --- cccp.c    1993/05/21 12:35:26
  49. ***************
  50. *** 77,82 ****
  51. --- 77,83 ----
  52.   #include <stdio.h>
  53.   #include <signal.h>
  54.   
  55. + #ifndef atarist
  56.   #ifndef VMS
  57.   #ifndef USG
  58.   #include <sys/time.h>        /* for __DATE__ and __TIME__ */
  59. ***************
  60. *** 86,95 ****
  61. --- 87,110 ----
  62.   #include <fcntl.h>
  63.   #endif /* USG */
  64.   #endif /* not VMS */
  65. + #endif /* not atarist */
  66.   
  67.   /* This defines "errno" properly for VMS, and gives us EACCES. */
  68.   #include <errno.h>
  69.   
  70. + /* atarist  specific defs and includes */
  71. + #ifdef atarist
  72. + #include <time.h>
  73. + #include <file.h>
  74. + #include <string.h>
  75. + #include <stddef.h>
  76. + long _stksize = -1L;    /* want big stack cause include files
  77. +                    get alloca'ed there */
  78. + #define read(fd,buf,size)    _text_read(fd,buf,size)
  79. + #endif /* atarist */
  80.   /* VMS-specific definitions */
  81.   #ifdef VMS
  82.   #include <time.h>
  83. ***************
  84. *** 969,974 ****
  85. --- 984,1010 ----
  86.   /* Nonzero means -I- has been seen,
  87.      so don't look for #include "foo" the source-file directory.  */
  88.   static int ignore_srcdir;
  89. +  
  90. + #ifdef atarist
  91. + /* the following dingus is used in place of some calls to bcopy,
  92. +    to ensure that backslashes get properly slashified when getting
  93. +    shoved into strings.  Note that it returns the new pointer!!
  94. +    There ought to be a better way... */
  95. + U_CHAR * slashifying_bcopy(from_buf, to_buf, nbytes)
  96. + U_CHAR * from_buf, * to_buf;
  97. + int nbytes;
  98. + {
  99. +   for ( ; nbytes > 0 ; )
  100. +     {
  101. +     if(*from_buf == '\\')
  102. +         *to_buf++ = '\\';
  103. +     *to_buf++ = *from_buf++;
  104. +     nbytes--;
  105. +     }
  106. +   return(to_buf);
  107. + }
  108. + #endif        /* atarist */
  109.   
  110.   int
  111.   main (argc, argv)
  112. ***************
  113. *** 1009,1014 ****
  114. --- 1045,1055 ----
  115.     /* Target-name to write with the dependency information.  */
  116.     char *deps_target = 0;
  117.   
  118. + #ifdef atarist
  119. + /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  120. + /*  _malloczero(1); */     /* zero mallocs by default */
  121. + #endif  
  122.   #ifdef RLIMIT_STACK
  123.     /* Get rid of any avoidable limit on stack size.  */
  124.     {
  125. ***************
  126. *** 1285,1294 ****
  127. --- 1326,1341 ----
  128.       break;
  129.   
  130.         case 'v':
  131. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  132. + #include "PatchLev.h"
  133. +     fprintf (stderr, "GNU CPP-atariST version %s Patchlevel %s",
  134. +          version_string, PatchLevel);
  135. + #else
  136.       fprintf (stderr, "GNU CPP version %s", version_string);
  137.   #ifdef TARGET_VERSION
  138.       TARGET_VERSION;
  139.   #endif
  140. + #endif
  141.       fprintf (stderr, "\n");
  142.       break;
  143.   
  144. ***************
  145. *** 1420,1425 ****
  146. --- 1467,1473 ----
  147.       }
  148.     }
  149.   
  150. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  151.     /* Add dirs from CPATH after dirs from -I.  */
  152.     /* There seems to be confusion about what CPATH should do,
  153.        so for the moment it is not documented.  */
  154. ***************
  155. *** 1429,1434 ****
  156. --- 1477,1483 ----
  157.     p = (char *) getenv ("CPATH");
  158.     if (p != 0 && ! no_standard_includes)
  159.       path_include (p);
  160. + #endif
  161.   
  162.     /* Now that dollars_in_ident is known, initialize is_idchar.  */
  163.     initialize_char_syntax ();
  164. ***************
  165. *** 1547,1554 ****
  166.     { /* read the appropriate environment variable and if it exists
  167.          replace include_defaults with the listed path. */
  168.       char *epath = 0;
  169.       switch ((objc << 1) + cplusplus)
  170. !       {
  171.         case 0:
  172.       epath = getenv ("C_INCLUDE_PATH");
  173.       break;
  174. --- 1596,1651 ----
  175.     { /* read the appropriate environment variable and if it exists
  176.          replace include_defaults with the listed path. */
  177.       char *epath = 0;
  178. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  179. +     int db_hack = 0;
  180. +     char *e1 = getenv("GNUINC"), *e2 = getenv("GNULIB"),
  181. +          *e3 = getenv("GXXINC");
  182. +     /* Get length of the alloc'ed array. (Yeah I know, I might alloc
  183. +      * a character more than I need but who cares...
  184. +      */
  185. +     if (cplusplus && e3)
  186. +     db_hack += strlen (e3);
  187. +     if (e1)
  188. +         db_hack += strlen (e1) + 1;
  189. +     if (e2)
  190. +         db_hack += strlen (e1) + 1;
  191. +     if (db_hack) {
  192. +     epath = alloca (db_hack + 1);
  193. +     *epath = '\0';
  194. +     db_hack = 0;
  195. +     /* Concatenate the paths together. */
  196. +     if (cplusplus && e3) {
  197. +         strcpy (epath, e3);
  198. +         db_hack = 1;
  199. +     }
  200. +     if (e1) {
  201. +         if (db_hack) {
  202. +         strcat (epath, PATH_SEP_STR);
  203. +         }
  204. +         strcat (epath, e1);
  205. +         db_hack = 1;
  206. +     }
  207. +     if (e2) {
  208. +         if (db_hack) {
  209. +         strcat (epath, PATH_SEP_STR);
  210. +         }
  211. +         strcat (epath, e2);
  212. +     }
  213. +     }
  214. + #ifdef atarist
  215. +     if (epath)
  216. +         for (e3=epath; *e3; e3++)    /* Use one kind of path separator */
  217. +         if (*e3 == ';')
  218. +         *e3 = PATH_SEPARATOR;
  219. + #endif
  220. + #else
  221.       switch ((objc << 1) + cplusplus)
  222. !     {
  223.         case 0:
  224.       epath = getenv ("C_INCLUDE_PATH");
  225.       break;
  226. ***************
  227. *** 1561,1567 ****
  228.         case 3:
  229.       epath = getenv ("OBJCPLUS_INCLUDE_PATH");
  230.       break;
  231. !       }
  232.       /* If the environment var for this language is set,
  233.          add to the default list of include directories.  */
  234.       if (epath) {
  235. --- 1658,1666 ----
  236.         case 3:
  237.       epath = getenv ("OBJCPLUS_INCLUDE_PATH");
  238.       break;
  239. !     }
  240. ! #endif
  241.       /* If the environment var for this language is set,
  242.          add to the default list of include directories.  */
  243.       if (epath) {
  244. ***************
  245. *** 1615,1627 ****
  246. --- 1714,1736 ----
  247.     if (!no_standard_includes) {
  248.       struct default_include *p = include_defaults;
  249.       char *specd_prefix = include_prefix;
  250. + #ifdef GCC_INCLUDE_DIR
  251.       char *default_prefix = savestring (GCC_INCLUDE_DIR);
  252. + #else
  253. +     char *default_prefix = savestring ("./");
  254. + #endif
  255.       int default_len = 0;
  256.       /* Remove the `include' from /usr/local/lib/gcc.../include.  */
  257.       if (!strcmp (default_prefix + strlen (default_prefix) - 8, "/include")) {
  258.         default_len = strlen (default_prefix) - 7;
  259.         default_prefix[default_len] = 0;
  260.       }
  261. + #ifdef atarist
  262. +     else if (!strcmp (default_prefix + strlen (default_prefix) - 8, "\\include")) {
  263. +       default_len = strlen (default_prefix) - 7;
  264. +       default_prefix[default_len] = 0;
  265. +     }
  266. + #endif
  267.       /* Search "translated" versions of GNU directories.
  268.          These have /usr/local/lib/gcc... replaced by specd_prefix.  */
  269.       if (specd_prefix != 0 && default_len != 0)
  270. ***************
  271. *** 1749,1755 ****
  272. --- 1858,1868 ----
  273.         char *p1 = p;
  274.         /* Discard all directory prefixes from P.  */
  275.         while (*p1) {
  276. + #ifdef atarist
  277. +     if ((*p1 == '/') || (*p1 == '\\'))
  278. + #else
  279.       if (*p1 == '/')
  280. + #endif
  281.         p = p1 + 1;
  282.       p1++;
  283.         }
  284. ***************
  285. *** 1923,1928 ****
  286. --- 2036,2042 ----
  287.     return 0;
  288.   }
  289.   
  290. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  291.   /* Given a colon-separated list of file names PATH,
  292.      add all the names to the search path for include files.  */
  293.   
  294. ***************
  295. *** 1969,1974 ****
  296. --- 2083,2089 ----
  297.         p++;
  298.       }
  299.   }
  300. + #endif /* atarist */
  301.   
  302.   /* Pre-C-Preprocessor to translate ANSI trigraph idiocy in BUF
  303.      before main CCCP processing.  Name `pcp' is also in honor of the
  304. ***************
  305. *** 3146,3151 ****
  306. --- 3261,3267 ----
  307.     assertions_flag = save_assertions_flag;
  308.     return obuf;
  309.   }
  310. + /* #endif */
  311.   
  312.   /*
  313.    * Process a # directive.  Expects IP->bufp to point after the '#', as in
  314. ***************
  315. *** 3608,3615 ****
  316. --- 3724,3740 ----
  317.   
  318.         if (string)
  319.       {
  320. + #ifndef atarist
  321.         buf = (char *) alloca (3 + strlen (string));
  322.         sprintf (buf, "\"%s\"", string);
  323. + #else
  324. +           buf = (char *) alloca (16 + strlen (string));
  325. +           {
  326. +           char *tbuf = (char *) alloca (16 + strlen (string));
  327. +           (void) slashifying_bcopy(string, tbuf, strlen(string)+1);
  328. +           sprintf (buf, "\"%s\"", tbuf);
  329. +           }
  330. + #endif /* atarist */
  331.       }
  332.         else
  333.       buf = "\"\"";
  334. ***************
  335. *** 3841,3847 ****
  336. --- 3966,3977 ----
  337.           dsp[0].next = search_start;
  338.           search_start = dsp;
  339.   #ifndef VMS
  340. + #ifdef atarist
  341. +         if((ep = rindex(nam, '\\')) == NULL)
  342. +         ep = rindex(nam, '/');
  343. + #else
  344.           ep = rindex (nam, '/');
  345. + #endif
  346.   #else                /* VMS */
  347.           ep = rindex (nam, ']');
  348.           if (ep == NULL) ep = rindex (nam, '>');
  349. ***************
  350. *** 3921,3929 ****
  351. --- 4051,4073 ----
  352.   
  353.     /* If specified file name is absolute, just open it.  */
  354.   
  355. + #ifdef atarist
  356. +   if ((*fbeg == '\\') || (*fbeg == '/')) {
  357. +     if(fbeg[2] == ':')
  358. +     { /* allow "\D:\xxx" */
  359. +         strncpy (fname, fbeg+1, flen-1);
  360. +         fname[flen-1] = 0;
  361. +     }
  362. +     else
  363. +     {  /* allow "\lib\xxx" == "\currentdrive:\lib\xxx" */
  364. +         strncpy (fname, fbeg, flen);
  365. +         fname[flen] = 0;
  366. +     }
  367. + #else
  368.     if (*fbeg == '/') {
  369.       strncpy (fname, fbeg, flen);
  370.       fname[flen] = 0;
  371. + #endif
  372.       if (redundant_include_p (fname))
  373.         return 0;
  374.       if (importing)
  375. ***************
  376. *** 3944,3950 ****
  377. --- 4088,4098 ----
  378.       if (searchptr->fname[0] == 0)
  379.         continue;
  380.       strcpy (fname, searchptr->fname);
  381. + #ifdef atarist
  382. +     strcat (fname, "\\");
  383. + #else
  384.       strcat (fname, "/");
  385. + #endif
  386.       fname[strlen (fname) + flen] = 0;
  387.         } else {
  388.       fname[0] = 0;
  389. ***************
  390. *** 4054,4070 ****
  391.   
  392.       if (!no_precomp)
  393.         do {
  394.       sprintf (pcftry, "%s%d", fname, pcfnum++);
  395.       
  396.       pcf = open (pcftry, O_RDONLY, 0666);
  397.       if (pcf != -1)
  398.         {
  399.           struct stat s;
  400.   
  401.           fstat (pcf, &s);
  402.           if (bcmp (&stat_f.st_ino, &s.st_ino, sizeof (s.st_ino))
  403.           || stat_f.st_dev != s.st_dev)
  404. !           {
  405.           pcfbuf = check_precompiled (pcf, fname, &pcfbuflimit);
  406.           /* Don't need it any more.  */
  407.           close (pcf);
  408. --- 4202,4260 ----
  409.   
  410.       if (!no_precomp)
  411.         do {
  412. + #ifdef atarist
  413. +     int numlen;
  414. +     char *dot;
  415. +     char *slash;
  416. +     /* cut extension to 3 chars and dont depend on UNIXMODE           */
  417. +     /* this will have to be done when saving precompiled headers, too */
  418. +     /* but as far as I tried, they dont work up to now, anyway   (AL) */
  419. +       if( pcfnum>=100 )     numlen=3;
  420. +       else if( pcfnum>=10 ) numlen=2;
  421. +       else                  numlen=1;
  422. +       dot=strrchr( fname, '.' );
  423. +       if( (slash=strrchr( fname, '/')) && slash>dot )
  424. +         dot=NULL;
  425. +       else
  426. +       if( (slash=strrchr( fname, '\\')) && slash>dot )
  427. +         dot=NULL;
  428. +       if( dot ) {
  429. +         if( strlen(dot)-1>3-numlen ) {
  430. +           sprintf(pcftry, "%.*s%d", strlen(fname)-(strlen(dot)-(4-numlen)),
  431. +                   fname, pcfnum++);
  432. +         } else {
  433. +           sprintf(pcftry, "%s%d", fname, pcfnum++);
  434. +         }
  435. +       } else {
  436. +         sprintf( pcftry, "%s.%d", fname, pcfnum++);
  437. +       }
  438. + #else    /* looks like we got a sane filesystem */
  439.       sprintf (pcftry, "%s%d", fname, pcfnum++);
  440. + #endif
  441. + #if 0
  442. +     fprintf ( stderr, "trying precompiled file %s.\n", pcftry );
  443. + #endif
  444.       
  445.       pcf = open (pcftry, O_RDONLY, 0666);
  446.       if (pcf != -1)
  447.         {
  448. + #ifndef atarist
  449. +         /* dont bother with this on the ST since these field are faked
  450. +          * anyways
  451. +              */
  452.           struct stat s;
  453.   
  454.           fstat (pcf, &s);
  455.           if (bcmp (&stat_f.st_ino, &s.st_ino, sizeof (s.st_ino))
  456.           || stat_f.st_dev != s.st_dev)
  457. ! #else
  458. !         if (1)
  459. ! #endif
  460. !               {
  461.           pcfbuf = check_precompiled (pcf, fname, &pcfbuflimit);
  462.           /* Don't need it any more.  */
  463.           close (pcf);
  464. ***************
  465. *** 6958,6965 ****
  466. --- 7148,7159 ----
  467.     check_expand (op, len + 1);
  468.     if (op->bufp > op->buf && op->bufp[-1] != '\n')
  469.       *op->bufp++ = '\n';
  470. + #ifdef atarist
  471. +   op->bufp = slashifying_bcopy (line_cmd_buf, op->bufp, len);
  472. + #else
  473.     bcopy (line_cmd_buf, op->bufp, len);
  474.     op->bufp += len;
  475. + #endif
  476.     op->lineno = ip->lineno;
  477.   }
  478.   
  479. ***************
  480. *** 8703,8708 ****
  481. --- 8897,8903 ----
  482.     deps_buffer[deps_size] = 0;
  483.   }
  484.   
  485. + #if (!(defined(atarist) || defined(atariminix)))
  486.   #if defined(USG) || defined(VMS)
  487.   #ifndef BSTRING
  488.   
  489. ***************
  490. *** 8739,8745 ****
  491.   }
  492.   #endif /* not BSTRING */
  493.   #endif /* USG or VMS */
  494.   
  495.   static void
  496.   fatal (str, arg)
  497. --- 8934,8940 ----
  498.   }
  499.   #endif /* not BSTRING */
  500.   #endif /* USG or VMS */
  501. ! #endif /* any atari */
  502.   
  503.   static void
  504.   fatal (str, arg)
  505. ===================================================================
  506. RCS file: /net/acae127/home/bammi/etc/src/master/gnu/gcc/cp-tree.c,v
  507. retrieving revision 1.1.1.1
  508. diff -c -r1.1.1.1 cp-tree.c
  509. *** 1.1.1.1    1993/05/18 23:51:50
  510. --- cp-tree.c    1993/05/21 12:35:31
  511. ***************
  512. *** 1651,1656 ****
  513. --- 1651,1657 ----
  514.     print_class_statistics ();
  515.   }
  516.   
  517. + #ifndef atarist
  518.   /* This is used by the `assert' macro.  It is provided in libgcc.a,
  519.      which `cc' doesn't know how to link.  Note that the C++ front-end
  520.      no longer actually uses the `assert' macro (instead, it calls
  521. ***************
  522. *** 1673,1678 ****
  523. --- 1674,1680 ----
  524.     fflush (stderr);
  525.     abort ();
  526.   }
  527. + #endif
  528.   
  529.   /* Return, as an INTEGER_CST node, the number of elements for
  530.      TYPE (which is an ARRAY_TYPE).  This counts only elements of the top array. */
  531. ===================================================================
  532. RCS file: /net/acae127/home/bammi/etc/src/master/gnu/gcc/gcc.c,v
  533. retrieving revision 1.1.1.1
  534. diff -c -r1.1.1.1 gcc.c
  535. *** 1.1.1.1    1993/05/18 23:52:03
  536. --- gcc.c    1993/05/21 12:35:34
  537. ***************
  538. *** 30,35 ****
  539. --- 30,44 ----
  540.   Once it knows which kind of compilation to perform, the procedure for
  541.   compilation is specified by a string called a "spec".  */
  542.   
  543. + #ifdef CROSSATARI
  544. + #ifdef atarist
  545. + #undef atarist
  546. + #endif
  547. + #ifdef atariminix
  548. + #undef atariminix
  549. + #endif
  550. + #endif
  551. +   
  552.   #include <sys/types.h>
  553.   #include <ctype.h>
  554.   #include <signal.h>
  555. ***************
  556. *** 65,71 ****
  557.   #define NULL_PTR ((GENERIC_PTR)0)
  558.   #endif
  559.   
  560. ! #ifdef USG
  561.   #define vfork fork
  562.   #endif /* USG */
  563.   
  564. --- 74,80 ----
  565.   #define NULL_PTR ((GENERIC_PTR)0)
  566.   #endif
  567.   
  568. ! #if (defined(USG) || defined(atariminix))
  569.   #define vfork fork
  570.   #endif /* USG */
  571.   
  572. ***************
  573. *** 97,102 ****
  574. --- 106,124 ----
  575.   #define PATH_SEPARATOR ':'
  576.   #endif
  577.   
  578. + #ifdef CROSSATARI
  579. + #include <ctype.h>
  580. + #include <string.h>
  581. + #endif
  582. + #ifdef atarist
  583. + #include <osbind.h>
  584. + #include <ctype.h>
  585. + #include <fcntl.h>        /* fgth, for redirection of stderr */
  586. + #include <string.h>
  587. + long _stksize = 8192;
  588. + #endif
  589.   #define obstack_chunk_alloc xmalloc
  590.   #define obstack_chunk_free free
  591.   
  592. ***************
  593. *** 157,163 ****
  594. --- 179,187 ----
  595.      pass the compiler in building the list of pointers to constructors
  596.      and destructors.  */
  597.   
  598. + #if (!(defined(CROSSATARI) || defined(atarist)))
  599.   static struct obstack collect_obstack;
  600. + #endif
  601.   
  602.   extern char *version_string;
  603.   
  604. ***************
  605. *** 453,459 ****
  606.              %{aux-info*}\
  607.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  608.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  609. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  610.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  611.                         %{!pipe:%g.s} %A\n }}}}"},
  612.     {"-",
  613. --- 477,483 ----
  614.              %{aux-info*}\
  615.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  616.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  617. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  618.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  619.                         %{!pipe:%g.s} %A\n }}}}"},
  620.     {"-",
  621. ***************
  622. *** 486,492 ****
  623.              %{aux-info*}\
  624.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  625.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  626. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  627.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  628.                         %{!pipe:%g.s} %A\n }}}}"},
  629.     {".h", "@c-header"},
  630. --- 510,516 ----
  631.              %{aux-info*}\
  632.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  633.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  634. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  635.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  636.                         %{!pipe:%g.s} %A\n }}}}"},
  637.     {".h", "@c-header"},
  638. ***************
  639. *** 521,527 ****
  640.              %{aux-info*}\
  641.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  642.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  643. !               %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  644.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  645.                         %{!pipe:%g.s} %A\n }}}}"},
  646.     {".i", "@cpp-output"},
  647. --- 545,551 ----
  648.              %{aux-info*}\
  649.              %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  650.              %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  651. !               %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  652.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  653.                         %{!pipe:%g.s} %A\n }}}}"},
  654.     {".i", "@cpp-output"},
  655. ***************
  656. *** 532,538 ****
  657.       %{aux-info*}\
  658.       %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  659.       %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  660. !     %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  661.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %{!pipe:%g.s} %A\n }"},
  662.     {".ii", "@c++-cpp-output"},
  663.     {"@c++-cpp-output",
  664. --- 556,562 ----
  665.       %{aux-info*}\
  666.       %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  667.       %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  668. !     %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  669.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %{!pipe:%g.s} %A\n }"},
  670.     {".ii", "@c++-cpp-output"},
  671.     {"@c++-cpp-output",
  672. ***************
  673. *** 542,555 ****
  674.           %{aux-info*}\
  675.           %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  676.           %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  677. !        %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  678.              %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  679.              %{!pipe:%g.s} %A\n }"},
  680.     {".s", "@assembler"},
  681.     {"@assembler",
  682. !    "%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  683.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %i %A\n }"},
  684.     {".S", "@assembler-with-cpp"},
  685.     {"@assembler-with-cpp",
  686.      "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
  687.       %{C:%{!E:%eGNU C does not support -C without using -E}}\
  688. --- 566,582 ----
  689.           %{aux-info*}\
  690.           %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
  691.           %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
  692. !        %{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  693.              %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  694.              %{!pipe:%g.s} %A\n }"},
  695.     {".s", "@assembler"},
  696.     {"@assembler",
  697. !    "%{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  698.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %i %A\n }"},
  699.     {".S", "@assembler-with-cpp"},
  700. +   {".ss", "@assembler-with-cpp"},
  701. +   {".cpp", "@assembler-with-cpp"},
  702. +   {".spp", "@assembler-with-cpp"},
  703.     {"@assembler-with-cpp",
  704.      "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
  705.       %{C:%{!E:%eGNU C does not support -C without using -E}}\
  706. ***************
  707. *** 559,565 ****
  708.           %{traditional-cpp:-traditional}\
  709.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\
  710.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
  711. !    "%{!M:%{!MM:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
  712.                       %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  713.               %{!pipe:%g.s} %A\n }}}}"},
  714.     /* Mark end of table */
  715. --- 586,592 ----
  716.           %{traditional-cpp:-traditional}\
  717.       %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\
  718.           %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
  719. !    "%{!M:%{!MM:%{!E:%{!S:as %{v} %{R} %{j} %{J} %{h} %{d2} %a %Y\
  720.                       %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
  721.               %{!pipe:%g.s} %A\n }}}}"},
  722.     /* Mark end of table */
  723. ***************
  724. *** 573,578 ****
  725. --- 600,614 ----
  726.   
  727.   /* Here is the spec for running the linker, after compiling all files.  */
  728.   
  729. + #if (defined(CROSSATARI) || defined(atarist) || defined(atariminix))
  730. + static char *link_command_spec = 
  731. +  "%{!fsyntax-only: \
  732. +     %{!c:%{!M*:%{!E:%{!S:ld %X %{v} %{G} %{o*} %l\
  733. +       %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\
  734. +       %{y*} %{!nostdlib:%S} \
  735. +       %{L*} %o %{!nostdlib:%s %L}\n }}}}}";
  736. + #else
  737.   /* -u* was put back because both BSD and SysV seem to support it.  */
  738.   /* %{static:} simply prevents an error message if the target machine
  739.      doesn't handle -static.  */
  740. ***************
  741. *** 603,608 ****
  742. --- 639,645 ----
  743.               %{L*} %D %o %{!nostdlib:-lgcc %L -lgcc %{!A:%E}}\n }}}}}}";
  744.   #endif
  745.   #endif
  746. + #endif
  747.   
  748.   /* A vector of options to give to the linker.
  749.      These options are accumulated by -Xlinker and -Wl,
  750. ***************
  751. *** 821,826 ****
  752. --- 858,864 ----
  753.     *argcp = newindex;
  754.   }
  755.   
  756. + #if (!(defined(atarist) || defined(CROSSATARI) || defined(atariminix)))
  757.   /* Read compilation specs from a file named FILENAME,
  758.      replacing the default ones.
  759.   
  760. ***************
  761. *** 959,964 ****
  762. --- 997,1003 ----
  763.   
  764.     return p;
  765.   }
  766. + #endif /* ataris */
  767.   
  768.   /* Structure to keep track of the specs that have been defined so far.  These
  769.      are accessed using %(specname) or %[specname] in a compiler or link spec. */
  770. ***************
  771. *** 1075,1080 ****
  772. --- 1114,1126 ----
  773.   /* Name with which this program was invoked.  */
  774.   
  775.   static char *programname;
  776. + #ifdef atarist
  777. + /* Flag indicating, that stderr should be redirected for the child
  778. +    processes */
  779. + unsigned char zflag;
  780. + #endif
  781.   
  782.   /* Structures to keep track of prefixes to try when looking for files. */
  783.   
  784. ***************
  785. *** 1333,1340 ****
  786.   static void
  787.   choose_temp_base ()
  788.   {
  789. -   char *base = getenv ("TMPDIR");
  790.     int len;
  791.   
  792.     if (base == (char *)0)
  793.       {
  794. --- 1379,1403 ----
  795.   static void
  796.   choose_temp_base ()
  797.   {
  798.     int len;
  799. + #if (!(defined(atarist) || defined(atariminix)))
  800. +   char *base = getenv ("TMPDIR");
  801. + #else
  802. +   char *base = getenv ("TEMP");
  803. +   if(base == (char *)0)
  804. +   {
  805. +       base = getenv("TMPDIR");
  806. +       if(base == (char *)0)
  807. +       base = getenv("TMP");
  808. +   }
  809. +   if(base != (char *)0)
  810. +   {
  811. +       char *newbase = alloca(FILENAME_MAX);
  812. +       dos2unx(base,newbase);
  813. +       base = newbase;
  814. +   }
  815. + #endif
  816.   
  817.     if (base == (char *)0)
  818.       {
  819. ***************
  820. *** 1354,1360 ****
  821.     len = strlen (base);
  822.     temp_filename = xmalloc (len + sizeof("/ccXXXXXX"));
  823.     strcpy (temp_filename, base);
  824. !   if (len > 0 && temp_filename[len-1] != '/')
  825.       temp_filename[len++] = '/';
  826.     strcpy (temp_filename + len, "ccXXXXXX");
  827.   
  828. --- 1417,1427 ----
  829.     len = strlen (base);
  830.     temp_filename = xmalloc (len + sizeof("/ccXXXXXX"));
  831.     strcpy (temp_filename, base);
  832. !   if (len > 0 && (temp_filename[len-1] != '/' 
  833. ! #ifdef atarist
  834. !           || temp_filename[len-1] != '\\'
  835. ! #endif
  836. !            ))
  837.       temp_filename[len++] = '/';
  838.     strcpy (temp_filename + len, "ccXXXXXX");
  839.   
  840. ***************
  841. *** 1373,1378 ****
  842. --- 1440,1446 ----
  843.      use come from an obstack, we don't have to worry about allocating
  844.      space for them.  */
  845.   
  846. + #if (!(defined(CROSSATARI) || defined(atarist)))
  847.   #ifndef HAVE_PUTENV
  848.   
  849.   void
  850. ***************
  851. *** 1474,1479 ****
  852. --- 1542,1548 ----
  853.     obstack_1grow (&collect_obstack, '\0');
  854.     putenv (obstack_finish (&collect_obstack));
  855.   }
  856. + #endif /* ataris */
  857.   
  858.   
  859.   /* Search for NAME using the prefix list PREFIXES.  MODE is passed to
  860. ***************
  861. *** 1749,1754 ****
  862. --- 1818,1824 ----
  863.   
  864.   #else /* not __MSDOS__ */
  865.   
  866. + #ifndef atarist
  867.   static int
  868.   pexecute (search_flag, program, argv, not_last)
  869.        int search_flag;
  870. ***************
  871. *** 1837,1842 ****
  872. --- 1907,1913 ----
  873.       }
  874.   }
  875.   
  876. + #endif /* not atarist */
  877.   #endif /* not __MSDOS__ */
  878.   #else /* not OS2 */
  879.   
  880. ***************
  881. *** 1867,1882 ****
  882.       {
  883.         char *prog;        /* program name.  */
  884.         char **argv;        /* vector of args.  */
  885.         int pid;            /* pid of process for this command.  */
  886.       };
  887.   
  888.     struct command *commands;    /* each command buffer with above info.  */
  889.   
  890.     /* Count # of piped commands.  */
  891.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  892.       if (strcmp (argbuf[i], "|") == 0)
  893.         n_commands++;
  894.     /* Get storage for each command.  */
  895.     commands
  896.       = (struct command *) alloca (n_commands * sizeof (struct command));
  897. --- 1938,1958 ----
  898.       {
  899.         char *prog;        /* program name.  */
  900.         char **argv;        /* vector of args.  */
  901. + #ifndef atarist
  902.         int pid;            /* pid of process for this command.  */
  903. + #endif
  904.       };
  905.   
  906.     struct command *commands;    /* each command buffer with above info.  */
  907.   
  908. + #ifndef atarist
  909.     /* Count # of piped commands.  */
  910.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  911.       if (strcmp (argbuf[i], "|") == 0)
  912.         n_commands++;
  913. ! #else
  914. !   n_commands = 1;
  915. ! #endif
  916.     /* Get storage for each command.  */
  917.     commands
  918.       = (struct command *) alloca (n_commands * sizeof (struct command));
  919. ***************
  920. *** 1891,1896 ****
  921. --- 1967,1973 ----
  922.     if (string)
  923.       commands[0].argv[0] = string;
  924.   
  925. + #ifndef atarist
  926.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  927.       if (strcmp (argbuf[i], "|") == 0)
  928.         {                /* each command.  */
  929. ***************
  930. *** 1905,1910 ****
  931. --- 1982,1990 ----
  932.         commands[n_commands].argv[0] = string;
  933.       n_commands++;
  934.         }
  935. + #else
  936. +   n_commands = 1;
  937. + #endif
  938.   
  939.     argbuf[argbuf_index] = 0;
  940.   
  941. ***************
  942. *** 1920,1928 ****
  943. --- 2000,2010 ----
  944.         for (j = commands[i].argv; *j; j++)
  945.           fprintf (stderr, " %s", *j);
  946.   
  947. + #ifndef atarist
  948.         /* Print a pipe symbol after all but the last command.  */
  949.         if (i + 1 != n_commands)
  950.           fprintf (stderr, " |");
  951. + #endif
  952.         fprintf (stderr, "\n");
  953.       }
  954.         fflush (stderr);
  955. ***************
  956. *** 1937,1953 ****
  957. --- 2019,2045 ----
  958.   #endif /* DEBUG */
  959.       }
  960.   
  961. + #ifndef atarist
  962.     /* Run each piped subprocess.  */
  963.   
  964.     last_pipe_input = STDIN_FILE_NO;
  965.     for (i = 0; i < n_commands; i++)
  966.       {
  967. + #ifndef atariminix
  968.         char *string = commands[i].argv[0];
  969.   
  970.         commands[i].pid = pexecute (string != commands[i].prog,
  971.                     string, commands[i].argv,
  972.                     i + 1 < n_commands);
  973.   
  974. + #else
  975. +       extern int execv();
  976. +       char *string = commands[i].argv[0];
  977. +       commands[i].pid = pexecute (execv,
  978. +                   string, commands[i].argv,
  979. +                   i + 1 < n_commands);
  980. + #endif
  981.         if (string != commands[i].prog)
  982.       free (string);
  983.       }
  984. ***************
  985. *** 1994,1999 ****
  986. --- 2086,2136 ----
  987.         }
  988.       return ret_code;
  989.     }
  990. + #else /* atarist */
  991. +  {
  992. +      register int iii;
  993. +      int errfd, oldfd;
  994. +      char **j;
  995. +      execution_count++;
  996. +      if (zflag)
  997. +        {
  998. +      errfd = Fopen("compile.err", 2);
  999. +      if (errfd < __SMALLEST_VALID_HANDLE)
  1000. +        errfd = Fcreate("compile.err", 0);
  1001. +      else
  1002. +        Fseek(0L, errfd, 2);
  1003. +      if (errfd >= __SMALLEST_VALID_HANDLE)
  1004. +        {
  1005. +          oldfd = Fdup (2);
  1006. +          Fforce(2, errfd);
  1007. +        }
  1008. +      else
  1009. +        {
  1010. +          error("cannot open %s", "compile.err");
  1011. +          zflag = 0;        /* no redirection */
  1012. +        }
  1013. +        }
  1014. +      for (i = 0; i < n_commands ; i++)
  1015. +      {
  1016. +          j = commands[i].argv;
  1017. +          iii = spawnve(0, j[0], j, NULL);
  1018. +      if(iii != 0)
  1019. +          break;
  1020. +      }
  1021. +      if (zflag)
  1022. +        {
  1023. +      Fforce(2, oldfd);
  1024. +      Fclose(oldfd);
  1025. +      Fclose(errfd);
  1026. +        }
  1027. +      if (iii != 0)
  1028. +        return -1;
  1029. +      else
  1030. +        return 0;
  1031. +  }
  1032. + #endif /* atarist */  
  1033.   }
  1034.   
  1035.   /* Find all the switches given to us
  1036. ***************
  1037. *** 2057,2062 ****
  1038. --- 2194,2200 ----
  1039.   
  1040.     /* Set up the default search paths.  */
  1041.   
  1042. + #ifndef CROSSATARI
  1043.     if (gcc_exec_prefix)
  1044.       {
  1045.         add_prefix (&exec_prefix, gcc_exec_prefix, 0, 0, NULL_PTR);
  1046. ***************
  1047. *** 2131,2136 ****
  1048. --- 2269,2275 ----
  1049.           endp++;
  1050.       }
  1051.       }
  1052. + #endif /* CROSSATARI */
  1053.   
  1054.     /* Use LPATH like LIBRARY_PATH (for the CMU build program).  */
  1055.     temp = getenv ("LPATH");
  1056. ***************
  1057. *** 2339,2344 ****
  1058. --- 2478,2489 ----
  1059.             n_switches++;
  1060.             break;
  1061.           }
  1062. + #ifdef atarist
  1063. +         case 'z':    /* redirect stderr to a file */
  1064. +           zflag++;
  1065. +           n_switches++;
  1066. +           break;
  1067. + #endif
  1068.           default:
  1069.             n_switches++;
  1070.   
  1071. ***************
  1072. *** 2376,2386 ****
  1073. --- 2521,2542 ----
  1074.        (such as cpp) rather than those of the host system.  */
  1075.     /* Use 2 as fourth arg meaning try just the machine as a suffix,
  1076.        as well as trying the machine and the version.  */
  1077. + #if (defined(atarist) || defined(CROSSATARI) || defined(WEIRD))
  1078. + /* NB defined(WEIRD) should not really be there, its only for my weird setup */
  1079. +   /* We are not using machine_suffix here, so do not make */
  1080. +   /* these prefixes available only when we have one       */
  1081. +   add_prefix (&exec_prefix, standard_exec_prefix, 0, 0, NULL_PTR);
  1082. +   add_prefix (&exec_prefix, standard_exec_prefix_1, 0, 0, NULL_PTR);
  1083. +   add_prefix (&startfile_prefix, standard_exec_prefix, 0, 0, NULL_PTR);
  1084. +   add_prefix (&startfile_prefix, standard_exec_prefix_1, 0, 0, NULL_PTR);
  1085. + #else
  1086.     add_prefix (&exec_prefix, standard_exec_prefix, 0, 2, NULL_PTR);
  1087.     add_prefix (&exec_prefix, standard_exec_prefix_1, 0, 2, NULL_PTR);
  1088.   
  1089.     add_prefix (&startfile_prefix, standard_exec_prefix, 0, 1, NULL_PTR);
  1090.     add_prefix (&startfile_prefix, standard_exec_prefix_1, 0, 1, NULL_PTR);
  1091. + #endif /* (defined(atarist) || defined(CROSSATARI)) */
  1092.   
  1093.     add_prefix (&exec_prefix, concat (tooldir_prefix, "bin", "/"),
  1094.             0, 0, NULL_PTR);
  1095. ***************
  1096. *** 2565,2570 ****
  1097. --- 2721,2735 ----
  1098.   /* Nonzero means that the input of this command is coming from a pipe.  */
  1099.   static int input_from_pipe;
  1100.   
  1101. + #ifdef atarist
  1102. + /* I don't know why this is necessary.  Recursive calls to do_spec_1
  1103. +    end up ignoring the error code from calls to execute().  That causes
  1104. +    do_spec to get a 0 return value, and do_spec_1("\n"), which causes the
  1105. +    command to get executed again.
  1106. + */
  1107. + int execute_return_error = 0;
  1108. + #endif
  1109.   /* Process the spec SPEC and run the commands specified therein.
  1110.      Returns 0 if the spec is successfully processed; -1 if failed.  */
  1111.   
  1112. ***************
  1113. *** 2585,2594 ****
  1114. --- 2750,2768 ----
  1115.   
  1116.     /* Force out any unfinished command.
  1117.        If -pipe, this forces out the last command if it ended in `|'.  */
  1118. + #ifdef atarist
  1119. +   if (!value && execute_return_error)
  1120. +     {
  1121. +     value = execute_return_error;
  1122. +     execute_return_error = 0;
  1123. +     }
  1124. + #endif
  1125.     if (value == 0)
  1126.       {
  1127. + #ifndef atarist
  1128.         if (argbuf_index > 0 && !strcmp (argbuf[argbuf_index - 1], "|"))
  1129.       argbuf_index--;
  1130. + #endif
  1131.   
  1132.         if (argbuf_index > 0)
  1133.       value = execute ();
  1134. ***************
  1135. *** 2626,2631 ****
  1136. --- 2800,2856 ----
  1137.          Otherwise, NL, SPC, TAB and % are special.  */
  1138.       switch (inswitch ? 'a' : c)
  1139.         {
  1140. + #if (defined(atarist) || defined(CROSSATARI))
  1141. + /* this stuff added by jrd.  if see '$', expect name of env var, delimited
  1142. +    by '$'.  Find it's value, and subst it in.
  1143. +    modified by ERS to only collect things that look like names; this
  1144. +    saves e.g. the -$ arg. to cpp from getting munged */
  1145. +       case '$':
  1146. +       {
  1147. +     char varname[32];        /* should be enough */
  1148. +     char * value;            /* deciphered value string */
  1149. +     char *temp;
  1150. +     int i;
  1151. +     extern char *getenv(), *index();
  1152. +     
  1153. +     for (i = 0 ; ((c = *p) != '$') && isalnum(c) && i < 31 ; i++, p++)
  1154. +         varname[i] = c;
  1155. +     varname[i] = '\0';
  1156. +     if (strlen(varname) > 0) /* ++jrb fix */
  1157. +     {
  1158. +                  ++p;    /* skip trailing '$' */
  1159. +         value = getenv(varname); /* ++jrb fix */
  1160. +         if (value)
  1161. +         { /* if value is a path, only consider 1'st component */
  1162. + #ifdef atarist
  1163. +             if((temp = index(value, ',')) == NULL)
  1164. +                 temp = index(value, ';');
  1165. + #else
  1166. +             temp = index(value, ':');
  1167. + #endif
  1168. +             if(temp != NULL)
  1169. +             {
  1170. +                 char *t = (char *) alloca(strlen(value) + 1);
  1171. +                 strcpy(t, value);
  1172. +                 t[temp-value] = '\0';
  1173. +                 do_spec_1(t, 0);
  1174. +             }
  1175. +             else
  1176. +                 do_spec_1(value, 0);
  1177. +         }
  1178. +             else
  1179. +             do_spec_1(".", 0);    /* a compleat kludge... */
  1180. +     }
  1181. +         else
  1182. +         {
  1183. +              obstack_1grow(&obstack, '$');
  1184. +              arg_going = 1;
  1185. +         }
  1186. +       }
  1187. +      break;
  1188. + #endif /* atarist */
  1189.         case '\n':
  1190.       /* End of line: finish any pending argument,
  1191.          then run the pending command if one has been started.  */
  1192. ***************
  1193. *** 2664,2669 ****
  1194. --- 2889,2898 ----
  1195.       if (argbuf_index > 0)
  1196.         {
  1197.           value = execute ();
  1198. + #ifdef atarist
  1199. +         if (!execute_return_error)
  1200. +             execute_return_error = value;
  1201. + #endif
  1202.           if (value)
  1203.             return value;
  1204.         }
  1205. ***************
  1206. *** 3279,3291 ****
  1207. --- 3508,3528 ----
  1208.           break;
  1209.   
  1210.         default:
  1211. + #if 1 /* atarist */
  1212. +         fprintf(stderr, "Bogus char '%c' found at pos %d of spec '%s'\n",
  1213. +         c, (p - spec - 1), spec);
  1214. + #endif
  1215.           abort ();
  1216.         }
  1217.       break;
  1218.   
  1219. + #ifndef atarist
  1220. +       /* on the atari it is important to preserve backslash in spec */
  1221. +       /* so just let it go into default case */
  1222.         case '\\':
  1223.       /* Backslash: treat next character as ordinary.  */
  1224.       c = *p++;
  1225. + #endif
  1226.   
  1227.       /* fall through */
  1228.         default:
  1229. ***************
  1230. *** 3562,3567 ****
  1231. --- 3799,3805 ----
  1232.   
  1233.   /* On fatal signals, delete all the temporary files.  */
  1234.   
  1235. + #ifndef atarist
  1236.   static void
  1237.   fatal_error (signum)
  1238.        int signum;
  1239. ***************
  1240. *** 3573,3578 ****
  1241. --- 3811,3817 ----
  1242.        so its normal effect occurs.  */
  1243.     kill (getpid (), signum);
  1244.   }
  1245. + #endif
  1246.   
  1247.   int
  1248.   main (argc, argv)
  1249. ***************
  1250. *** 3587,3592 ****
  1251. --- 3826,3836 ----
  1252.     char *specs_file;
  1253.     char *p;
  1254.   
  1255. + #ifdef atarist
  1256. + /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  1257. + /*  _malloczero(1); */     /* zero mallocs by default */
  1258. +   programname = "gcc";
  1259. + #else  
  1260.     p = argv[0] + strlen (argv[0]);
  1261.     while (p != argv[0] && p[-1] != '/') --p;
  1262.     programname = p;
  1263. ***************
  1264. *** 3603,3614 ****
  1265. --- 3847,3860 ----
  1266.     if (signal (SIGPIPE, SIG_IGN) != SIG_IGN)
  1267.       signal (SIGPIPE, fatal_error);
  1268.   #endif
  1269. + #endif /* atarist */
  1270.   
  1271.     argbuf_length = 10;
  1272.     argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
  1273.   
  1274.     obstack_init (&obstack);
  1275.   
  1276. + #if (!(defined(atarist) || defined(CROSSATARI)))
  1277.     /* Set up to remember the pathname of gcc and any options
  1278.        needed for collect.  We use argv[0] instead of programname because
  1279.        we need the complete pathname.  */
  1280. ***************
  1281. *** 3616,3621 ****
  1282. --- 3862,3868 ----
  1283.     obstack_grow (&collect_obstack, "COLLECT_GCC=", sizeof ("COLLECT_GCC=")-1);
  1284.     obstack_grow (&collect_obstack, argv[0], strlen (argv[0])+1);
  1285.     putenv (obstack_finish (&collect_obstack));
  1286. + #endif
  1287.   
  1288.     /* Choose directory for temp files.  */
  1289.   
  1290. ***************
  1291. *** 3627,3632 ****
  1292. --- 3874,3888 ----
  1293.   
  1294.     process_command (argc, argv);
  1295.   
  1296. + #if (defined(atarist) || defined(CROSSATARI))
  1297. +   {
  1298. +     char *temp;
  1299. +     
  1300. +     if((temp = getenv ("GCCEXEC")))
  1301. +     add_prefix (&exec_prefix, temp, 0, 0, 0);
  1302. +   }
  1303. + #endif
  1304. +   
  1305.     /* Initialize the vector of specs to just the default.
  1306.        This means one element containing 0s, as a terminator.  */
  1307.   
  1308. ***************
  1309. *** 3634,3639 ****
  1310. --- 3890,3899 ----
  1311.     bcopy (default_compilers, compilers, sizeof default_compilers);
  1312.     n_compilers = n_default_compilers;
  1313.   
  1314. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  1315. +   specs_file = 0;
  1316. + #else
  1317.     /* Read specs from a file if there is one.  */
  1318.   
  1319.     machine_suffix = concat (spec_machine, "/", concat (spec_version, "/", ""));
  1320. ***************
  1321. *** 3643,3648 ****
  1322. --- 3903,3909 ----
  1323.     /* Read the specs file unless it is a default one.  */
  1324.     if (specs_file != 0 && strcmp (specs_file, "specs"))
  1325.       read_specs (specs_file);
  1326. + #endif
  1327.   
  1328.     /* If not cross-compiling, look for startfiles in the standard places.  */
  1329.     /* The fact that these are done here, after reading the specs file,
  1330. ***************
  1331. *** 3695,3701 ****
  1332. --- 3956,3968 ----
  1333.   
  1334.     if (verbose_flag)
  1335.       {
  1336. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  1337. + #include "PatchLev.h"
  1338. +       fprintf (stderr, "gcc-atariST version %s Patchlevel %s\n",
  1339. +            version_string, PatchLevel);
  1340. + #else
  1341.         fprintf (stderr, "gcc version %s\n", version_string);
  1342. + #endif
  1343.         if (n_infiles == 0)
  1344.       exit (0);
  1345.       }
  1346. ***************
  1347. *** 3743,3749 ****
  1348. --- 4010,4021 ----
  1349.   
  1350.         input_basename = input_filename;
  1351.         for (p = input_filename; *p; p++)
  1352. + #ifdef atarist
  1353. +         if (((*p == '/') || (*p == '\\')) && (*(p-1) != ':'))
  1354. +             /* allow both '\' and '/' with  our new lib */
  1355. + #else
  1356.           if (*p == '/')
  1357. + #endif
  1358.             input_basename = p + 1;
  1359.   
  1360.         /* Find a suffix starting with the last period,
  1361. ***************
  1362. *** 3806,3811 ****
  1363. --- 4078,4084 ----
  1364.         int i;
  1365.         int first_time;
  1366.   
  1367. + #if (!(defined(atarist) || defined(CROSSATARI)))
  1368.         /* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
  1369.        for collect.  */
  1370.         putenv_from_prefixes (&exec_prefix, "COMPILER_PATH=");
  1371. ***************
  1372. *** 3836,3841 ****
  1373. --- 4109,4115 ----
  1374.       }
  1375.         obstack_grow (&collect_obstack, "\0", 1);
  1376.         putenv (obstack_finish (&collect_obstack));
  1377. + #endif
  1378.   
  1379.         value = do_spec (link_command_spec);
  1380.         if (value < 0)
  1381. ===================================================================
  1382. RCS file: /net/acae127/home/bammi/etc/src/master/gnu/gcc/getpwd.c,v
  1383. retrieving revision 1.1.1.1
  1384. diff -c -r1.1.1.1 getpwd.c
  1385. *** 1.1.1.1    1993/05/18 23:52:07
  1386. --- getpwd.c    1993/05/21 12:35:37
  1387. ***************
  1388. *** 14,20 ****
  1389.      BSD systems) now provides getcwd as called for by POSIX.  Allow for
  1390.      the few exceptions to the general rule here.  */
  1391.   
  1392. ! #if !(defined (POSIX) || defined (USG) || defined (VMS))
  1393.   #include <sys/param.h>
  1394.   extern char *getwd ();
  1395.   #define getcwd(buf,len) getwd(buf)
  1396. --- 14,20 ----
  1397.      BSD systems) now provides getcwd as called for by POSIX.  Allow for
  1398.      the few exceptions to the general rule here.  */
  1399.   
  1400. ! #if !(defined (POSIX) || defined (USG) || defined (VMS) || defined(atarist) || defined(CROSSHPUX))
  1401.   #include <sys/param.h>
  1402.   extern char *getwd ();
  1403.   #define getcwd(buf,len) getwd(buf)
  1404. ***************
  1405. *** 48,58 ****
  1406.     if (!p && !(errno = failure_errno))
  1407.       {
  1408.         if (! ((p = getenv ("PWD")) != 0
  1409.            && *p == '/'
  1410.            && stat (p, &pwdstat) == 0
  1411.            && stat (".", &dotstat) == 0
  1412.            && dotstat.st_ino == pwdstat.st_ino
  1413. !          && dotstat.st_dev == pwdstat.st_dev))
  1414.   
  1415.       /* The shortcut didn't work.  Try the slow, ``sure'' way.  */
  1416.       for (s = GUESSPATHLEN;  ! getcwd (p = xmalloc (s), s);  s *= 2)
  1417. --- 48,61 ----
  1418.     if (!p && !(errno = failure_errno))
  1419.       {
  1420.         if (! ((p = getenv ("PWD")) != 0
  1421. + #ifndef atarist
  1422.            && *p == '/'
  1423.            && stat (p, &pwdstat) == 0
  1424.            && stat (".", &dotstat) == 0
  1425.            && dotstat.st_ino == pwdstat.st_ino
  1426. !          && dotstat.st_dev == pwdstat.st_dev
  1427. ! #endif
  1428. !          ))
  1429.   
  1430.       /* The shortcut didn't work.  Try the slow, ``sure'' way.  */
  1431.       for (s = GUESSPATHLEN;  ! getcwd (p = xmalloc (s), s);  s *= 2)
  1432. ===================================================================
  1433. RCS file: /net/acae127/home/bammi/etc/src/master/gnu/gcc/toplev.c,v
  1434. retrieving revision 1.1.1.1
  1435. diff -c -r1.1.1.1 toplev.c
  1436. *** 1.1.1.1    1993/05/18 23:52:33
  1437. --- toplev.c    1993/05/21 12:35:41
  1438. ***************
  1439. *** 31,37 ****
  1440.   
  1441.   #include <sys/stat.h>
  1442.   
  1443. ! #ifdef USG
  1444.   #undef FLOAT
  1445.   #include <sys/param.h>
  1446.   /* This is for hpux.  It is a real screw.  They should change hpux.  */
  1447. --- 31,37 ----
  1448.   
  1449.   #include <sys/stat.h>
  1450.   
  1451. ! #if defined(USG) || defined(CROSSHPUX)
  1452.   #undef FLOAT
  1453.   #include <sys/param.h>
  1454.   /* This is for hpux.  It is a real screw.  They should change hpux.  */
  1455. ***************
  1456. *** 41,49 ****
  1457. --- 41,57 ----
  1458.   #undef FFS  /* Some systems define this in param.h.  */
  1459.   #else
  1460.   #ifndef VMS
  1461. + #if (!(defined(atarist) || defined(atariminix)))
  1462.   #include <sys/time.h>
  1463.   #include <sys/resource.h>
  1464. + #endif /* !(atarist || atariminix) */
  1465. + #endif
  1466.   #endif
  1467. + #ifdef atariminix
  1468. + #include <sys/times.h>
  1469. + /* #include <minix/const.h>, avoid dragging this in */
  1470. + #define HZ 60    /* this is the only thing needed from minix/const.h */
  1471.   #endif
  1472.   
  1473.   #include "input.h"
  1474. ***************
  1475. *** 58,63 ****
  1476. --- 66,76 ----
  1477.   #include "xcoffout.h"
  1478.   #endif
  1479.   
  1480. + #ifdef atarist
  1481. + long _stksize = -1L;    /* for all sizes of ST's */
  1482. +     /* -1 means malloc from own heap and keep all  of memory */
  1483. + #endif /* atarist */
  1484.   #ifdef VMS
  1485.   /* The extra parameters substantially improve the I/O performance.  */
  1486.   static FILE *
  1487. ***************
  1488. *** 769,775 ****
  1489.   int
  1490.   get_run_time ()
  1491.   {
  1492. ! #ifdef USG
  1493.     struct tms tms;
  1494.   #else
  1495.   #ifndef VMS
  1496. --- 782,791 ----
  1497.   int
  1498.   get_run_time ()
  1499.   {
  1500. ! #ifdef atarist
  1501. !   long now;
  1502. ! #else
  1503. ! #if (defined(USG) || defined(atariminix) || defined(CROSSHPUX))
  1504.     struct tms tms;
  1505.   #else
  1506.   #ifndef VMS
  1507. ***************
  1508. *** 784,794 ****
  1509.       } vms_times;
  1510.   #endif
  1511.   #endif
  1512.   
  1513.     if (quiet_flag)
  1514.       return 0;
  1515.   
  1516. ! #ifdef USG
  1517.     times (&tms);
  1518.     return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
  1519.   #else
  1520. --- 800,814 ----
  1521.       } vms_times;
  1522.   #endif
  1523.   #endif
  1524. + #endif
  1525.   
  1526.     if (quiet_flag)
  1527.       return 0;
  1528.   
  1529. ! #ifdef atarist
  1530. !   return(time(NULL) * 1000000);
  1531. ! #else
  1532. ! #if (defined(USG) || defined(atariminix) || defined(CROSSHPUX))
  1533.     times (&tms);
  1534.     return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
  1535.   #else
  1536. ***************
  1537. *** 801,806 ****
  1538. --- 821,827 ----
  1539.     return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000;
  1540.   #endif
  1541.   #endif
  1542. + #endif
  1543.   }
  1544.   
  1545.   #define TIMEVAR(VAR, BODY)    \
  1546. ***************
  1547. *** 1437,1442 ****
  1548. --- 1458,1464 ----
  1549.     longjmp (float_handler, 1);
  1550.   }
  1551.   
  1552. + #ifndef atarist
  1553.   /* Handler for SIGPIPE.  */
  1554.   
  1555.   static void
  1556. ***************
  1557. *** 1446,1451 ****
  1558. --- 1468,1474 ----
  1559.   {
  1560.     fatal ("output pipe has been closed");
  1561.   }
  1562. + #endif
  1563.   
  1564.   /* Strip off a legitimate source ending from the input string NAME of
  1565.      length LEN. */
  1566. ***************
  1567. *** 1479,1484 ****
  1568. --- 1502,1508 ----
  1569.       name[len - 4] = 0;
  1570.   }
  1571.   
  1572. + #ifdef SYSV
  1573.   /* Output a file name in the form wanted by System V.  */
  1574.   
  1575.   void
  1576. ***************
  1577. *** 1507,1512 ****
  1578. --- 1531,1537 ----
  1579.   #endif
  1580.   #endif
  1581.   }
  1582. + #endif
  1583.   
  1584.   /* Routine to build language identifier for object file. */
  1585.   static void
  1586. ***************
  1587. *** 1617,1623 ****
  1588. --- 1642,1652 ----
  1589.       {
  1590.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  1591.         strcpy (dumpname, dump_base_name);
  1592. + #ifndef atarist
  1593.         strcat (dumpname, ".jump");
  1594. + #else
  1595. +       strcat (dumpname, ".jmp");
  1596. + #endif
  1597.         jump_opt_dump_file = fopen (dumpname, "w");
  1598.         if (jump_opt_dump_file == 0)
  1599.       pfatal_with_name (dumpname);
  1600. ***************
  1601. *** 1639,1645 ****
  1602. --- 1668,1678 ----
  1603.       {
  1604.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  1605.         strcpy (dumpname, dump_base_name);
  1606. + #ifndef atarist
  1607.         strcat (dumpname, ".loop");
  1608. + #else
  1609. +       strcat (dumpname, ".lop");
  1610. + #endif
  1611.         loop_dump_file = fopen (dumpname, "w");
  1612.         if (loop_dump_file == 0)
  1613.       pfatal_with_name (dumpname);
  1614. ***************
  1615. *** 1650,1656 ****
  1616. --- 1683,1693 ----
  1617.       {
  1618.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  1619.         strcpy (dumpname, dump_base_name);
  1620. + #ifndef atarist
  1621.         strcat (dumpname, ".cse2");
  1622. + #else
  1623. +       strcat (dumpname, ".cs2");
  1624. + #endif
  1625.         cse2_dump_file = fopen (dumpname, "w");
  1626.         if (cse2_dump_file == 0)
  1627.       pfatal_with_name (dumpname);
  1628. ***************
  1629. *** 1661,1667 ****
  1630. --- 1698,1708 ----
  1631.       {
  1632.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  1633.         strcpy (dumpname, dump_base_name);
  1634. + #ifndef atarist
  1635.         strcat (dumpname, ".flow");
  1636. + #else
  1637. +       strcat (dumpname, ".flo");
  1638. + #endif
  1639.         flow_dump_file = fopen (dumpname, "w");
  1640.         if (flow_dump_file == 0)
  1641.       pfatal_with_name (dumpname);
  1642. ***************
  1643. *** 1672,1678 ****
  1644. --- 1713,1723 ----
  1645.       {
  1646.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 10);
  1647.         strcpy (dumpname, dump_base_name);
  1648. + #ifndef atarist
  1649.         strcat (dumpname, ".combine");
  1650. + #else
  1651. +       strcat (dumpname, ".cmb");
  1652. + #endif
  1653.         combine_dump_file = fopen (dumpname, "w");
  1654.         if (combine_dump_file == 0)
  1655.       pfatal_with_name (dumpname);
  1656. ***************
  1657. *** 1683,1689 ****
  1658. --- 1728,1738 ----
  1659.       {
  1660.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 7);
  1661.         strcpy (dumpname, dump_base_name);
  1662. + #ifndef atarist
  1663.         strcat (dumpname, ".sched");
  1664. + #else
  1665. +       strcat (dumpname, ".sch");
  1666. + #endif
  1667.         sched_dump_file = fopen (dumpname, "w");
  1668.         if (sched_dump_file == 0)
  1669.       pfatal_with_name (dumpname);
  1670. ***************
  1671. *** 1694,1700 ****
  1672. --- 1743,1753 ----
  1673.       {
  1674.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  1675.         strcpy (dumpname, dump_base_name);
  1676. + #ifndef atarist
  1677.         strcat (dumpname, ".lreg");
  1678. + #else
  1679. +       strcat (dumpname, ".lrg");
  1680. + #endif
  1681.         local_reg_dump_file = fopen (dumpname, "w");
  1682.         if (local_reg_dump_file == 0)
  1683.       pfatal_with_name (dumpname);
  1684. ***************
  1685. *** 1705,1711 ****
  1686. --- 1758,1768 ----
  1687.       {
  1688.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 6);
  1689.         strcpy (dumpname, dump_base_name);
  1690. + #ifndef atarist
  1691.         strcat (dumpname, ".greg");
  1692. + #else
  1693. +       strcat (dumpname, ".grg");
  1694. + #endif
  1695.         global_reg_dump_file = fopen (dumpname, "w");
  1696.         if (global_reg_dump_file == 0)
  1697.       pfatal_with_name (dumpname);
  1698. ***************
  1699. *** 1716,1722 ****
  1700. --- 1773,1783 ----
  1701.       {
  1702.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 8);
  1703.         strcpy (dumpname, dump_base_name);
  1704. + #ifndef atarist
  1705.         strcat (dumpname, ".sched2");
  1706. + #else
  1707. +       strcat (dumpname, ".sc2");
  1708. + #endif
  1709.         sched2_dump_file = fopen (dumpname, "w");
  1710.         if (sched2_dump_file == 0)
  1711.       pfatal_with_name (dumpname);
  1712. ***************
  1713. *** 1727,1733 ****
  1714. --- 1788,1798 ----
  1715.       {
  1716.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 7);
  1717.         strcpy (dumpname, dump_base_name);
  1718. + #ifndef atarist
  1719.         strcat (dumpname, ".jump2");
  1720. + #else
  1721. +       strcat (dumpname, ".jp2");
  1722. + #endif
  1723.         jump2_opt_dump_file = fopen (dumpname, "w");
  1724.         if (jump2_opt_dump_file == 0)
  1725.       pfatal_with_name (dumpname);
  1726. ***************
  1727. *** 1751,1757 ****
  1728. --- 1816,1826 ----
  1729.       {
  1730.         register char *dumpname = (char *) xmalloc (dump_base_name_length + 10);
  1731.         strcpy (dumpname, dump_base_name);
  1732. + #ifndef atarist
  1733.         strcat (dumpname, ".stack");
  1734. + #else
  1735. +       strcat (dumpname, ".stk");
  1736. + #endif
  1737.         stack_reg_dump_file = fopen (dumpname, "w");
  1738.         if (stack_reg_dump_file == 0)
  1739.       pfatal_with_name (dumpname);
  1740. ***************
  1741. *** 2815,2826 ****
  1742. --- 2884,2905 ----
  1743.     int version_flag = 0;
  1744.     char *p;
  1745.   
  1746. + #ifdef atarist
  1747. + /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  1748. + /*  _malloczero(1); */     /* zero mallocs by default */
  1749. + #endif  
  1750.     /* save in case md file wants to emit args as a comment.  */
  1751.     save_argc = argc;
  1752.     save_argv = argv;
  1753.   
  1754.     p = argv[0] + strlen (argv[0]);
  1755. + #ifndef atarist
  1756.     while (p != argv[0] && p[-1] != '/') --p;
  1757. + #else
  1758. +   while (p != argv[0] && ((p[-1] != '/') && (p[-1] != '\\') &&
  1759. +               (p[-1] != ':'))) --p;
  1760. + #endif
  1761.     progname = p;
  1762.   
  1763.   #ifdef RLIMIT_STACK
  1764. ***************
  1765. *** 2837,2845 ****
  1766. --- 2916,2926 ----
  1767.   
  1768.     signal (SIGFPE, float_signal);
  1769.   
  1770. + #ifndef atarist
  1771.   #ifdef SIGPIPE
  1772.     signal (SIGPIPE, pipe_closed);
  1773.   #endif
  1774. + #endif
  1775.   
  1776.     decl_printable_name = decl_name;
  1777.     lang_expand_expr = (struct rtx_def *(*)()) do_abort;
  1778. ***************
  1779. *** 2938,2943 ****
  1780. --- 3019,3034 ----
  1781.         else if (!strcmp (str, "dumpbase"))
  1782.           {
  1783.             dump_base_name = argv[++i];
  1784. + #ifdef atarist
  1785. + /* dump_base_name will typically be 'foo.c' here.  Need to truncate at the '.',
  1786. +    cause dots mean something here */
  1787. +         {
  1788. +           char * n = dump_base_name;
  1789. +           for ( ; ((*n) && (*n != '.')) ; )
  1790. +         n++;
  1791. +           *n = '\0';
  1792. +         }
  1793. + #endif
  1794.           }
  1795.         else if (str[0] == 'd')
  1796.           {
  1797. ***************
  1798. *** 3348,3354 ****
  1799. --- 3439,3451 ----
  1800.        option flags in use.  */
  1801.     if (version_flag)
  1802.       {
  1803. + #if (defined(atarist) || defined(CROSSATARI) || defined(atariminix))
  1804. + #include "PatchLev.h"
  1805. +         fprintf (stderr, "%s version %s-atariST Patchlevel %s",
  1806. +          language_string, version_string, PatchLevel);
  1807. + #else
  1808.         fprintf (stderr, "%s version %s", language_string, version_string);
  1809. + #endif
  1810.   #ifdef TARGET_VERSION
  1811.         TARGET_VERSION;
  1812.   #endif
  1813. ***************
  1814. *** 3369,3374 ****
  1815. --- 3466,3473 ----
  1816.   
  1817.     compile_file (filename);
  1818.   
  1819. + #if (!(defined(atarist) || defined(atariminix)))
  1820. + #if (!(defined(CROSSHPUX)))
  1821.   #ifndef OS2
  1822.   #ifndef VMS
  1823.     if (flag_print_mem)
  1824. ***************
  1825. *** 3387,3392 ****
  1826. --- 3486,3493 ----
  1827.       }
  1828.   #endif /* not VMS */
  1829.   #endif /* not OS2 */
  1830. + #endif
  1831. + #endif
  1832.   
  1833.     if (errorcount)
  1834.       exit (FATAL_EXIT_CODE);
  1835. ***************
  1836. *** 3498,3500 ****
  1837. --- 3599,3632 ----
  1838.   
  1839.     fprintf (stderr, "\n");
  1840.   }
  1841. + #ifdef atarist
  1842. + void atari_output_filename(file, filename)
  1843. + FILE *file;
  1844. + char *filename;
  1845. + {
  1846. +     if( (!file) || (!filename) ) return;
  1847. +     for(; *filename; filename++)
  1848. +     {
  1849. +     if(*filename == '\\') putc('\\', file);
  1850. +     putc(*filename, file);
  1851. +     }
  1852. + }
  1853. + #include <string.h>
  1854. + char *atari_filename_nondirectory(p)
  1855. + char *p;
  1856. + {
  1857. +     char *s;
  1858. +     
  1859. +     for(s = p + strlen(p); s != p; --s)
  1860. +     {
  1861. +     if((*s == '/') || (*s == '\\'))
  1862. +         break;
  1863. +     }
  1864. +     
  1865. +     return (s == p) ? p : s+1;
  1866. + }
  1867. + #endif
  1868. ===================================================================
  1869. RCS file: /net/acae127/home/bammi/etc/src/master/gnu/gcc/varasm.c,v
  1870. retrieving revision 1.1.1.1
  1871. diff -c -r1.1.1.1 varasm.c
  1872. *** 1.1.1.1    1993/05/18 23:52:37
  1873. --- varasm.c    1993/05/21 12:35:44
  1874. ***************
  1875. *** 996,1009 ****
  1876.   assemble_external_libcall (fun)
  1877.        rtx fun;
  1878.   {
  1879. - #ifdef ASM_OUTPUT_EXTERNAL_LIBCALL
  1880.     /* Declare library function name external when first used, if nec.  */
  1881.     if (! SYMBOL_REF_USED (fun))
  1882.       {
  1883.         SYMBOL_REF_USED (fun) = 1;
  1884.         ASM_OUTPUT_EXTERNAL_LIBCALL (asm_out_file, fun);
  1885. -     }
  1886.   #endif
  1887.   }
  1888.   
  1889.   /* Declare the label NAME global.  */
  1890. --- 996,1009 ----
  1891.   assemble_external_libcall (fun)
  1892.        rtx fun;
  1893.   {
  1894.     /* Declare library function name external when first used, if nec.  */
  1895.     if (! SYMBOL_REF_USED (fun))
  1896.       {
  1897.         SYMBOL_REF_USED (fun) = 1;
  1898. + #ifdef ASM_OUTPUT_EXTERNAL_LIBCALL
  1899.         ASM_OUTPUT_EXTERNAL_LIBCALL (asm_out_file, fun);
  1900.   #endif
  1901. +     }
  1902.   }
  1903.   
  1904.   /* Declare the label NAME global.  */
  1905. ***************
  1906. *** 2266,2271 ****
  1907. --- 2266,2274 ----
  1908.   {
  1909.     struct rtx_const val0, val1;
  1910.   
  1911. +   if (XEXP (x, 0) == pc_rtx || XEXP (x, 1) == pc_rtx)
  1912. +     return XEXP (x, 0) == XEXP (x, 1) ? const0_rtx : x;
  1913.     decode_rtx_const (GET_MODE (x), XEXP (x, 0), &val0);
  1914.     decode_rtx_const (GET_MODE (x), XEXP (x, 1), &val1);
  1915.   
  1916. ===================================================================
  1917. RCS file: /net/acae127/home/bammi/etc/src/master/gnu/gcc/config/m68k/m68k.c,v
  1918. retrieving revision 1.1.1.1
  1919. diff -c -r1.1.1.1 m68k.c
  1920. *** 1.1.1.1    1993/05/18 23:53:20
  1921. --- m68k.c    1993/05/21 12:35:53
  1922. ***************
  1923. *** 60,66 ****
  1924.      
  1925.   finalize_pic ()
  1926.   {
  1927. !   if (flag_pic && current_function_uses_pic_offset_table)
  1928.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  1929.   }
  1930.   
  1931. --- 60,66 ----
  1932.      
  1933.   finalize_pic ()
  1934.   {
  1935. !   if (flag_pic && flag_pic < 3 && current_function_uses_pic_offset_table)
  1936.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  1937.   }
  1938.   
  1939. ***************
  1940. *** 213,219 ****
  1941.         asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
  1942.   #endif
  1943.       }
  1944. !   if (flag_pic && current_function_uses_pic_offset_table)
  1945.       {
  1946.   #ifdef MOTOROLA
  1947.         asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n",
  1948. --- 213,219 ----
  1949.         asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
  1950.   #endif
  1951.       }
  1952. !   if (flag_pic && flag_pic < 3 && current_function_uses_pic_offset_table)
  1953.       {
  1954.   #ifdef MOTOROLA
  1955.         asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n",
  1956. ***************
  1957. *** 800,811 ****
  1958.     /* First handle a simple SYMBOL_REF or LABEL_REF */
  1959.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  1960.       {
  1961.         if (reg == 0)
  1962.       abort ();
  1963.   
  1964. !       pic_ref = gen_rtx (MEM, Pmode,
  1965. !              gen_rtx (PLUS, Pmode,
  1966. !                   pic_offset_table_rtx, orig));
  1967.         current_function_uses_pic_offset_table = 1;
  1968.         RTX_UNCHANGING_P (pic_ref) = 1;
  1969.         emit_move_insn (reg, pic_ref);
  1970. --- 800,819 ----
  1971.     /* First handle a simple SYMBOL_REF or LABEL_REF */
  1972.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  1973.       {
  1974. + #ifdef LEGITIMATE_BASEREL_OPERAND_P
  1975. +       if (LEGITIMATE_BASEREL_OPERAND_P (orig))
  1976. +     return orig;
  1977. + #endif
  1978.         if (reg == 0)
  1979.       abort ();
  1980.   
  1981. !       if (flag_pic == 3)
  1982. !         pic_ref = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
  1983. !       else
  1984. !         pic_ref = gen_rtx (MEM, Pmode,
  1985. !                gen_rtx (PLUS, Pmode,
  1986. !                     pic_offset_table_rtx, orig));
  1987.         current_function_uses_pic_offset_table = 1;
  1988.         RTX_UNCHANGING_P (pic_ref) = 1;
  1989.         emit_move_insn (reg, pic_ref);
  1990. ***************
  1991. *** 1793,1798 ****
  1992. --- 1801,1809 ----
  1993.         output_address (XEXP (op, 0));
  1994.         if (letter == 'd' && ! TARGET_68020
  1995.         && CONSTANT_ADDRESS_P (XEXP (op, 0))
  1996. +       && !(TARGET_PC_REL && GET_CODE (XEXP (op, 0)) == SYMBOL_REF
  1997. +            && SYMBOL_REF_FLAG (XEXP (op, 0))
  1998. +            && !SYMBOL_REF_USED (XEXP (op, 0)))
  1999.         && !(GET_CODE (XEXP (op, 0)) == CONST_INT
  2000.              && INTVAL (XEXP (op, 0)) < 0x8000
  2001.              && INTVAL (XEXP (op, 0)) >= -0x8000))
  2002. ***************
  2003. *** 2100,2105 ****
  2004. --- 2111,2118 ----
  2005.                 fprintf (file, ":w");
  2006.               if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
  2007.                 fprintf (file, ":l");
  2008. +             if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
  2009. +               fprintf (file, ":w");
  2010.             }
  2011.           if (addr != 0 && ireg != 0)
  2012.             {
  2013. ***************
  2014. *** 2177,2182 ****
  2015. --- 2190,2207 ----
  2016.           fprintf (file, "%d:w", INTVAL (addr));
  2017.   #endif
  2018.         }
  2019. +     else if (TARGET_PC_REL && GET_CODE (addr) == SYMBOL_REF
  2020. +          && SYMBOL_REF_FLAG (addr) && !SYMBOL_REF_USED (addr))
  2021. +       {
  2022. + #ifdef MOTOROLA
  2023. +         output_addr_const (file, addr);
  2024. +         fputs ("(pc)", file);
  2025. + #else
  2026. +         fputs ("pc@(", file);
  2027. +         output_addr_const (file, addr);
  2028. +         putc (')', file);
  2029. + #endif
  2030. +       }
  2031.       else
  2032.         {
  2033.           output_addr_const (file, addr);
  2034. ***************
  2035. *** 2243,2245 ****
  2036. --- 2268,2286 ----
  2037.   
  2038.     return 0;
  2039.   }
  2040. + #ifdef ENCODE_SECTION_INFO
  2041. + /* Does operand (which is a symbolic_operand) live in text space? If
  2042. +    so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.*/
  2043. + int
  2044. + read_only_operand (operand)
  2045. +      rtx operand;
  2046. + {
  2047. +   if (GET_CODE (operand) == CONST)
  2048. +     operand = XEXP (XEXP (operand, 0), 0);
  2049. +   if (GET_CODE (operand) == SYMBOL_REF)
  2050. +     return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
  2051. +   return 1;
  2052. + }
  2053. + #endif
  2054. ===================================================================
  2055. RCS file: /net/acae127/home/bammi/etc/src/master/gnu/gcc/config/m68k/m68k.h,v
  2056. retrieving revision 1.1.1.1
  2057. diff -c -r1.1.1.1 m68k.h
  2058. *** 1.1.1.1    1993/05/18 23:53:20
  2059. --- m68k.h    1993/05/21 12:35:56
  2060. ***************
  2061. *** 92,97 ****
  2062. --- 92,103 ----
  2063.   /* Use the 68040-only fp instructions (-m68040).  */
  2064.   #define TARGET_68040_ONLY (target_flags & 01000)
  2065.   
  2066. + /* Use PC-relative addressing for refs to read-only data */
  2067. + #define TARGET_PC_REL (target_flags & 02000)
  2068. + /* Use base-relative addressing for refs to data&bss segments */
  2069. + #define TARGET_BASE_REL (target_flags & 04000)
  2070.   /* Macro to define tables used to set the flags.
  2071.      This is a list in braces of pairs in braces,
  2072.      each pair being { "NAME", VALUE }
  2073. ***************
  2074. *** 119,124 ****
  2075. --- 125,134 ----
  2076.       { "68030", -01400},                \
  2077.       { "68030", 5},                \
  2078.       { "68040", 01007},            \
  2079. +     { "pcrel", 02000},                \
  2080. +     { "nopcrel", -02000},            \
  2081. +     { "baserel", 04000},            \
  2082. +     { "nobaserel", -04000},            \
  2083.       { "", TARGET_DEFAULT}}
  2084.   /* TARGET_DEFAULT is defined in sun*.h and isi.h, etc.  */
  2085.   
  2086. ***************
  2087. *** 130,141 ****
  2088. --- 140,153 ----
  2089.     if (TARGET_FPA) target_flags &= ~2;    \
  2090.     if (! TARGET_68020 && flag_pic == 2)    \
  2091.       error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  2092. +   if (TARGET_BASE_REL) flag_pic = 3;    \
  2093.   }
  2094.   #else
  2095.   #define OVERRIDE_OPTIONS        \
  2096.   {                    \
  2097.     if (! TARGET_68020 && flag_pic == 2)    \
  2098.       error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  2099. +   if (TARGET_BASE_REL) flag_pic = 3;    \
  2100.   }
  2101.   #endif /* defined SUPPORT_SUN_FPA */
  2102.   
  2103. ***************
  2104. *** 339,344 ****
  2105. --- 351,359 ----
  2106.   {                                               \
  2107.     if (flag_pic)                                 \
  2108.       fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  2109. +   /* prevent saving/restoring of the base reg */ \
  2110. +   if (flag_pic == 3)                 \
  2111. +     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  2112.   }
  2113.   
  2114.   #else /* defined SUPPORT_SUN_FPA */
  2115. ***************
  2116. *** 363,368 ****
  2117. --- 378,386 ----
  2118.       }                         \
  2119.     if (flag_pic)                                 \
  2120.       fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  2121. +   /* prevent saving/restoring of the base reg */ \
  2122. +   if (flag_pic == 3)                 \
  2123. +     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  2124.   }
  2125.   
  2126.   #endif /* defined SUPPORT_SUN_FPA */
  2127. ***************
  2128. *** 1129,1134 ****
  2129. --- 1147,1154 ----
  2130.          && GET_CODE (XEXP (X, 1)) == CONST_INT                \
  2131.          && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000)        \
  2132.      || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  2133. +        && flag_pic == 3 && CONSTANT_ADDRESS_P (XEXP (X, 1)))        \
  2134. +    || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  2135.          && flag_pic && GET_CODE (XEXP (X, 1)) == SYMBOL_REF)        \
  2136.      || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx     \
  2137.          && flag_pic && GET_CODE (XEXP (X, 1)) == LABEL_REF))        \
  2138. ===================================================================
  2139. RCS file: /net/acae127/home/bammi/etc/src/master/gnu/gcc/config/m68k/m68k.md,v
  2140. retrieving revision 1.1.1.1
  2141. diff -c -r1.1.1.1 m68k.md
  2142. *** 1.1.1.1    1993/05/18 23:53:21
  2143. --- m68k.md    1993/05/21 12:35:59
  2144. ***************
  2145. *** 704,716 ****
  2146.   {
  2147.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  2148.       {
  2149. !       /* The source is an address which requires PIC relocation.  
  2150. !          Call legitimize_pic_address with the source, mode, and a relocation
  2151. !          register (a new pseudo, or the final destination if reload_in_progress
  2152. !          is set).   Then fall through normally */
  2153. !       extern rtx legitimize_pic_address();
  2154. !       rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  2155. !       operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  2156.       }
  2157.   }")
  2158.   
  2159. --- 704,721 ----
  2160.   {
  2161.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  2162.       {
  2163. ! #ifdef LEGITIMATE_BASEREL_OPERAND_P
  2164. !       if (flag_pic != 3 || !LEGITIMATE_BASEREL_OPERAND_P (operands[1]))
  2165. ! #endif
  2166. !       {
  2167. !         /* The source is an address which requires PIC relocation.  
  2168. !            Call legitimize_pic_address with the source, mode, and a relocation
  2169. !            register (a new pseudo, or the final destination if reload_in_progress
  2170. !            is set).   Then fall through normally */
  2171. !         extern rtx legitimize_pic_address();
  2172. !         rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  2173. !         operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  2174. !       }
  2175.       }
  2176.   }")
  2177.   
  2178. ***************
  2179. *** 4747,4753 ****
  2180.     ""
  2181.     "
  2182.   {
  2183. !   if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  2184.   #ifdef MOTOROLA
  2185.       SYMBOL_REF_FLAG (XEXP (operands[0], 0)) = 1;
  2186.   #else
  2187. --- 4752,4758 ----
  2188.     ""
  2189.     "
  2190.   {
  2191. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  2192.   #ifdef MOTOROLA
  2193.       SYMBOL_REF_FLAG (XEXP (operands[0], 0)) = 1;
  2194.   #else
  2195. ***************
  2196. *** 4762,4768 ****
  2197.        (match_operand:SI 1 "general_operand" "g"))]
  2198.     ;; Operand 1 not really used on the m68000.
  2199.   
  2200. !   "! flag_pic"
  2201.     "*
  2202.   #ifdef MOTOROLA
  2203.     return \"jsr %0\";
  2204. --- 4767,4773 ----
  2205.        (match_operand:SI 1 "general_operand" "g"))]
  2206.     ;; Operand 1 not really used on the m68000.
  2207.   
  2208. !   "(! flag_pic || flag_pic == 3)"
  2209.     "*
  2210.   #ifdef MOTOROLA
  2211.     return \"jsr %0\";
  2212. ***************
  2213. *** 4777,4783 ****
  2214.        (match_operand:SI 1 "general_operand" "g"))]
  2215.     ;; Operand 1 not really used on the m68000.
  2216.   
  2217. !   "flag_pic"
  2218.     "*
  2219.   #ifdef MOTOROLA
  2220.     if (GET_CODE (operands[0]) == MEM 
  2221. --- 4782,4788 ----
  2222.        (match_operand:SI 1 "general_operand" "g"))]
  2223.     ;; Operand 1 not really used on the m68000.
  2224.   
  2225. !   "(flag_pic && flag_pic < 3)"
  2226.     "*
  2227.   #ifdef MOTOROLA
  2228.     if (GET_CODE (operands[0]) == MEM 
  2229. ***************
  2230. *** 4798,4804 ****
  2231.     ""
  2232.     "
  2233.   {
  2234. !   if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  2235.   #ifdef MOTOROLA
  2236.       SYMBOL_REF_FLAG (XEXP (operands[1], 0)) = 1;
  2237.   #else
  2238. --- 4803,4809 ----
  2239.     ""
  2240.     "
  2241.   {
  2242. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  2243.   #ifdef MOTOROLA
  2244.       SYMBOL_REF_FLAG (XEXP (operands[1], 0)) = 1;
  2245.   #else
  2246. ***************
  2247. *** 4813,4819 ****
  2248.       (call (match_operand:QI 1 "memory_operand" "o")
  2249.             (match_operand:SI 2 "general_operand" "g")))]
  2250.     ;; Operand 2 not really used on the m68000.
  2251. !   "! flag_pic"
  2252.     "*
  2253.   #ifdef MOTOROLA
  2254.     return \"jsr %1\";
  2255. --- 4818,4824 ----
  2256.       (call (match_operand:QI 1 "memory_operand" "o")
  2257.             (match_operand:SI 2 "general_operand" "g")))]
  2258.     ;; Operand 2 not really used on the m68000.
  2259. !   "(! flag_pic || flag_pic == 3)"
  2260.     "*
  2261.   #ifdef MOTOROLA
  2262.     return \"jsr %1\";
  2263. ***************
  2264. *** 4828,4834 ****
  2265.       (call (match_operand:QI 1 "memory_operand" "o")
  2266.             (match_operand:SI 2 "general_operand" "g")))]
  2267.     ;; Operand 2 not really used on the m68000.
  2268. !   "flag_pic"
  2269.     "*
  2270.   #ifdef MOTOROLA
  2271.     if (GET_CODE (operands[1]) == MEM 
  2272. --- 4833,4839 ----
  2273.       (call (match_operand:QI 1 "memory_operand" "o")
  2274.             (match_operand:SI 2 "general_operand" "g")))]
  2275.     ;; Operand 2 not really used on the m68000.
  2276. !   "(flag_pic && flag_pic < 3)"
  2277.     "*
  2278.   #ifdef MOTOROLA
  2279.     if (GET_CODE (operands[1]) == MEM 
  2280.  
  2281.