[comp.lang.scheme] patches2.shar

hartzell@boulder.colorado.edu (George Hartzell) (12/05/89)

This is the second file of patches needed to get ELK running on a
MIPS.  Look for the companion postings README.MIPS, sources.shar, and
patches1.shar.

#! /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:
#	ROOT_PATCHES
#	SRC_PATCHES
# This archive created: Mon Dec  4 11:12:14 1989
export PATH; PATH=/bin:$PATH
echo shar: extracting "'ROOT_PATCHES'" '(3526 characters)'
if test -f 'ROOT_PATCHES'
then
	echo shar: will not over-write existing file "'ROOT_PATCHES'"
else
sed 's/^	X//' << \SHAR_EOF > 'ROOT_PATCHES'
	X*** /tmp/,RCSt1025393	Mon Dec  4 08:46:39 1989
	X--- Makefile	Mon Dec  4 08:43:47 1989
	X***************
	X*** 1,22 ****
	X  TARGETS= src lib lib/util lib/xlib lib/xt lib/xaw lib/xhp
	X  
	X! SCHEME_DIR= \\\"/f/net/scm/scm\\\"
	X! GENERIC= \"char*\"
	X! MACHTYPE= 68k                                        # vax 68k 386
	X  
	X  INC= -I../src -I../../src
	X  DIR= -DDEF_LOAD_DIR=$(SCHEME_DIR)
	X  GEN= -DGENERIC=$(GENERIC)
	X  
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -O -f -ga -X23         # IS68k 4.3 BSD; FPP
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -O -ga -X23            # IS68k 4.3 BSD
	X!  CFLAGS= $(INC) $(DIR) $(GEN) -O -f -20              # IS68k 4.2 BSD; FPP
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -O -20                 # IS68k 4.2 BSD
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -O                     # SunOS 4.0
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -Dindex=strchr         # System V
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -O -finline-functions  # GNU cc IS68k
	X  
	X!  LDFLAGS= -x                                         # 4.n BSD
	X  #LDFLAGS= -Bstatic                                   # SunOS 4.0
	X  #LDFLAGS= -x -lld                                    # System V
	X  
	X--- 1,30 ----
	X  TARGETS= src lib lib/util lib/xlib lib/xt lib/xaw lib/xhp
	X  
	X! #SCHEME_DIR= \\\"/f/net/scm/scm\\\"
	X! #GENERIC= \"char*\"
	X! #MACHTYPE= 68k                                        # vax 68k 386
	X! SCHEME_DIR= \\\"/beagle/scratch/hartzell/src/elk/scm\\\"
	X! GENERIC= \"void*\"
	X! MACHTYPE= mips                                        # vax 68k 386 mips
	X  
	X  INC= -I../src -I../../src
	X  DIR= -DDEF_LOAD_DIR=$(SCHEME_DIR)
	X  GEN= -DGENERIC=$(GENERIC)
	X  
	X+ CC=/usr/bin/cc2.10 -systype bsd43		     # 2.10beta in bsd mode
	X+ C_SRC_FLAGS= $(INC) $(DIR) $(GEN) -O		     # MIPS 2.1compilers bsd
	X+ C_LIB_FLAGS= $(INC) $(DIR) $(GEN) -O -G 0	     # MIPS 2.1compilers bsd
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -O -f -ga -X23         # IS68k 4.3 BSD; FPP
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -O -ga -X23            # IS68k 4.3 BSD
	X! #CFLAGS= $(INC) $(DIR) $(GEN) -O -f -20              # IS68k 4.2 BSD; FPP
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -O -20                 # IS68k 4.2 BSD
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -O                     # SunOS 4.0
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -Dindex=strchr         # System V
	X  #CFLAGS= $(INC) $(DIR) $(GEN) -O -finline-functions  # GNU cc IS68k
	X  
	X! LD_SRC_FLAGS= -D 800000 			     # MIPS
	X! LD_LIB_FLAGS= -D 800000 -G 0			     # MIPS
	X! #LDFLAGS= -x                                         # 4.n BSD
	X  #LDFLAGS= -Bstatic                                   # SunOS 4.0
	X  #LDFLAGS= -x -lld                                    # System V
	X  
	X***************
	X*** 25,35 ****
	X  all:
	X  	@for i in $(TARGETS) ;\
	X  	do \
	X! 	    ( cd $$i ;\
	X! 	    echo Making $$i ;\
	X! 	    make "MACHTYPE=$(MACHTYPE)" "CC=$(CC)" "CFLAGS=$(CFLAGS)"\
	X! 		 "LDFLAGS=$(LDFLAGS)" ) ;\
	X  	done
	X  
	X  lint:
	X  	@for i in $(TARGETS) ;\
	X--- 33,64 ----
	X  all:
	X  	@for i in $(TARGETS) ;\
	X  	do \
	X! 		case $$i in \
	X! 		"src") \
	X! 		   ( cd $$i ; \
	X! 		   echo Making $$i ; \
	X! 		   make "MACHTYPE=$(MACHTYPE)" "CC=$(CC)" \
	X! 		    "CFLAGS=$(C_SRC_FLAGS)" "LDFLAGS=$(LD_SRC_FLAGS)" ) ; \
	X! 		   ;; \
	X! 		*) \
	X! 		    ( cd $$i ; \
	X! 		    echo Making $$i ; \
	X! 		    make "MACHTYPE=$(MACHTYPE)" "CC=$(CC)" \
	X! 			"CFLAGS=$(C_LIB_FLAGS)" "LDFLAGS=$(LD_LIB_FLAGS)" ) ; \
	X! 		    ;; \
	X! 		esac \
	X! 
	X  	done
	X+ 
	X+ #all:
	X+ #	@for i in $(TARGETS) ;\
	X+ #	do \
	X+ #	    ( cd $$i ;\
	X+ #	    echo Making $$i ;\
	X+ #	    make "MACHTYPE=$(MACHTYPE)" "CC=$(CC)" "CFLAGS=$(CFLAGS)"\
	X+ #		 "LDFLAGS=$(LDFLAGS)" ) ;\
	X+ #	done
	X+ #
	X  
	X  lint:
	X  	@for i in $(TARGETS) ;\
