bammi@dsrgsun.ces.cwru.edu (Jwahar R. Bammi) (11/28/88)
#!/bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #!/bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # gcc-1.31-diff # This archive created: Thu Oct 27 21:49:58 1988 # By: Jwahar R. Bammi(Case Western Reserve University) # Uucp: {decvax,sun,att}!cwjcc!dsrgsun!bammi # Csnet: bammi@dsrgsun.ces.CWRU.edu # Arpa: bammi@dsrgsun.ces.CWRU.edu # export PATH; PATH=/bin:$PATH echo shar: extracting "'gcc-1.31-diff'" '(28120 characters)' if test -f 'gcc-1.31-diff' then echo shar: over-writing existing file "'gcc-1.31-diff'" fi sed 's/^X//' << \SHAR_EOF > 'gcc-1.31-diff' X*** ../../gcc-1.31/cccp.c Tue Nov 22 16:29:00 1988 X--- cccp.c Wed Nov 23 07:25:20 1988 X*************** X*** 106,111 **** X--- 106,113 ---- X X typedef unsigned char U_CHAR; X X+ #ifndef atarist X+ X #ifdef EMACS X #define NO_SHORTNAMES X #include "../src/config.h" X*************** X*** 132,148 **** X X #ifndef VMS X #include <sys/file.h> X! #ifndef USG X #include <sys/time.h> /* for __DATE__ and __TIME__ */ X #include <sys/resource.h> X #else X #define index strchr X #define rindex strrchr X #include <time.h> X #include <fcntl.h> X! #endif /* USG */ X #endif /* not VMS */ X X /* VMS-specific definitions */ X #ifdef VMS X #include <time.h> X--- 134,169 ---- X X #ifndef VMS X #include <sys/file.h> X! #if (!(defined(USG) || defined(atariminix))) X #include <sys/time.h> /* for __DATE__ and __TIME__ */ X #include <sys/resource.h> X #else X+ #ifndef atariminix X #define index strchr X #define rindex strrchr X+ #endif X #include <time.h> X #include <fcntl.h> X! #endif /* USG or atariminix */ X #endif /* not VMS */ X X+ #else /* atarist */ X+ X+ #include <ctype.h> X+ #include <stdio.h> X+ #include <types.h> X+ #include <stat.h> X+ #include <file.h> X+ #include "stddef.h" X+ X+ #define index strchr X+ #define rindex strrchr X+ X+ extern long _stksize = 524288; /* want big stack cause include files X+ get alloca'ed there */ X+ X+ #endif /* atarist */ X+ X /* VMS-specific definitions */ X #ifdef VMS X #include <time.h> X*************** X*** 311,329 **** X /* #include "file" looks in source file dir, then stack. */ X /* #include <file> just looks in the stack. */ X /* -I directories are added to the end, then the defaults are added. */ X struct directory_stack include_defaults[] = X { X #ifndef VMS X! { &include_defaults[1], GCC_INCLUDE_DIR }, X { 0, "/usr/include" } X #else X { &include_defaults[1], "GNU_CC_INCLUDE:" }, /* GNU includes */ X { &include_defaults[2], "SYS$SYSROOT:[SYSLIB.]" }, /* VAX-11 "C" includes */ X { 0, "" }, /* This makes normal VMS filespecs work OK */ X #endif /* VMS */ X }; X X /* These are used instead of the above, for C++. */ X struct directory_stack cplusplus_include_defaults[] = X { X #ifndef VMS X--- 332,388 ---- X /* #include "file" looks in source file dir, then stack. */ X /* #include <file> just looks in the stack. */ X /* -I directories are added to the end, then the defaults are added. */ X+ #ifdef atarist X+ X+ struct directory_stack include_canned_defaults[] = X+ { X+ { &include_canned_defaults[1], "\\gnu\\lib" }, X+ { 0, "\\gnu\\include" } X+ }; X+ X+ struct directory_stack * include_defaults = &include_canned_defaults[0]; X+ X+ #else X+ X struct directory_stack include_defaults[] = X { X #ifndef VMS X! #ifdef CROSSATARI X! { 0, CROSSINC } X! #else X! #ifdef atariminix X! { 0, "/usr/local/gcc-include" } X! #else X { 0, "/usr/include" } X+ #endif X+ #endif X #else X { &include_defaults[1], "GNU_CC_INCLUDE:" }, /* GNU includes */ X { &include_defaults[2], "SYS$SYSROOT:[SYSLIB.]" }, /* VAX-11 "C" includes */ X { 0, "" }, /* This makes normal VMS filespecs work OK */ X #endif /* VMS */ X }; X+ #endif /* atarist */ X X /* These are used instead of the above, for C++. */ X+ #ifdef atarist X+ X+ struct directory_stack include_canned_cplusplus_defaults[] = X+ { X+ { &include_canned_defaults[1], "\\gnu\\lib" }, X+ { 0, "\\gnu\\include" } X+ }; X+ X+ struct directory_stack * cplusplus_include_defaults = X+ &include_canned_cplusplus_defaults[0]; X+ X+ #else X+ X+ #ifdef atariminix X+ #define GPLUSPLUS_INCLUDE_DIR "/usr/local/g++-include" X+ #define GCC_INCLUDE_DIR "/usr/local/gcc-include" X+ #endif X+ X struct directory_stack cplusplus_include_defaults[] = X { X #ifndef VMS X*************** X*** 333,339 **** X--- 392,402 ---- X { &cplusplus_include_defaults[2], "/usr/include/CC" }, X /* Use GNU CC specific header files. */ X { &cplusplus_include_defaults[3], GCC_INCLUDE_DIR }, X+ #ifdef CROSSATARI X+ { 0, CROSSINC } X+ #else X { 0, "/usr/include" } X+ #endif X #else X { &cplusplus_include_defaults[1], "GNU_CC_INCLUDE:" }, X /* VAX-11 C includes */ X*************** X*** 341,346 **** X--- 404,410 ---- X { 0, "" }, /* This makes normal VMS filespecs work OK */ X #endif /* VMS */ X }; X+ #endif /* atarist */ X X struct directory_stack *include = 0; /* First dir to search */ X /* First dir to search for <file> */ X*************** X*** 565,570 **** X--- 629,687 ---- X /* Nonzero means -I- has been seen, X so don't look for #include "foo" the source-file directory. */ X int ignore_srcdir; X+ X+ #ifdef atarist X+ /* a little frobule to filter incoming file data */ X+ int eunuchs_read(f, buf, size) X+ int f; X+ char * buf; X+ int size; X+ { X+ char local_buf[1024]; X+ register int result_size; X+ register char * local_bufp, * target_bufp; X+ register int buf_size, size_read; X+ X+ for (result_size = 0, target_bufp = buf ; size > 0 ; size -= 1024) X+ /* do a buffer */ X+ { X+ if (size > 1024) X+ buf_size = 1024; X+ else X+ buf_size = size; X+ size_read = read(f, &local_buf, buf_size); X+ for (local_bufp = (char * ) &local_buf; size_read > 0 ; size_read--) X+ if (*local_bufp == '\r') X+ local_bufp++; X+ else X+ { X+ *target_bufp++ = *local_bufp++; X+ result_size++; X+ } X+ } X+ return(result_size); X+ } X+ X+ /* the following dingus is used in place of some calls to bcopy, X+ to ensure that backslashes get properly slashified when getting X+ shoved into strings. Note that it returns the new pointer!! X+ There ought to be a better way... */ X+ X+ U_CHAR * slashifying_bcopy(from_buf, to_buf, nbytes) X+ U_CHAR * from_buf, * to_buf; X+ int nbytes; X+ { X+ for ( ; nbytes > 0 ; ) X+ { X+ if(*from_buf == '\\') X+ *to_buf++ = '\\'; X+ *to_buf++ = *from_buf++; X+ nbytes--; X+ } X+ return(to_buf); X+ } X+ X+ #endif /* atarist */ X X int X main (argc, argv) X*************** X*** 614,627 **** X--- 731,767 ---- X #endif X X max_include_len X+ #ifdef atarist X+ = sizeof ("/usr/include/CC"); X+ #else X = max (max (sizeof (GCC_INCLUDE_DIR), X sizeof (GPLUSPLUS_INCLUDE_DIR)), X sizeof ("/usr/include/CC")); X+ #endif X X bzero (pend_files, argc * sizeof (char *)); X bzero (pend_defs, argc * sizeof (char *)); X bzero (pend_undefs, argc * sizeof (char *)); X X+ #ifdef atarist X+ /* see if we have an indication of where the GNU library directory is */ X+ { X+ char * gnulib = (char * ) getenv("GNULIB"); X+ struct directory_stack * gnulib_dir; X+ X+ if (gnulib) X+ { X+ gnulib_dir = (struct directory_stack * ) X+ xmalloc(sizeof(struct directory_stack)); X+ gnulib_dir->fname = xmalloc(strlen(gnulib) + 1); X+ strcpy(gnulib_dir->fname, gnulib); X+ /* cons it onto the front of the defaults. */ X+ gnulib_dir->next = include_defaults; X+ include_defaults = gnulib_dir; X+ } X+ } X+ #endif X+ X /* Process switches and find input file name. */ X X for (i = 1; i < argc; i++) { X*************** X*** 904,910 **** X--- 1044,1054 ---- X } X } X X+ #ifdef atarist X+ file_size_and_mode (in_fname, &st_mode, &st_size); X+ #else X file_size_and_mode (f, &st_mode, &st_size); X+ #endif X fp->fname = in_fname; X fp->lineno = 1; X /* JF all this is mine about reading pipes and ttys */ X*************** X*** 922,928 **** X--- 1066,1076 ---- X fp->buf = (U_CHAR *) xmalloc (bsize + 2); X bufp = fp->buf; X for (;;) { X+ #ifdef atarist X+ cnt = eunuchs_read (f, bufp, bsize - size); X+ #else X cnt = read (f, bufp, bsize - size); X+ #endif X if (cnt < 0) goto perror; /* error! */ X if (cnt == 0) break; /* End of file */ X size += cnt; X*************** X*** 942,948 **** X--- 1090,1100 ---- X fp->buf = (U_CHAR *) xmalloc (st_size + 2); X X while (st_size > 0) { X+ #ifdef atarist X+ i = eunuchs_read (f, fp->buf + fp->length, st_size); X+ #else X i = read (f, fp->buf + fp->length, st_size); X+ #endif X if (i <= 0) { X if (i == 0) break; X goto perror; X*************** X*** 992,997 **** X--- 1144,1152 ---- X if (ferror (stdout)) X fatal ("I/O error on output"); X X+ #ifdef atarist X+ close(fileno(stdout)); /* this shouldn't be necessary */ X+ #endif X if (errors) X exit (FATAL_EXIT_CODE); X exit (SUCCESS_EXIT_CODE); X*************** X*** 2226,2231 **** X--- 2381,2387 ---- X X case T_DATE: X case T_TIME: X+ #ifndef atarist /* someday figure out how to do this */ X if (timebuf == NULL) { X i = time (0); X timebuf = localtime (&i); X*************** X*** 2237,2242 **** X--- 2393,2401 ---- X else X sprintf (buf, "\"%02d:%02d:%02d\"", timebuf->tm_hour, timebuf->tm_min, X timebuf->tm_sec); X+ #else X+ sprintf(buf, "<today>"); X+ #endif X break; X X case T_SPEC_DEFINED: X*************** X*** 2342,2347 **** X--- 2501,2509 ---- X and put it in front of the search list. */ X dsp[0].next = stackp; X stackp = dsp; X+ #ifdef atarist X+ ep = rindex (nam, '\\'); X+ #else X #ifndef VMS X ep = rindex (nam, '/'); X #else /* VMS */ X*************** X*** 2350,2355 **** X--- 2512,2518 ---- X if (ep == NULL) ep = rindex (nam, ':'); X if (ep != NULL) ep++; X #endif /* VMS */ X+ #endif /* atarist */ X if (ep != NULL) { X n = ep - nam; X dsp[0].fname = (char *) alloca (n + 1); X*************** X*** 2400,2406 **** X--- 2563,2573 ---- X X /* If specified file name is absolute, just open it. */ X X+ #ifdef atarist X+ if (*fbeg == '\\') { X+ #else X if (*fbeg == '/') { X+ #endif X strncpy (fname, fbeg, flen); X fname[flen] = 0; X f = open (fname, O_RDONLY, 0666); X*************** X*** 2411,2417 **** X--- 2578,2588 ---- X for (; stackp; stackp = stackp->next) { X if (stackp->fname) { X strcpy (fname, stackp->fname); X+ #ifdef atarist X+ strcat (fname, "\\"); X+ #else X strcat (fname, "/"); X+ #endif X fname[strlen (fname) + flen] = 0; X } else { X fname[0] = 0; X*************** X*** 2463,2469 **** X--- 2634,2644 ---- X FILE_BUF *fp; /* For input stack frame */ X int success = 0; X X+ #ifdef atarist X+ if (file_size_and_mode (fname, (int *)0, &st_size) < 0) X+ #else X if (file_size_and_mode (f, (int *)0, &st_size) < 0) X+ #endif X goto nope; /* Impossible? */ X X fp = &instack[indepth + 1]; X*************** X*** 2478,2484 **** X--- 2653,2663 ---- X /* Read the file contents, knowing that st_size is an upper bound X on the number of bytes we can read. */ X while (st_size > 0) { X+ #ifdef atarist X+ i = eunuchs_read (f, fp->buf + fp->length, st_size); X+ #else X i = read (f, fp->buf + fp->length, st_size); X+ #endif X if (i <= 0) { X if (i == 0) break; X goto nope; X*************** X*** 3797,3804 **** X--- 3976,3987 ---- X check_expand (op, len + 1); X if (op->bufp > op->buf && op->bufp[-1] != '\n') X *op->bufp++ = '\n'; X+ #ifdef atarist X+ op->bufp = slashifying_bcopy (line_cmd_buf, op->bufp, len); X+ #else X bcopy (line_cmd_buf, op->bufp, len); X op->bufp += len; X+ #endif X op->lineno = ip->lineno; X } X X*************** X*** 5003,5009 **** X--- 5186,5196 ---- X extern char *sys_errlist[]; X X fprintf (stderr, "%s: ", progname); X+ #ifdef atarist X+ if ((errno > sys_nerr) && (errno < 0)) X+ #else X if (errno < sys_nerr) X+ #endif X fprintf (stderr, "%s for `%s'\n", sys_errlist[errno], name); X else X fprintf (stderr, "undocumented error for `%s'\n", name); X*************** X*** 5082,5095 **** X--- 5269,5291 ---- X and store them in *MODE_POINTER and *SIZE_POINTER. */ X X int X+ #ifdef atarist X+ file_size_and_mode (fname, mode_pointer, size_pointer) X+ char * fname; X+ #else X file_size_and_mode (fd, mode_pointer, size_pointer) X int fd; X+ #endif X int *mode_pointer; X long int *size_pointer; X { X struct stat sbuf; X X+ #ifdef atarist X+ if (stat (fname, &sbuf) < 0) return (-1); X+ #else X if (fstat (fd, &sbuf) < 0) return (-1); X+ #endif X if (mode_pointer) *mode_pointer = sbuf.st_mode; X if (size_pointer) *size_pointer = sbuf.st_size; X return 0; X*** ../../gcc-1.31/combine.c Tue Nov 22 16:29:03 1988 X--- combine.c Wed Nov 23 07:25:23 1988 X*************** X*** 711,717 **** X--- 711,721 ---- X register char *fmt; X register int len, i; X register enum rtx_code code; X+ #if (defined(atarist) || defined(atariminix)) X+ short was_replaced[2]; /* 'char' confuses GAS 1.14... */ X+ #else X char was_replaced[2]; X+ #endif X X #define SUBST(INTO, NEWVAL) \ X do { if (undobuf.num_undo < MAX_UNDO) \ X*** ../../gcc-1.31/gcc.c Tue Nov 22 16:29:26 1988 X--- gcc.c Wed Nov 23 09:13:38 1988 X*************** X*** 104,110 **** X--- 104,119 ---- X position among the other output files. X X */ X+ #ifdef CROSSATARI X+ #ifdef atarist X+ #undef atarist X+ #endif X+ #ifdef atariminix X+ #undef atariminix X+ #endif X+ #endif X X+ X /* This defines which switches take arguments. */ X X #define SWITCH_TAKES_ARG(CHAR) \ X*************** X*** 114,126 **** X || (CHAR) == 'L') X X #include <stdio.h> X #include <sys/types.h> X #include <signal.h> X #include <sys/file.h> X #include "config.h" X #include "obstack.h" X X! #ifdef USG X #define R_OK 4 X #define W_OK 2 X #define X_OK 1 X--- 123,148 ---- X || (CHAR) == 'L') X X #include <stdio.h> X+ X+ #ifdef atarist X+ #include <types.h> X+ #include <signal.h> X+ #include <file.h> X+ #include <osbind.h> X+ X+ long _stksize = 8192; X+ extern char *getenv(); X+ X+ #else X #include <sys/types.h> X #include <signal.h> X #include <sys/file.h> X+ #endif X+ X #include "config.h" X #include "obstack.h" X X! #if (defined(USG) || defined(atariminix)) X #define R_OK 4 X #define W_OK 2 X #define X_OK 1 X*************** X*** 207,213 **** X {".c", X "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{T} \ X -undef -D__GNU__ -D__GNUC__ %{ansi:-T -$ -D__STRICT_ANSI__} %{!ansi:%p}\ X! %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic}\ X %{Wcomment} %{Wtrigraphs} %{Wall} %C\ X %i %{!M*:%{!E:%g.cpp}}%{E:%{o*}}%{M*:%{o*}}\n\ X %{!M*:%{!E:cc1 %g.cpp %1 %{!Q:-quiet} -dumpbase %i %{Y*} %{d*} %{m*} %{f*}\ X--- 229,236 ---- X {".c", X "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{T} \ X -undef -D__GNU__ -D__GNUC__ %{ansi:-T -$ -D__STRICT_ANSI__} %{!ansi:%p}\ X! %c %{O:-D__OPTIMIZE__} %{mshort:-D__MSHORT__} %{traditional}\ X! %{pedantic}\ X %{Wcomment} %{Wtrigraphs} %{Wall} %C\ X %i %{!M*:%{!E:%g.cpp}}%{E:%{o*}}%{M*:%{o*}}\n\ X %{!M*:%{!E:cc1 %g.cpp %1 %{!Q:-quiet} -dumpbase %i %{Y*} %{d*} %{m*} %{f*}\ X*************** X*** 243,252 **** X--- 266,286 ---- X }; X X /* Here is the spec for running the linker, after compiling all files. */ X+ #if (defined(CROSSATARI) || defined(atarist) || defined(atariminix)) X+ X char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\ X %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\ X %{y*} %{!nostdlib:%S} \ X+ %{L*} %o %{!nostdlib:%s %{g:-lg} %L}\n }}}}"; X+ X+ #else X+ X+ char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\ X+ %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\ X+ %{y*} %{!nostdlib:%S} \ X %{L*} %o %{!nostdlib:gnulib%s %{g:-lg} %L}\n }}}}"; X+ X+ #endif X X /* Record the names of temporary files we tell compilers to write, X and delete them at the end of the run. */ X*************** X*** 327,336 **** X--- 361,389 ---- X void X choose_temp_base () X { X+ #if (!(defined(atarist) || defined(atariminix))) X register char *foo = "/tmp/ccXXXXXX"; X temp_filename = (char *) xmalloc (strlen (foo) + 1); X strcpy (temp_filename, foo); X+ #else X+ #ifdef atarist X+ char * env_temp = (char *)getenv("TEMP"); X+ X+ if (!env_temp) X+ env_temp = "\\temp"; X+ temp_filename = concat(env_temp, "\\", "gcc-temp"); X+ #else X+ char * env_temp = (char *)getenv("TEMP"); X+ X+ if (!env_temp) X+ env_temp = "/tmp"; X+ temp_filename = concat(env_temp, "/", "ccXXXXXX"); X+ #endif X+ #endif X+ X+ #ifndef atarist X mktemp (temp_filename); X+ #endif X temp_filename_length = strlen (temp_filename); X } X X*************** X*** 360,372 **** X--- 413,445 ---- X /* Default prefixes to attach to command names. */ X X #ifndef STANDARD_EXEC_PREFIX X+ #ifdef CROSSATARI X+ #ifdef MINIX X+ #define STANDARD_EXEC_PREFIX "/dsrg/bammi/cross-minix/lib/gcc-" X+ #else X+ #define STANDARD_EXEC_PREFIX "/dsrg/bammi/cross-gcc/lib/gcc-" X+ #endif X+ #else X #define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-" X+ #endif X #endif /* !defined STANDARD_EXEC_PREFIX */ X X char *standard_exec_prefix = STANDARD_EXEC_PREFIX; X char *standard_exec_prefix_1 = "/usr/lib/gcc-"; X X+ #ifdef CROSSATARI X+ #ifdef MINIX X+ char *standard_startfile_prefix = "/dsrg/bammi/cross-minix/lib/"; X+ #else X+ char *standard_startfile_prefix = "/dsrg/bammi/cross-gcc/lib/"; X+ #endif X+ #else X+ #ifdef atariminix X+ char *standard_startfile_prefix = "/usr/local/lib/"; X+ #else X char *standard_startfile_prefix = "/lib/"; X+ #endif X+ #endif X char *standard_startfile_prefix_1 = "/usr/lib/"; X X /* Clear out the vector of arguments (after a command is executed). */ X*************** X*** 418,423 **** X--- 491,499 ---- X if (strlen (standard_exec_prefix_1) > size) X size = strlen (standard_exec_prefix_1); X size += strlen (argbuf[0]) + 1; X+ #ifdef atarist X+ size += 5; /* slush for ".ttp" */ X+ #endif X temp = (char *) alloca (size); X X /* Determine the filename to execute. */ X*************** X*** 426,431 **** X--- 502,510 ---- X { X strcpy (temp, user_exec_prefix); X strcat (temp, argbuf[0]); X+ #ifdef atarist X+ strcat (temp, ".ttp"); X+ #endif X win = (access (temp, X_OK) == 0); X } X X*************** X*** 433,438 **** X--- 512,520 ---- X { X strcpy (temp, standard_exec_prefix); X strcat (temp, argbuf[0]); X+ #ifdef atarist X+ strcat (temp, ".ttp"); X+ #endif X win = (access (temp, X_OK) == 0); X } X X*************** X*** 440,445 **** X--- 522,530 ---- X { X strcpy (temp, standard_exec_prefix_1); X strcat (temp, argbuf[0]); X+ #ifdef atarist X+ strcat (temp, ".ttp"); X+ #endif X win = (access (temp, X_OK) == 0); X } X X*************** X*** 466,472 **** X #endif /* DEBUG */ X } X X! #ifdef USG X pid = fork (); X if (pid < 0) X pfatal_with_name ("fork"); X--- 551,558 ---- X #endif /* DEBUG */ X } X X! #ifndef atarist X! #if (defined(USG) || defined(atariminix)) X pid = fork (); X if (pid < 0) X pfatal_with_name ("fork"); X*************** X*** 480,494 **** X--- 566,613 ---- X if (win) X execv (temp, argbuf); X else X+ #ifdef atariminix X+ /* hopefully it never gets here -- keep your fingers crossed */ X+ /* this has to fixed someday */ X+ execv (argbuf[0], argbuf); X+ #else X execvp (argbuf[0], argbuf); X+ #endif X perror_with_name (argbuf[0]); X+ #ifdef atariminix X+ exit (65); X+ #else X _exit (65); X+ #endif X+ X } X wait (&status); X if ((status & 0x7F) != 0) X fatal ("Program %s got fatal signal %d.", argbuf[0], (status & 0x7F)); X if (((status & 0xFF00) >> 8) >= MIN_FATAL_STATUS) X return -1; X+ #else X+ X+ { X+ char * sizep = (char * ) alloca(256); X+ char * cmdp = sizep + 1; X+ register int iii; X+ X+ *cmdp = '\0'; X+ for (iii = 1 ; (argbuf[iii] != 0) ; iii++ ) X+ { X+ strcat (cmdp, argbuf[iii]); X+ strcat (cmdp, " "); X+ } X+ *sizep = strlen(cmdp); X+ if (!win) X+ temp = argbuf[0]; X+ /* printf("exec '%s' '%s'\n", temp, cmdp); */ X+ iii = Pexec(0, temp, sizep, 0); X+ /* printf(" ... -> %d\n", iii); */ X+ return(iii); X+ } X+ #endif /* atarist */ X return 0; X } X X*************** X*** 654,659 **** X--- 773,788 ---- X search dirs for it. */ X int this_is_library_file; X X+ #ifdef atarist X+ /* I don't know why this is necessary. Recursive calls to do_spec_1 X+ end up ignoring the error code from calls to execute(). That causes X+ do_spec to get a 0 return value, and do_spec_1("\n"), which causes the X+ command to get executed again. X+ */ X+ int execute_return_error = 0; X+ #endif X+ X+ X /* Process the spec SPEC and run the commands specified therein. X Returns 0 if the spec is successfully processed; -1 if failed. */ X X*************** X*** 670,675 **** X--- 799,811 ---- X this_is_library_file = 0; X X value = do_spec_1 (spec, 0); X+ #ifdef atarist X+ if (!value && execute_return_error) X+ { X+ value = execute_return_error; X+ execute_return_error = 0; X+ } X+ #endif X if (value == 0) X value = do_spec_1 ("\n", 0); X return value; X*************** X*** 701,706 **** X--- 837,866 ---- X Otherwise, NL, SPC, TAB and % are special. */ X switch (inswitch ? 'a' : c) X { X+ #ifdef atarist X+ /* this stuff added by jrd. if see '$', expect name of env var, delimited X+ by '$'. Find it's value, and subst it in. */ X+ X+ case '$': X+ { X+ char varname[32]; /* should be enough */ X+ char * value; /* deciphered value string */ X+ int i; X+ X+ for (i = 0 ; ((c = *p++) != '$') ; i++) X+ varname[i] = c; X+ varname[i] = '\0'; X+ if (strlen(&varname) > 0) X+ { X+ value = (char * )getenv(&varname); X+ if (value) X+ do_spec_1(value, 0); X+ else X+ do_spec_1(".", 0); /* a compleat kludge... */ X+ } X+ break; X+ } X+ #endif /* atarist */ X case '\n': X /* End of line: finish any pending argument, X then run the pending command if one has been started. */ X*************** X*** 718,723 **** X--- 878,887 ---- X if (argbuf_index) X { X int value = execute (); X+ #ifdef atarist X+ if (!execute_return_error) X+ execute_return_error = value; X+ #endif X if (value) X return value; X } X*************** X*** 834,839 **** X--- 998,1007 ---- X break; X X default: X+ #ifdef atarist X+ fprintf(stderr, "Bogus char '%c' found at pos %d of spec '%s'\n", X+ c, (p - spec - 1), spec); X+ #endif X abort (); X } X break; X*************** X*** 1026,1032 **** X--- 1194,1204 ---- X X if (!win) X { X+ #ifdef atarist X+ strcpy (temp, ".\\"); X+ #else X strcpy (temp, "./"); X+ #endif X strcat (temp, name); X win = (access (temp, R_OK) == 0); X } X*************** X*** 1042,1047 **** X--- 1214,1220 ---- X X /* On fatal signals, delete all the temporary files. */ X X+ #ifndef atarist X void X fatal_error (signum) X int signum; X*************** X*** 1052,1057 **** X--- 1225,1231 ---- X so its normal effect occurs. */ X kill (getpid (), signum); X } X+ #endif /* atarist */ X X int X main (argc, argv) X*************** X*** 1063,1076 **** X--- 1237,1256 ---- X int nolink = 0; X int error_count = 0; X X+ #ifdef atarist X+ programname = "gcc"; X+ #else X programname = argv[0]; X+ #endif X X+ #ifndef atarist X if (signal (SIGINT, SIG_IGN) != SIG_IGN) X signal (SIGINT, fatal_error); X if (signal (SIGHUP, SIG_IGN) != SIG_IGN) X signal (SIGHUP, fatal_error); X if (signal (SIGTERM, SIG_IGN) != SIG_IGN) X signal (SIGTERM, fatal_error); X+ #endif X X argbuf_length = 10; X argbuf = (char **) xmalloc (argbuf_length * sizeof (char *)); X*************** X*** 1084,1089 **** X--- 1264,1279 ---- X X process_command (argc, argv); X X+ #ifdef atarist X+ /* if no default dir specified for executables, look for an env var X+ called 'GCCEXEC' and use that */ X+ X+ if (!user_exec_prefix) X+ { X+ user_exec_prefix = getenv("GCCEXEC"); X+ } X+ #endif /* atarist */ X+ X if (vflag) X { X extern char *version_string; X*************** X*** 1130,1142 **** X--- 1320,1342 ---- X X input_basename = input_filename; X for (p = input_filename; *p; p++) X+ #ifdef atarist X+ if (*p == '\\') X+ #else X if (*p == '/') X+ #endif X input_basename = p + 1; X basename_length = (input_filename_length - strlen (cp->suffix) X - (input_basename - input_filename)); X value = do_spec (cp->spec); X if (value < 0) X error_count = 1; X+ #ifdef atarist X+ /* is this necessary? */ X+ else X+ if (value == FATAL_EXIT_CODE) X+ error_count = 1; X+ #endif X break; X } X } X*************** X*** 1240,1246 **** X--- 1440,1450 ---- X extern char *sys_errlist[]; X char *s; X X+ #ifdef atarist X+ if ((errno > sys_nerr) && (errno < 0)) X+ #else X if (errno < sys_nerr) X+ #endif X s = concat ("", sys_errlist[errno], " for %s"); X else X s = "cannot open %s"; X*************** X*** 1254,1260 **** X--- 1458,1468 ---- X extern char *sys_errlist[]; X char *s; X X+ #ifdef atarist X+ if ((errno > sys_nerr) && (errno < 0)) X+ #else X if (errno < sys_nerr) X+ #endif X s = concat ("", sys_errlist[errno], " for %s"); X else X s = "cannot open %s"; X*** ../../gcc-1.31/symout.c Mon Aug 22 11:57:25 1988 X--- symout.c Wed Nov 23 07:25:27 1988 X*************** X*** 25,30 **** X--- 25,35 ---- X #include "rtl.h" X #include "gdbfiles.h" X #include <stdio.h> X+ #ifndef atarist X+ #include <sys/types.h> X+ #else X+ #include <types.h> X+ #endif X #undef NULL X #include "stddef.h" X X*** ../../gcc-1.31/toplev.c Tue Nov 22 16:30:39 1988 X--- toplev.c Wed Nov 23 07:25:29 1988 X*************** X*** 29,48 **** X--- 29,66 ---- X #include <signal.h> X #include <setjmp.h> X X+ #ifdef atarist X+ #include <types.h> X+ #include <stat.h> X+ X+ extern long _stksize = 128L * 1024L; /* for 1M ST's */ X+ /* extern long _stksize = 500000; */ /* enough to compile -O gas */ X+ X+ #else X+ X #include <sys/types.h> X #include <sys/stat.h> X X+ #ifdef atariminix X+ #include <sys/times.h> X+ #include <minix/const.h> X+ #endif X+ X #ifdef USG X #include <sys/param.h> X #include <sys/times.h> X #include <time.h> /* Correct for hpux at least. Is it good on other USG? */ X #else X #ifndef VMS X+ #ifndef atariminix X #include <sys/time.h> X #include <sys/resource.h> X #endif X #endif X+ #endif X X+ #endif /* atarist */ X+ X #include "tree.h" X #include "c-tree.h" X #include "rtl.h" X*************** X*** 271,277 **** X int X gettime () X { X! #ifdef USG X struct tms tms; X #else X #ifndef VMS X--- 289,298 ---- X int X gettime () X { X! #ifdef atarist X! long now; X! #else X! #if (defined(USG) || defined(atariminix)) X struct tms tms; X #else X #ifndef VMS X*************** X*** 286,296 **** X } vms_times; X #endif X #endif X X if (quiet_flag) X return 0; X X! #ifdef USG X times (&tms); X return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ); X #else X--- 307,321 ---- X } vms_times; X #endif X #endif X+ #endif X X if (quiet_flag) X return 0; X X! #ifdef atarist X! return(time(NULL) * 1000000); X! #else X! #if (defined(USG) || defined(atariminix)) X times (&tms); X return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ); X #else X*************** X*** 303,308 **** X--- 328,334 ---- X return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000; X #endif X #endif X+ #endif /* atarist */ X } X X #define TIMEVAR(VAR, BODY) \ X*************** X*** 965,971 **** X--- 991,1001 ---- X TIMEVAR (symout_time, X { X struct stat statbuf; X+ #ifdef atarist X+ stat (name, &statbuf); X+ #else X fstat (fileno (finput), &statbuf); X+ #endif X symout_types (get_permanent_types ()); X symout_top_blocks (globals, gettags ()); X symout_finish (name, statbuf.st_ctime); X*************** X*** 1475,1480 **** X--- 1505,1520 ---- X else if (!strcmp (str, "dumpbase")) X { X dump_base_name = argv[++i]; X+ #ifdef atarist X+ /* dump_base_name will typically be 'foo.c' here. Need to truncate at the '.', X+ cause dots mean something here */ X+ { X+ char * n = dump_base_name; X+ for ( ; ((*n) && (*n != '.')) ; ) X+ n++; X+ *n = '\0'; X+ } X+ #endif X } X else if (str[0] == 'd') X { X*************** X*** 1635,1640 **** X--- 1675,1681 ---- X X compile_file (filename); X X+ #if (!(defined(atarist) || defined(atariminix))) X #ifndef USG X #ifndef VMS X if (print_mem_flag) X*************** X*** 1650,1656 **** X } X #endif /* not VMS */ X #endif /* not USG */ X! X if (errorcount) X exit (FATAL_EXIT_CODE); X if (sorrycount) X--- 1691,1697 ---- X } X #endif /* not VMS */ X #endif /* not USG */ X! #endif /* atarist or atariminix */ X if (errorcount) X exit (FATAL_EXIT_CODE); X if (sorrycount) SHAR_EOF if test 28120 -ne "`wc -c 'gcc-1.31-diff'`" then echo shar: error transmitting "'gcc-1.31-diff'" '(should have been 28120 characters)' fi # End of shell archive exit 0 usenet: {decvax,sun}!cwjcc!dsrgsun!bammi jwahar r. bammi csnet: bammi@dsrgsun.ces.CWRU.edu arpa: bammi@dsrgsun.ces.CWRU.edu compuServe: 71515,155