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