SHAR_EOF
if test 3526 -ne "`wc -c < 'ROOT_PATCHES'`"
then
	echo shar: error transmitting "'ROOT_PATCHES'" '(should have been 3526 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'SRC_PATCHES'" '(9273 characters)'
if test -f 'SRC_PATCHES'
then
	echo shar: will not over-write existing file "'SRC_PATCHES'"
else
sed 's/^	X//' << \SHAR_EOF > 'SRC_PATCHES'
	X*** /tmp/,RCSt1019048	Sun Dec  3 12:51:51 1989
	X--- Makefile	Sun Dec  3 11:57:15 1989
	X***************
	X*** 9,15 ****
	X  	char.c\
	X  	cont.c\
	X  	debug.c\
	X! 	dump.c\
	X  	env.c\
	X  	error.c\
	X  	features.c\
	X--- 9,15 ----
	X  	char.c\
	X  	cont.c\
	X  	debug.c\
	X! 	dumpmips.c\
	X  	env.c\
	X  	error.c\
	X  	features.c\
	X***************
	X*** 17,23 ****
	X  	heap.c\
	X  	io.c\
	X  	list.c\
	X! 	load.c\
	X  	main.c\
	X  	math.c\
	X  	prim.c\
	X--- 17,23 ----
	X  	heap.c\
	X  	io.c\
	X  	list.c\
	X! 	loadmips.c\
	X  	main.c\
	X  	math.c\
	X  	prim.c\
	X***************
	X*** 26,32 ****
	X  	promise.c\
	X  	read.c\
	X  	special.c\
	X! 	stab.c\
	X  	string.c\
	X  	symbol.c\
	X  	type.c\
	X--- 26,32 ----
	X  	promise.c\
	X  	read.c\
	X  	special.c\
	X! 	stabmips.c\
	X  	string.c\
	X  	symbol.c\
	X  	type.c\
	X***************
	X*** 39,45 ****
	X  	char.o\
	X  	cont.o\
	X  	debug.o\
	X! 	dump.o\
	X  	env.o\
	X  	error.o\
	X  	features.o\
	X--- 39,45 ----
	X  	char.o\
	X  	cont.o\
	X  	debug.o\
	X! 	dumpmips.o\
	X  	env.o\
	X  	error.o\
	X  	features.o\
	X***************
	X*** 47,53 ****
	X  	heap.o\
	X  	io.o\
	X  	list.o\
	X! 	load.o\
	X  	main.o\
	X  	math.o\
	X  	prim.o\
	X--- 47,53 ----
	X  	heap.o\
	X  	io.o\
	X  	list.o\
	X! 	loadmips.o\
	X  	main.o\
	X  	math.o\
	X  	prim.o\
	X***************
	X*** 56,62 ****
	X  	promise.o\
	X  	read.o\
	X  	special.o\
	X! 	stab.o\
	X  	stack.o\
	X  	string.o\
	X  	symbol.o\
	X--- 56,62 ----
	X  	promise.o\
	X  	read.o\
	X  	special.o\
	X! 	stabmips.o\
	X  	stack.o\
	X  	string.o\
	X  	symbol.o\
	X***************
	X*** 84,90 ****
	X  char.o:		$(H)
	X  cont.o:		$(H)
	X  debug.o:	$(H)
	X! dump.o:		$(H)
	X  env.o:		$(H)
	X  error.o:	$(H)
	X  features.o:	$(H)
	X--- 84,90 ----
	X  char.o:		$(H)
	X  cont.o:		$(H)
	X  debug.o:	$(H)
	X! dumpmips.o:	$(H)
	X  env.o:		$(H)
	X  error.o:	$(H)
	X  features.o:	$(H)
	X***************
	X*** 92,98 ****
	X  heap.o:		$(H)
	X  io.o:		$(H)
	X  list.o:		$(H)
	X! load.o:		$(H)
	X  main.o:		$(H)
	X  math.o:		$(H)
	X  prim.o:		$(H)
	X--- 92,98 ----
	X  heap.o:		$(H)
	X  io.o:		$(H)
	X  list.o:		$(H)
	X! loadmips.o:	$(H)
	X  main.o:		$(H)
	X  math.o:		$(H)
	X  prim.o:		$(H)
	X***************
	X*** 101,107 ****
	X  promise.o:	$(H)
	X  read.o:		$(H)
	X  special.o:	$(H)
	X! stab.o:		$(H)
	X  string.o:	$(H)
	X  symbol.o:	$(H)
	X  type.o:		$(H)
	X--- 101,107 ----
	X  promise.o:	$(H)
	X  read.o:		$(H)
	X  special.o:	$(H)
	X! stabmips.o:	$(H)
	X  string.o:	$(H)
	X  symbol.o:	$(H)
	X  type.o:		$(H)
	X*** /tmp/,RCSt1019051	Sun Dec  3 12:51:52 1989
	X--- bignum.c	Sun Dec  3 12:36:09 1989
	X***************
	X*** 158,164 ****
	X--- 158,171 ----
	X      }
	X      
	X      size = BIGNUM(x)->usize * 5 + 3;
	X+ #ifndef MIPS_ALLOCA
	X      buf = alloca (size + 1);
	X+ #else
	X+     {
	X+       int mips_alloca_size = size + 1;
	X+       buf = alloca (size);
	X+     }
	X+ #endif
	X      p = buf + size;
	X      *p = 0;
	X  
	X***************
	X*** 648,655 ****
	X      if (Bignum_Div_In_Place (dend, scale))
	X  	Panic ("Bignum_Div scale");
	X   zero:
	X      if (Truep (dend->minusp = BIGNUM(x)->minusp) != Truep (BIGNUM(y)->minusp))
	X! 	BIGNUM(quot)->minusp = True;
	X      Bignum_Normalize_In_Place (BIGNUM(quot));
	X      Bignum_Normalize_In_Place (dend);
	X      GC_Link (quot);
	X--- 655,668 ----
	X      if (Bignum_Div_In_Place (dend, scale))
	X  	Panic ("Bignum_Div scale");
	X   zero:
	X+     /* this tickles a cc2.10beta compiler bug. gh */
	X+ #ifndef mips
	X      if (Truep (dend->minusp = BIGNUM(x)->minusp) != Truep (BIGNUM(y)->minusp))
	X! #else
	X!     dend->minusp = BIGNUM(x)->minusp;
	X!     if (Truep (dend->minusp) != Truep (BIGNUM(y)->minusp))
	X!       BIGNUM(quot)->minusp = True;
	X! #endif
	X      Bignum_Normalize_In_Place (BIGNUM(quot));
	X      Bignum_Normalize_In_Place (dend);
	X      GC_Link (quot);
	X*** /tmp/,RCSt1019054	Sun Dec  3 12:51:52 1989
	X--- extern.h	Sun Dec  3 12:33:49 1989
	X***************
	X*** 5,11 ****
	X--- 5,15 ----
	X   */
	X  
	X  extern errno;
	X+ #ifndef MIPS_ALLOCA
	X  extern char *sbrk(), *alloca(), *malloc(), *getenv(), *mktemp();
	X+ #else
	X+ extern char *sbrk(), *malloc(), *getenv(), *mktemp();
	X+ #endif
	X  
	X  /* auto.c:
	X   */
	X*** /tmp/,RCSt1019057	Sun Dec  3 12:51:52 1989
	X--- io.c	Sun Dec  3 12:32:43 1989
	X***************
	X*** 166,172 ****
	X--- 166,179 ----
	X  
	X      fn = Get_File_Name (s);
	X      n = STRING(fn)->size;
	X+ #ifndef MIPS_ALLOCA
	X      r = alloca (n+1);
	X+ #else
	X+     {
	X+       int mips_alloca_size = n+1;
	X+       r = alloca (mips_alloca_size);
	X+     }
	X+ #endif
	X      bcopy (STRING(fn)->data, r, n);
	X      r[n] = '\0';
	X      switch (op) {
	X***************
	X*** 174,180 ****
	X--- 181,194 ----
	X  	char *p, *dir;
	X  	if ((p = Internal_Tilde_Expand (r, &dir)) == 0)
	X  	    return s;
	X+ #ifndef MIPS_ALLOCA
	X  	r = alloca (strlen (dir) + 1 + strlen (p));
	X+ #else
	X+ 	{
	X+ 	  int mips_alloca_size = strlen(dir) + 1 + strlen(p);
	X+ 	  r = alloca (mips_alloca_size);
	X+ 	}
	X+ #endif
	X  	sprintf (r, "%s/%s", dir, p+1);
	X  	return Make_String (r, strlen (r));
	X      }
	X***************
	X*** 200,206 ****
	X--- 214,227 ----
	X      struct stat st;
	X  
	X      if ((p = Internal_Tilde_Expand (name, &dir))) {
	X+ #ifndef MIPS_ALLOCA
	X  	name = alloca (strlen (dir) + 1 + strlen (p));
	X+ #else
	X+ 	{
	X+ 	  int mips_alloca_size = strlen (dir) + 1 + strlen (p);
	X+ 	  name = alloca (mips_alloca_size);
	X+ 	}
	X+ #endif
	X  	sprintf (name, "%s/%s", dir, p+1);
	X      }
	X      if (!err && stat (name, &st) == -1 && errno == ENOENT)
	X***************
	X*** 234,240 ****
	X--- 255,268 ----
	X  	    if ((plen = STRING(pref)->size) > MAXPATHLEN || plen == 0)
	X  		continue;
	X  	    if (len + plen + 2 > blen)
	X+ #ifndef MIPS_ALLOCA
	X  		buf = alloca (blen = len + plen + 2);
	X+ #else
	X+ 	    {
	X+ 	      blen = len + plen + 2;
	X+ 	      buf = alloca (blen);
	X+ 	    }
	X+ #endif
	X  	    bcopy (STRING(pref)->data, buf, plen);
	X  	    if (buf[plen-1] != '/')
	X  		buf[plen++] = '/';
	X***************
	X*** 250,256 ****
	X--- 278,291 ----
	X      if (gotpath)
	X  	Primitive_Error ("file ~s not found", name);
	X      if (len + 1 > blen)
	X+ #ifndef MIPS_ALLOCA
	X  	buf = alloca (len + 1);
	X+ #else
	X+     {
	X+       int mips_alloca_size = len + 1;
	X+       buf = alloca (mips_alloca_size);
	X+     }
	X+ #endif
	X      bcopy (fn, buf, len);
	X      buf[len] = '\0';
	X      return Open_File (buf, flags, 1);
	X*** /tmp/,RCSt1019060	Sun Dec  3 12:51:52 1989
	X--- main.c	Sun Dec  3 12:43:24 1989
	X***************
	X*** 40,49 ****
	X--- 40,65 ----
	X      char foo;
	X  
	X      if (dumped) {
	X+ #ifndef MIPS_ALLOCA
	X  	(void)alloca (INITIAL_STK_OFFSET - (original_stkbase - &foo));
	X+ #else
	X+ 	{
	X+ 	  int mips_alloca_size;
	X+ 	  char *trash;
	X+ 	  mips_alloca_size = INITIAL_STK_OFFSET - (original_stkbase - &foo);
	X+ 	  trash = alloca (mips_alloca_size);
	X+ 	}
	X+ #endif
	X      } else {
	X  	original_stkbase = &foo;
	X+ #ifndef MIPS_ALLOCA
	X  	(void)alloca (INITIAL_STK_OFFSET);
	X+ #else
	X+ 	{
	X+ 	  char *trash = alloca (INITIAL_STK_OFFSET);
	X+ 	}
	X+ #endif
	X+ 
	X      }
	X      Main (ac, av);
	X      /*NOTREACHED*/
	X*** /tmp/,RCSt1019063	Sun Dec  3 12:51:53 1989
	X--- proc.c	Sun Dec  3 12:25:22 1989
	X***************
	X*** 232,238 ****
	X--- 232,245 ----
	X  	if (argc <= 8)
	X  	    argv = abuf;
	X  	else
	X+ #ifndef MIPS_ALLOCA
	X  	    argv = (Object *)alloca (argc * sizeof (Object));
	X+ #else
	X+ 	    {
	X+ 	    int mips_alloca_size = argc * sizeof (Object);
	X+ 	    argv = (Object *)alloca (mips_alloca_size);
	X+ 	    }
	X+ #endif
	X  	GC_Link2 (argl, fun);
	X  	gcv.gclen = 1; gcv.gcobj = argv; gcv.next = &gc2; GC_List = &gcv;
	X  	for (i = 0; i < argc; i++, argl = Cdr (argl)) {
	X***************
	X*** 317,323 ****
	X--- 324,337 ----
	X  	if (argc <= 4)
	X  	    argv = abuf;
	X  	else
	X+ #ifndef MIPS_ALLOCA
	X  	    argv = (Object *)alloca (argc * sizeof (Object));
	X+ #else
	X+ 	    {
	X+ 	      int mips_alloca_size = argc * sizeof (Object);
	X+ 	      argv = (Object *)alloca (mips_alloca_size);
	X+ 	    }
	X+ #endif
	X      }
	X      TC_Disable;
	X      gcv.gclen = 1; gcv.gcobj = argv; gcv.next = &gc5; GC_List = &gcv;
	X***************
	X*** 441,447 ****
	X--- 455,468 ----
	X      GC_Node2; GCNODE gcv;
	X  
	X      Check_Procedure (argv[0]);
	X+ #ifndef MIPS_ALLOCA
	X      args = (Object *)alloca ((argc-1) * sizeof (Object));
	X+ #else
	X+     {
	X+       int mips_alloca_size = (argc - 1) * sizeof (Object);
	X+       args = (Object *)alloca (mips_alloca_size);
	X+     }
	X+ #endif
	X      list = tail = Null;
	X      GC_Link2 (list, tail);
	X      gcv.gclen = argc; gcv.gcobj = args; gcv.next = &gc2; GC_List = &gcv;
	X*** /tmp/,RCSt1019066	Sun Dec  3 12:51:53 1989
	X--- string.c	Sun Dec  3 12:22:59 1989
	X***************
	X*** 69,75 ****
	X--- 69,82 ----
	X      Check_Type (s, T_String);
	X      p = STRING(s);
	X      if (stksize () + p->size > maxstack) goto err;
	X+ #ifndef MIPS_ALLOCA
	X      b = alloca (p->size+1);
	X+ #else  
	X+     {
	X+       int mips_alloca_size = p->size + 1;
	X+       b = alloca (mips_alloca_size);
	X+     }
	X+ #endif
	X      bcopy (p->data, b, p->size);
	X      b[p->size] = '\0';
	X      ret = Read_Number_Maybe (b);
	X*** /tmp/,RCSt1020632	Sun Dec  3 14:10:53 1989
	X--- config.h	Dec  3 14:10:53 1989
	X***************
	X*** 3,16 ****
	X  /* Machine/compiler dependencies
	X   */
	X  
	X! #ifdef mips
	X  #  define VFORK
	X  #  define TIME_H              <sys/time.h>
	X! #  define VPRINTF
	X  #  ifdef MIPSEB
	X  #    define BIG_ENDIAN
	X  #  endif
	X! #  define TERMIO
	X  #endif
	X  
	X  #ifdef is68k
	X--- 3,21 ----
	X  /* Machine/compiler dependencies
	X   */
	X  
	X! #ifdef mips		/* MIPS RISCos4.01, 2.10compilers, bsd environ */
	X  #  define VFORK
	X  #  define TIME_H              <sys/time.h>
	X! #  define CAN_DUMP
	X! #    define TEXT_START 0x400000
	X! #    define DATA_START 0x800000
	X! #  define CAN_LOAD_OBJ
	X! #  define XFLAG_BROKEN
	X  #  ifdef MIPSEB
	X  #    define BIG_ENDIAN
	X  #  endif
	X! #  define MIPS_ALLOCA
	X! #  include <alloca.h>
	X  #endif
	X  
	X  #ifdef is68k
SHAR_EOF
if test 9273 -ne "`wc -c < 'SRC_PATCHES'`"
then
	echo shar: error transmitting "'SRC_PATCHES'" '(should have been 9273 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0

George Hartzell			                  (303) 492-4535
 MCD Biology, University of Colorado-Boulder, Boulder, CO 80309
hartzell@Boulder.Colorado.EDU  ..!{ncar,nbires}!boulder!hartzell