home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 359_11 / patch5.000 / DIFFS / GCC.DIF next >
Text File  |  1991-09-11  |  27KB  |  890 lines

  1. diff +context=3 +entire-new-file ogcc-1.39/cccp.c gcc-1.39/cccp.c
  2. *** ogcc-1.39/cccp.c    Sun Mar 24 14:56:36 1991
  3. --- gcc-1.39/cccp.c    Sun Mar 24 15:10:00 1991
  4. ***************
  5. *** 847,852 ****
  6. --- 847,880 ----
  7.       if (ignore_srcdir && first_bracket_include == 0)
  8.         first_bracket_include
  9.       = (cplusplus ? cplusplus_include_defaults : include_defaults);
  10. + #ifdef GNUDOS
  11. +     { /* GNUDOS: use GCCINC environment variable to find #includes */
  12. +       char *env_inc = getenv("GCCINC");
  13. +       if (env_inc)
  14. +       {
  15. +         char *ep;
  16. +         for (ep=env_inc; *ep; ep++)
  17. +           if (*ep == '\\') *ep = '/';
  18. +         if (ep[-1] == '/') ep[-1] = 0;
  19. +         if (cplusplus)
  20. +         {
  21. +           cplusplus_include_defaults[0].fname = env_inc;
  22. +           cplusplus_include_defaults[1].fname = env_inc;
  23. +           cplusplus_include_defaults[2].fname = env_inc;
  24. +         }
  25. +         else
  26. +         {
  27. +           include_defaults[0].fname = env_inc;
  28. +           include_defaults[1].fname = env_inc;
  29. +           include_defaults[2].fname = env_inc;
  30. +         }
  31. +         if (strlen(env_inc) > max_include_len)
  32. +           max_include_len = strlen(env_inc);
  33. +       }
  34. +     }
  35. + #endif
  36.     }
  37.   
  38.     /* Initialize output buffer */
  39. Common subdirectories: ogcc-1.39/config and gcc-1.39/config
  40. diff +context=3 +entire-new-file ogcc-1.39/config-d.bat gcc-1.39/config-d.bat
  41. *** ogcc-1.39/config-d.bat
  42. --- gcc-1.39/config-d.bat    Thu Mar  7 00:12:02 1991
  43. ***************
  44. *** 0 ****
  45. --- 1,12 ----
  46. + copy config\xm-i386.h config.h
  47. + copy config\tm-i386gas.h tm.h
  48. + copy config\i386.md md
  49. + copy config\out-i386.c aux-output.c
  50. + echo #define BSD>> config.h
  51. + echo #undef ASM_OUTPUT_ALIGN_CODE>>tm.h
  52. + echo #define ASM_OUTPUT_ALIGN_CODE(FILE)\>>tm.h
  53. + echo   fprintf((FILE), "\t.align 2,144\n"); /* NOPs */>>tm.h
  54. + echo #undef ASM_OUTPUT_ALIGN>>tm.h
  55. + echo #define ASM_OUTPUT_ALIGN(FILE,LOG)\>>tm.h
  56. + echo   if (LOG) fprintf((FILE), "\t.align %%d,144\n", (LOG)); /* NOPs */>>tm.h
  57. + echo Configured for MS-DOS 386 using GAS > config.status
  58. diff +context=3 +entire-new-file ogcc-1.39/gcc.c gcc-1.39/gcc.c
  59. *** ogcc-1.39/gcc.c    Sun Mar 24 14:56:50 1991
  60. --- gcc-1.39/gcc.c    Sun Mar 24 15:10:38 1991
  61. ***************
  62. *** 124,134 ****
  63. --- 124,150 ----
  64.   #include <stdio.h>
  65.   #include <sys/types.h>
  66.   #include <signal.h>
  67. + #ifndef __TURBOC__
  68.   #include <sys/file.h>
  69. + #else
  70. + #define SIGPIPE 1234
  71. + #include <process.h>
  72. + #include <errno.h>
  73. + #define R_OK 4
  74. + #define W_OK 2
  75. + #define X_OK 1
  76. + #define bcopy(a,b,c) memcpy (b,a,c)
  77. + #define bzero(a,b) memset (a,0,b)
  78. + #define bcmp(a,b,c) memcmp (a,b,c)
  79. + #endif
  80.   
  81.   #include "config.h"
  82.   #include "obstack.h"
  83. + #ifdef __TURBOC__
  84. + #include <stdarg.h>
  85. + #else
  86.   #include "gvarargs.h"
  87. + #endif
  88.   
  89.   #ifdef USG
  90.   #ifndef R_OK
  91. ***************
  92. *** 244,250 ****
  93.   {
  94.     {".c",
  95.      "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{i*} %{trigraphs} -undef \
  96. !         -D__GNUC__ %{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!ansi:%p} %P\
  97.           %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic} %{P}\
  98.       %{Wcomment*} %{Wtrigraphs} %{Wall} %{w} %C\
  99.           %i %{!M*:%{!E:%{!pipe:%g.cpp}}}%{E:%W{o*}}%{M*:%W{o*}} |\n\
  100. --- 260,266 ----
  101.   {
  102.     {".c",
  103.      "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{i*} %{trigraphs} -undef \
  104. !         -D__GNUC__ -DGNUDOS %{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!ansi:%p} %P\
  105.           %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic} %{P}\
  106.       %{Wcomment*} %{Wtrigraphs} %{Wall} %{w} %C\
  107.           %i %{!M*:%{!E:%{!pipe:%g.cpp}}}%{E:%W{o*}}%{M*:%W{o*}} |\n\
  108. ***************
  109. *** 257,265 ****
  110.                 %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %{gg:-G %g.sym}\
  111.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\
  112.                         %{!pipe:%g.s}\n }}}"},
  113. !   {".cc",
  114.      "cpp -+ %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{i*} \
  115. !         -undef -D__GNUC__ -D__GNUG__ %p %P\
  116.           %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic} %{P}\
  117.       %{Wcomment*} %{Wtrigraphs} %{Wall} %{w} %C\
  118.           %i %{!M*:%{!E:%{!pipe:%g.cpp}}}%{E:%W{o*}}%{M*:%W{o*}} |\n\
  119. --- 273,281 ----
  120.                 %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %{gg:-G %g.sym}\
  121.                 %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\
  122.                         %{!pipe:%g.s}\n }}}"},
  123. !   {".cc", /* GNUDOS: add -D__cplusplus */
  124.      "cpp -+ %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{i*} \
  125. !         -undef -D__GNUC__ -DGNUDOS -D__GNUG__ -D__cplusplus %p %P\
  126.           %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic} %{P}\
  127.       %{Wcomment*} %{Wtrigraphs} %{Wall} %{w} %C\
  128.           %i %{!M*:%{!E:%{!pipe:%g.cpp}}}%{E:%W{o*}}%{M*:%W{o*}} |\n\
  129. ***************
  130. *** 284,290 ****
  131.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
  132.     {".S",
  133.      "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{trigraphs} \
  134. !         -undef -D__GNUC__ -$ %p %P\
  135.           %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic} %{P}\
  136.       %{Wcomment*} %{Wtrigraphs} %{Wall} %{w} %C\
  137.           %i %{!M*:%{!E:%{!pipe:%g.s}}}%{E:%W{o*}}%{M*:%W{o*}} |\n\
  138. --- 300,306 ----
  139.               %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
  140.     {".S",
  141.      "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{trigraphs} \
  142. !         -undef -D__GNUC__ -DGNUDOS -$ %p %P\
  143.           %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic} %{P}\
  144.       %{Wcomment*} %{Wtrigraphs} %{Wall} %{w} %C\
  145.           %i %{!M*:%{!E:%{!pipe:%g.s}}}%{E:%W{o*}}%{M*:%W{o*}} |\n\
  146. ***************
  147. *** 299,305 ****
  148.   char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\
  149.    %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\
  150.    %{y*} %{!A:%{!nostdlib:%S}} \
  151. !  %{L*} %o %{!nostdlib:gnulib%s %{g:-lg} %L gnulib%s %{!A:%E}}\n }}}}";
  152.   
  153.   /* Accumulate a command (program name and args), and run it.  */
  154.   
  155. --- 315,323 ----
  156.   char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\
  157.    %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\
  158.    %{y*} %{!A:%{!nostdlib:%S}} \
  159. !  %{L*} %o %{!nostdlib:%L %{!A:%E}}\n }}}}";
  160. !  /* GNUDOS: gnulib is in libc.a (above), no libg.a */
  161. ! /* %{L*} %o %{!nostdlib:gnulib%s %{g:-lg} %L gnulib%s %{!A:%E}}\n }}}}"; */
  162.   
  163.   /* Accumulate a command (program name and args), and run it.  */
  164.   
  165. ***************
  166. *** 532,540 ****
  167. --- 550,580 ----
  168.   choose_temp_base ()
  169.   {
  170.     extern char *getenv ();
  171. + #ifndef __TURBOC__
  172.     char *base = getenv ("TMPDIR");
  173.     int len;
  174. + #else
  175. +   char *base = 0;
  176. +   int len;
  177. +   char *bp;
  178.   
  179. +   /* GNUDOS: check GNUTMP and TMP/TEMP environment variables */
  180. +   if (base == (char *)0) base = getenv("GCCTMP");
  181. +   if (base == (char *)0) base = getenv("TMP");
  182. +   if (base == (char *)0) base = getenv("TEMP");
  183. +   if (base == (char *)0) base = getenv("TMPDIR");
  184. +   if (base == (char *)0) base = "./";
  185. +   for (bp=base; *bp; bp++)
  186. +     if (*bp == '\\') *bp = '/';
  187. +   if (bp[-1] != '/')
  188. +   {
  189. +     bp = (char *)malloc(strlen(base)+2);
  190. +     strcpy(bp, base);
  191. +     strcat(bp, "/");
  192. +     base = bp;
  193. +   }
  194. + #endif
  195.     if (base == (char *)0)
  196.       {
  197.   #ifdef P_tmpdir
  198. ***************
  199. *** 558,563 ****
  200. --- 598,606 ----
  201.     strcpy (temp_filename + len, "ccXXXXXX");
  202.   
  203.     mktemp (temp_filename);
  204. + #ifdef __TURBOC__ /* GNUDOS: use ccXX_XXX.??? - turbo uses ccXX.XXX */
  205. +   temp_filename[strlen(temp_filename)-4] = '_';
  206. + #endif
  207.     temp_filename_length = strlen (temp_filename);
  208.   }
  209.   
  210. ***************
  211. *** 572,577 ****
  212. --- 615,627 ----
  213.     char *temp;
  214.     int size;
  215.   
  216. + #ifdef __TURBOC__ /* GNUDOS: we need .exe on the end */
  217. +   char *ptmp = malloc(strlen(prog)+5);
  218. +   strcpy(ptmp, prog);
  219. +   strcat(ptmp, ".exe");
  220. +   prog = ptmp;
  221. + #endif
  222.     size = strlen (standard_exec_prefix);
  223.     if (user_exec_prefix != 0 && strlen (user_exec_prefix) > size)
  224.       size = strlen (user_exec_prefix);
  225. ***************
  226. *** 683,688 ****
  227. --- 733,741 ----
  228.      NOT_LAST is nonzero if this is not the last subcommand
  229.      (i.e. its output should be piped to the next one.)  */
  230.   
  231. + /* GNUDOS: set up response file, spawn process and wait for it to come
  232. +    back.  No pipe support. */
  233.   static int
  234.   pexecute (func, program, argv, not_last)
  235.        char *program;
  236. ***************
  237. *** 694,699 ****
  238. --- 747,790 ----
  239.     int pdes[2];
  240.     int input_desc = last_pipe_input;
  241.     int output_desc = STDOUT_FILE_NO;
  242. + #ifdef __TURBOC__
  243. +   int i;
  244. +   char *newargv[3];
  245. +   FILE *parm_f;
  246. +   char PARM_FILE[80];
  247. +   char APARM_FILE[80];
  248. +   char *s = alloca(strlen(program)+5);
  249. +   strcpy(s, program);
  250. +   sprintf(PARM_FILE, "%s.gp", temp_filename);
  251. +   parm_f = fopen(PARM_FILE, "w");
  252. +   if (parm_f == NULL)
  253. +   {
  254. +     pid = (*func)(P_WAIT, s, argv);
  255. +   }
  256. +   else
  257. +   {
  258. +     for (i=1; argv[i]; i++)
  259. +     {
  260. +       fputs(argv[i], parm_f);
  261. +       fputc('\n', parm_f);
  262. +     }
  263. +     fclose(parm_f);
  264. +     newargv[0] = argv[0];
  265. +     sprintf(APARM_FILE, "@%s.gp", temp_filename);
  266. +     newargv[1] = APARM_FILE;
  267. +     newargv[2] = 0;
  268. +     pid = (*func)(P_WAIT, s, newargv);
  269. +     unlink(PARM_FILE);
  270. +   }
  271. +   if (pid == -1)
  272. +     return errno;
  273. +   return pid << 8;
  274. + #else /* ifdef __TURBOC__ */
  275.   
  276.     /* If this isn't the last process, make a pipe for its output,
  277.        and record it as waiting to be the input to the next process.  */
  278. ***************
  279. *** 752,757 ****
  280. --- 843,849 ----
  281.         /* Return child's process number.  */
  282.         return pid;
  283.       }
  284. + #endif /* ifdef __TURBOC__ */
  285.   }
  286.   
  287.   /* Execute the command specified by the arguments on the current line of spec.
  288. ***************
  289. *** 845,851 ****
  290. --- 937,947 ----
  291.         extern int execv(), execvp();
  292.         char *string = commands[i].argv[0];
  293.   
  294. + #ifdef __TURBOC__
  295. +       commands[i].pid = pexecute ((string != commands[i].prog ? spawnv : spawnvp),
  296. + #else
  297.         commands[i].pid = pexecute ((string != commands[i].prog ? execv : execvp),
  298. + #endif
  299.                     string, commands[i].argv,
  300.                     i + 1 < n_commands);
  301.   
  302. ***************
  303. *** 868,876 ****
  304. --- 964,976 ----
  305.       int pid;
  306.       char *prog;
  307.   
  308. + #ifdef __TURBOC__
  309. +         pid = status = commands[0].pid;
  310. + #else
  311.       pid = wait (&status);
  312.       if (pid < 0)
  313.         abort ();
  314. + #endif
  315.   
  316.       if (status != 0)
  317.         {
  318. ***************
  319. *** 931,936 ****
  320. --- 1031,1056 ----
  321.     n_switches = 0;
  322.     n_infiles = 0;
  323.   
  324. + #ifdef __TURBOC__
  325. +   /* GNUDOS: use the GCC variable first */
  326. +   env_exec_prefix = getenv("GCCBIN");
  327. +   if (env_exec_prefix)
  328. +   {
  329. +     char *cp;
  330. +     for (cp=env_exec_prefix; *cp; cp++)
  331. +       if (*cp == '\\') *cp = '/';
  332. +     if (cp[-1] != '/')
  333. +     {
  334. +       cp = (char *)malloc(strlen(env_exec_prefix)+2);
  335. +       strcpy(cp, env_exec_prefix);
  336. +       strcat(cp, "/");
  337. +       env_exec_prefix = cp;
  338. +     }
  339. +   }
  340. +   if (env_exec_prefix == 0)
  341. + #endif
  342.     env_exec_prefix = getenv ("GCC_EXEC_PREFIX");
  343.   
  344.     /* Scan argv twice.  Here, the first time, just count how many switches
  345. ***************
  346. *** 940,946 ****
  347.     for (i = 1; i < argc; i++)
  348.       {
  349.         if (argv[i][0] == '-' && argv[i][1] != 'l')
  350. !     {
  351.         register char *p = &argv[i][1];
  352.         register int c = *p;
  353.   
  354. --- 1060,1066 ----
  355.     for (i = 1; i < argc; i++)
  356.       {
  357.         if (argv[i][0] == '-' && argv[i][1] != 'l')
  358. !       {
  359.         register char *p = &argv[i][1];
  360.         register int c = *p;
  361.   
  362. ***************
  363. *** 1682,1688 ****
  364. --- 1802,1810 ----
  365.     delete_temp_files ();
  366.     /* Get the same signal again, this time not handled,
  367.        so its normal effect occurs.  */
  368. + #ifndef __TURBOC__
  369.     kill (getpid (), signum);
  370. + #endif
  371.   }
  372.   
  373.   int
  374. ***************
  375. *** 1696,1703 ****
  376. --- 1818,1852 ----
  377.     int linker_was_run = 0;
  378.     char *explicit_link_files;
  379.   
  380. + #ifdef __TURBOC__
  381. +   /* GNUDOS: use GCCLIB variable, handle response files */
  382. +   char *env_lib_path;
  383. +   new_argc_argv(&argc, &argv);
  384. + #endif
  385.     programname = argv[0];
  386.   
  387. + #ifdef __TURBOC__
  388. +   /* GNUDOS: use GCCLIB variable to locate crt0.o */
  389. +   env_lib_path = getenv("GCCLIB");
  390. +   if (env_lib_path)
  391. +   {
  392. +     char *cp;
  393. +     for (cp=env_lib_path; *cp; cp++)
  394. +       if (*cp == '\\') *cp = '/';
  395. +     if (cp[-1] != '/')
  396. +     {
  397. +       standard_startfile_prefix = (char *)malloc(strlen(env_lib_path)+2);
  398. +       strcpy(standard_startfile_prefix, env_lib_path);
  399. +       strcat(standard_startfile_prefix, "/");
  400. +     }
  401. +     standard_startfile_prefix_1 =
  402. +     standard_startfile_prefix_2 = standard_startfile_prefix;
  403. +   }
  404. + #endif
  405. + #ifndef __TURBOC__
  406.     if (signal (SIGINT, SIG_IGN) != SIG_IGN)
  407.       signal (SIGINT, fatal_error);
  408.     if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
  409. ***************
  410. *** 1706,1711 ****
  411. --- 1855,1861 ----
  412.       signal (SIGTERM, fatal_error);
  413.     if (signal (SIGPIPE, SIG_IGN) != SIG_IGN)
  414.       signal (SIGPIPE, fatal_error);
  415. + #endif
  416.   
  417.     argbuf_length = 10;
  418.     argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
  419. diff +context=3 +entire-new-file ogcc-1.39/global-a.c gcc-1.39/global-a.c
  420. *** ogcc-1.39/global-a.c    Sun Mar 24 14:56:54 1991
  421. --- gcc-1.39/global-a.c    Thu Mar  7 00:12:04 1991
  422. ***************
  423. *** 322,327 ****
  424. --- 322,328 ----
  425.        the value of floor_log2 times the maximum number of
  426.        times a register can occur in one insn (surely less than 100).
  427.        Multiplying this by 10000 can't overflow.  */
  428. + #ifndef GNUDOS
  429.     register int pri1
  430.       = (((double) (floor_log2 (reg_n_refs[r1]) * reg_n_refs[r1])
  431.       / (reg_live_length[r1] * allocno_size[*v1]))
  432. ***************
  433. *** 330,335 ****
  434. --- 331,345 ----
  435.       = (((double) (floor_log2 (reg_n_refs[r2]) * reg_n_refs[r2])
  436.       / (reg_live_length[r2] * allocno_size[*v2]))
  437.          * 10000);
  438. + #else
  439. +   register int pri1
  440. +     = (((floor_log2 (reg_n_refs[r1]) * reg_n_refs[r1] * 10000)
  441. +     / (reg_live_length[r1] * allocno_size[*v1])));
  442. +   register int pri2
  443. +     = (((floor_log2 (reg_n_refs[r2]) * reg_n_refs[r2] * 10000)
  444. +     / (reg_live_length[r2] * allocno_size[*v2])));
  445. + #endif
  446.     if (pri2 - pri1)
  447.       return pri2 - pri1;
  448.   
  449. diff +context=3 +entire-new-file ogcc-1.39/makeall.bat gcc-1.39/makeall.bat
  450. *** ogcc-1.39/makeall.bat
  451. --- gcc-1.39/makeall.bat    Thu Mar  7 00:12:04 1991
  452. ***************
  453. *** 0 ****
  454. --- 1,54 ----
  455. + @echo off
  456. + if exist make.com del make.com
  457. + if not exist genconfig make genconfig
  458. + if exist insn-config.h goto L1
  459. + go32 genconfig md > insn-config.h
  460. + touch stamp-config
  461. + :L1
  462. + if not exist genflags make genflags
  463. + if exist insn-flags.h goto L2
  464. + go32 genflags md > insn-flags.h
  465. + touch stamp-flags
  466. + :L2
  467. + if not exist gencodes make gencodes
  468. + if exist insn-codes.h goto L3
  469. + go32 gencodes md > insn-codes.h
  470. + touch stamp-codes
  471. + :L3
  472. + if not exist genemit make genemit
  473. + if exist insn-emit.c goto L4
  474. + go32 genemit md > insn-emit.c
  475. + touch stamp-emit
  476. + :L4
  477. + if not exist genrecog make genrecog
  478. + if exist insn-recog.c goto L5
  479. + go32 genrecog md > insn-recog.c
  480. + touch stamp-recog
  481. + :L5
  482. + if not exist genextract make genextract
  483. + if exist insn-extract.c goto L6
  484. + go32 genextract md > insn-extract.c
  485. + touch stamp-extract
  486. + :L6
  487. + if not exist genpeep make genpeep
  488. + if exist insn-peep.c goto L7
  489. + go32 genpeep md > insn-peep.c
  490. + touch stamp-peep
  491. + :L7
  492. + if not exist genoutput make genoutput
  493. + if exist insn-output.c goto L8
  494. + go32 genoutput md > insn-output.c
  495. + touch stamp-output
  496. + :L8
  497. + make cccp
  498. + if not errorlevel 1 make cc1
  499. + if not errorlevel 1 make gcc.exe
  500. diff +context=3 +entire-new-file ogcc-1.39/makefile gcc-1.39/makefile
  501. *** ogcc-1.39/makefile    Sun Mar 24 14:57:00 1991
  502. --- gcc-1.39/makefile    Sun Mar 24 15:01:20 1991
  503. ***************
  504. *** 21,28 ****
  505.   # Variables that exist for you to override.
  506.   # See below for how to change them for certain systems.
  507.   
  508. ! CFLAGS = -g $(XCFLAGS)
  509. ! CC = cc
  510.   BISON = bison
  511.   BISONFLAGS = -v
  512.   # This should be the version of ar to use with output from GCC.
  513. --- 21,29 ----
  514.   # Variables that exist for you to override.
  515.   # See below for how to change them for certain systems.
  516.   
  517. ! # GNUDOS: don't bother with -g
  518. ! CFLAGS = -O $(XCFLAGS) -DGNUDOS
  519. ! CC = gcc
  520.   BISON = bison
  521.   BISONFLAGS = -v
  522.   # This should be the version of ar to use with output from GCC.
  523. ***************
  524. *** 67,73 ****
  525.   
  526.   # Change this to a null string if obstacks are installed in the
  527.   # system library.
  528. ! OBSTACK=obstack.o
  529.   
  530.   # Directory to link to, when using the target `maketest'.
  531.   DIR = ../gcc
  532. --- 68,74 ----
  533.   
  534.   # Change this to a null string if obstacks are installed in the
  535.   # system library.
  536. ! # OBSTACK=obstack.o
  537.   
  538.   # Directory to link to, when using the target `maketest'.
  539.   DIR = ../gcc
  540. ***************
  541. *** 178,184 ****
  542.       $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
  543.   
  544.   # Language-specific object files for C.
  545. ! C_OBJS = c-parse.tab.o c-decl.o c-typeck.o c-convert.o
  546.   
  547.   # Language-specific object files for C++.
  548.   # (These are not yet released.)
  549. --- 179,186 ----
  550.       $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
  551.   
  552.   # Language-specific object files for C.
  553. ! # GNUDOS: use c-parse_tab.c
  554. ! C_OBJS = c-parse_tab.o c-decl.o c-typeck.o c-convert.o
  555.   
  556.   # Language-specific object files for C++.
  557.   # (These are not yet released.)
  558. ***************
  559. *** 256,268 ****
  560.   
  561.   compilations: ${OBJS}
  562.   
  563.   gcc: gcc.o version.o $(LIBDEPS)
  564.       $(CC) $(CFLAGS) $(LDFLAGS) -o gccnew gcc.o version.o $(LIBS)
  565.   # Go via `gccnew' to avoid `file busy' if $(CC) is `gcc'.
  566.       mv gccnew gcc
  567.   
  568.   cc1: $(C_OBJS) $(OBJS) $(LIBDEPS)
  569. !     $(CC) $(CFLAGS) $(LDFLAGS) -o cc1 $(C_OBJS) $(OBJS) $(LIBS)
  570.   
  571.   cc1plus: $(CPLUS_OBJS) $(OBJS) $(LIBDEPS)
  572.       $(CC) $(CFLAGS) $(LDFLAGS) -o cc1plus $(CPLUS_OBJS) $(OBJS) $(LIBS)
  573. --- 258,280 ----
  574.   
  575.   compilations: ${OBJS}
  576.   
  577. + # GNUDOS: use Turbo-C to compile gcc itself
  578. + .c.obj:
  579. +     tcc $(CFLAGS) $(INCLUDES) -c $<
  580. + gcc.exe: gcc.obj version.obj obstack.obj alloca.obj newargcv.obj
  581. +     tcc $(CFLAGS) $(LDFLAGS) gcc.obj version.obj obstack.obj alloca.obj newargcv.obj
  582.   gcc: gcc.o version.o $(LIBDEPS)
  583.       $(CC) $(CFLAGS) $(LDFLAGS) -o gccnew gcc.o version.o $(LIBS)
  584.   # Go via `gccnew' to avoid `file busy' if $(CC) is `gcc'.
  585.       mv gccnew gcc
  586.   
  587. + # GNUDOS: use response file
  588.   cc1: $(C_OBJS) $(OBJS) $(LIBDEPS)
  589. !     >cc1.rf $(C_OBJS) $(OBJS) $(LIBS)
  590. !     $(CC) $(CFLAGS) $(LDFLAGS) -o cc1 @cc1.rf
  591.   
  592.   cc1plus: $(CPLUS_OBJS) $(OBJS) $(LIBDEPS)
  593.       $(CC) $(CFLAGS) $(LDFLAGS) -o cc1plus $(CPLUS_OBJS) $(OBJS) $(LIBS)
  594. ***************
  595. *** 333,342 ****
  596.   
  597.   # C language specific files.
  598.   
  599. ! c-parse.tab.o : $(srcdir)/c-parse.tab.c $(CONFIG_H) $(TREE_H) c-parse.h c-tree.h input.h
  600. !     $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.tab.c
  601. ! $(srcdir)/c-parse.tab.c : $(srcdir)/c-parse.y
  602. !     $(BISON) $(BISONFLAGS) $(srcdir)/c-parse.y -o $@
  603.   
  604.   c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-parse.h flags.h
  605.   c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
  606. --- 345,355 ----
  607.   
  608.   # C language specific files.
  609.   
  610. ! # GNUDOS: use c-parse_tab.c, simplify
  611. ! c-parse_tab.o : c-parse_tab.c $(CONFIG_H) $(TREE_H) c-parse.h c-tree.h input.h
  612. !     $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c c-parse_tab.c
  613. ! c-parse_tab.c : c-parse.y
  614. !     $(BISON) $(BISONFLAGS) c-parse.y -o $@
  615.   
  616.   c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-parse.h flags.h
  617.   c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
  618. ***************
  619. *** 450,468 ****
  620.   
  621.   # Each of the other insn-* files is handled by a similar pair of rules.
  622.   
  623. ! insn-config.h: stamp-config ;
  624.   stamp-config : md genconfig $(srcdir)/move-if-change
  625.       ./genconfig md > tmp-config.h
  626.       $(srcdir)/move-if-change tmp-config.h insn-config.h
  627.       touch stamp-config
  628.   
  629. ! insn-flags.h: stamp-flags ;
  630.   stamp-flags : md genflags $(srcdir)/move-if-change
  631.       ./genflags md > tmp-flags.h
  632.       $(srcdir)/move-if-change tmp-flags.h insn-flags.h
  633.       touch stamp-flags
  634.   
  635. ! insn-codes.h: stamp-codes ;
  636.   stamp-codes : md gencodes $(srcdir)/move-if-change
  637.       ./gencodes md > tmp-codes.h
  638.       $(srcdir)/move-if-change tmp-codes.h insn-codes.h
  639. --- 463,482 ----
  640.   
  641.   # Each of the other insn-* files is handled by a similar pair of rules.
  642.   
  643. ! # GNUDOS: remove the ';' on each dependency
  644. ! insn-config.h: stamp-config
  645.   stamp-config : md genconfig $(srcdir)/move-if-change
  646.       ./genconfig md > tmp-config.h
  647.       $(srcdir)/move-if-change tmp-config.h insn-config.h
  648.       touch stamp-config
  649.   
  650. ! insn-flags.h: stamp-flags
  651.   stamp-flags : md genflags $(srcdir)/move-if-change
  652.       ./genflags md > tmp-flags.h
  653.       $(srcdir)/move-if-change tmp-flags.h insn-flags.h
  654.       touch stamp-flags
  655.   
  656. ! insn-codes.h: stamp-codes
  657.   stamp-codes : md gencodes $(srcdir)/move-if-change
  658.       ./gencodes md > tmp-codes.h
  659.       $(srcdir)/move-if-change tmp-codes.h insn-codes.h
  660. ***************
  661. *** 472,478 ****
  662.     insn-config.h insn-flags.h
  663.       $(CC) $(CFLAGS) $(INCLUDES) -c insn-emit.c
  664.   
  665. ! insn-emit.c: stamp-emit ;
  666.   stamp-emit : md genemit $(srcdir)/move-if-change
  667.       ./genemit md > tmp-emit.c
  668.       $(srcdir)/move-if-change tmp-emit.c insn-emit.c
  669. --- 486,492 ----
  670.     insn-config.h insn-flags.h
  671.       $(CC) $(CFLAGS) $(INCLUDES) -c insn-emit.c
  672.   
  673. ! insn-emit.c: stamp-emit
  674.   stamp-emit : md genemit $(srcdir)/move-if-change
  675.       ./genemit md > tmp-emit.c
  676.       $(srcdir)/move-if-change tmp-emit.c insn-emit.c
  677. ***************
  678. *** 481,487 ****
  679.   insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h real.h recog.h
  680.       $(CC) $(CFLAGS) $(INCLUDES) -c insn-recog.c
  681.   
  682. ! insn-recog.c: stamp-recog ;
  683.   stamp-recog : md genrecog $(srcdir)/move-if-change
  684.       ./genrecog md > tmp-recog.c
  685.       $(srcdir)/move-if-change tmp-recog.c insn-recog.c
  686. --- 495,501 ----
  687.   insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h real.h recog.h
  688.       $(CC) $(CFLAGS) $(INCLUDES) -c insn-recog.c
  689.   
  690. ! insn-recog.c: stamp-recog
  691.   stamp-recog : md genrecog $(srcdir)/move-if-change
  692.       ./genrecog md > tmp-recog.c
  693.       $(srcdir)/move-if-change tmp-recog.c insn-recog.c
  694. ***************
  695. *** 490,496 ****
  696.   insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H)
  697.       $(CC) $(CFLAGS) $(INCLUDES) -c insn-extract.c
  698.   
  699. ! insn-extract.c: stamp-extract ;
  700.   stamp-extract : md genextract $(srcdir)/move-if-change
  701.       ./genextract md > tmp-extract.c
  702.       $(srcdir)/move-if-change tmp-extract.c insn-extract.c
  703. --- 504,510 ----
  704.   insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H)
  705.       $(CC) $(CFLAGS) $(INCLUDES) -c insn-extract.c
  706.   
  707. ! insn-extract.c: stamp-extract
  708.   stamp-extract : md genextract $(srcdir)/move-if-change
  709.       ./genextract md > tmp-extract.c
  710.       $(srcdir)/move-if-change tmp-extract.c insn-extract.c
  711. ***************
  712. *** 499,505 ****
  713.   insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h real.h
  714.       $(CC) $(CFLAGS) $(INCLUDES) -c insn-peep.c
  715.   
  716. ! insn-peep.c: stamp-peep ;
  717.   stamp-peep : md genpeep $(srcdir)/move-if-change
  718.       ./genpeep md > tmp-peep.c
  719.       $(srcdir)/move-if-change tmp-peep.c insn-peep.c
  720. --- 513,519 ----
  721.   insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h real.h
  722.       $(CC) $(CFLAGS) $(INCLUDES) -c insn-peep.c
  723.   
  724. ! insn-peep.c: stamp-peep
  725.   stamp-peep : md genpeep $(srcdir)/move-if-change
  726.       ./genpeep md > tmp-peep.c
  727.       $(srcdir)/move-if-change tmp-peep.c insn-peep.c
  728. ***************
  729. *** 509,515 ****
  730.       hard-reg-set.h insn-config.h insn-flags.h output.h aux-output.c
  731.       $(CC) $(CFLAGS) $(INCLUDES) -c insn-output.c
  732.   
  733. ! insn-output.c: stamp-output ;
  734.   stamp-output : md genoutput $(srcdir)/move-if-change
  735.       ./genoutput md > tmp-output.c
  736.       $(srcdir)/move-if-change tmp-output.c insn-output.c
  737. --- 523,529 ----
  738.       hard-reg-set.h insn-config.h insn-flags.h output.h aux-output.c
  739.       $(CC) $(CFLAGS) $(INCLUDES) -c insn-output.c
  740.   
  741. ! insn-output.c: stamp-output
  742.   stamp-output : md genoutput $(srcdir)/move-if-change
  743.       ./genoutput md > tmp-output.c
  744.       $(srcdir)/move-if-change tmp-output.c insn-output.c
  745. ***************
  746. *** 571,581 ****
  747.       $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
  748.   $(srcdir)/cexp.c: $(srcdir)/cexp.y
  749.       $(BISON) -o $(srcdir)/cexp.c $(srcdir)/cexp.y
  750.   cccp.o: cccp.c $(CONFIG_H)
  751. !     $(CC) $(CFLAGS) $(INCLUDES) \
  752. !           -DGCC_INCLUDE_DIR=\"$(libdir)/gcc-include\" \
  753. !           -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
  754. !       -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
  755.   
  756.   $(srcdir)/cpp.info: $(srcdir)/cpp.texinfo
  757.       makeinfo `echo $(srcdir)/cpp.texinfo | sed 's,^\./,,'`
  758. --- 585,601 ----
  759.       $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
  760.   $(srcdir)/cexp.c: $(srcdir)/cexp.y
  761.       $(BISON) -o $(srcdir)/cexp.c $(srcdir)/cexp.y
  762. + # GNUDOS: simplify, use response file
  763.   cccp.o: cccp.c $(CONFIG_H)
  764. !     >cccp.rf -DGCC_INCLUDE_DIR="$(libdir)/gcc-include" -DGPLUSPLUS_INCLUDE_DIR="$(libdir)/g++-include"
  765. !     $(CC) $(CFLAGS) $(INCLUDES) -c cccp.c @cccp.rf
  766. ! #    $(CC) $(CFLAGS) $(INCLUDES) \
  767. ! #          -DGCC_INCLUDE_DIR=\"$(libdir)/gcc-include\" \
  768. ! #          -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
  769. ! #      -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
  770.   
  771.   $(srcdir)/cpp.info: $(srcdir)/cpp.texinfo
  772.       makeinfo `echo $(srcdir)/cpp.texinfo | sed 's,^\./,,'`
  773. diff +context=3 +entire-new-file ogcc-1.39/newargcv.c gcc-1.39/newargcv.c
  774. *** ogcc-1.39/newargcv.c
  775. --- gcc-1.39/newargcv.c    Thu Mar  7 00:12:04 1991
  776. ***************
  777. *** 0 ****
  778. --- 1,80 ----
  779. + /* History:23,5 */
  780. + #include <stdio.h>
  781. + #include <alloc.h>
  782. + #ifdef TEST_NEWARG
  783. + main(int argc, char **argv)
  784. + {
  785. +   int i;
  786. +   new_argc_argv(&argc, &argv);
  787. +   printf("argc = %d\n", argc);
  788. +   for (i=0; argv[i]; i++)
  789. +     printf("argv[%d] = %s\n", i, argv[i]);
  790. + }
  791. + #endif
  792. + struct ARG {
  793. +   struct ARG *next;
  794. +   char *this;
  795. +   } ARG;
  796. + new_argc_argv(int *argc, char ***argv)
  797. + {
  798. +   struct ARG *root = 0, *last;
  799. +   struct ARG *arg;
  800. +   char buf[1024];
  801. +   int i;
  802. +   FILE *f;
  803. +   for (i=0; (*argv)[i]; i++)
  804. +   {
  805. +     if ((*argv)[i][0] == '@')
  806. +     {
  807. +       f = fopen((*argv)[i]+1, "r");
  808. +       if (f == NULL)
  809. +         goto regular_arg;
  810. +       while (fscanf(f, "%s", buf) == 1)
  811. +       {
  812. +         arg = (struct ARG *)malloc(sizeof(struct ARG));
  813. +         arg->next = 0;
  814. +         arg->this = (char *)malloc(strlen(buf)+1);
  815. +         strcpy(arg->this, buf);
  816. +         if (!root)
  817. +           root = last = arg;
  818. +         else
  819. +         {
  820. +           last->next = arg;
  821. +           last = arg;
  822. +         }
  823. +       }
  824. +       fclose(f);
  825. +     }
  826. +     else
  827. +     {
  828. + regular_arg:
  829. +       arg = (struct ARG *)malloc(sizeof(struct ARG));
  830. +       arg->next = 0;
  831. +       arg->this = (*argv)[i];
  832. +       if (!root)
  833. +         root = last = arg;
  834. +       else
  835. +       {
  836. +         last->next = arg;
  837. +         last = arg;
  838. +       }
  839. +     }
  840. +   }
  841. +   for (*argc = 1, arg = root; arg; arg = arg->next)
  842. +     (*argc)++;
  843. +   *argv = (char **)malloc(*argc * sizeof(char *));
  844. +   for ((*argc) = 0, arg = root; arg; arg = arg->next)
  845. +     (*argv)[(*argc)++] = arg->this;
  846. +   while (root)
  847. +   {
  848. +     arg = root->next;
  849. +     free(root);
  850. +     root = arg;
  851. +   }
  852. +   (*argv)[*argc] = 0;
  853. + }
  854.