Return-Path: yonezawa@vceew46.lsi.tmg.nec.co.jp
Received: by jove.pa.dec.com; id AA28629; Sun, 7 May 95 22:20:20 -0700
Received: by pobox1.pa.dec.com; id AA14359; Sun, 7 May 95 22:20:17 -0700
Received: from TYO2.gate.nec.co.jp by inet-gw-3.pa.dec.com (5.65/24Feb95)id AA15088; Sun, 7 May 95 22:18:34 -0700
Received: from mailsv.nec.co.jp ([133.200.254.203]) by TYO2.gate.nec.co.jp (8.6.11+2.5Wb2/3.3Wb-NEC-TYO2) with ESMTP id OAA25844 for <bartlett@decwrl.dec.com>; Mon, 8 May 1995 14:17:11 +0900
Received: from vceew46.lsi.tmg.nec.co.jp (vceew46.lsi.tmg.nec.co.jp [133.202.13.117]) by mailsv.nec.co.jp (8.6.11+2.5Wb2/3.3W-95040611) with ESMTP id OAA13240 for <bartlett@decwrl.dec.com>; Mon, 8 May 1995 14:17:57 +0900
Received: from vceew46 by vceew46.lsi.tmg.nec.co.jp (8.6.12+2.5W/6.4JAIN-lsi-mx1.1)id OAA03037; Mon, 8 May 1995 14:14:32 +0900
Message-Id: <199505080514.OAA03037@vceew46.lsi.tmg.nec.co.jp>
To: bartlett@decwrl.dec.com
Subject: NeXT port of 15mar93 Scheme->C
From: Noritake YONEZAWA <yonezawa@lsi.tmg.nec.co.jp>
X-Mailer: Mew beta version 0.89 on Emacs 19.28.1, Mule 2.2
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Date: Mon, 08 May 1995 14:14:32 +0900
Sender: yonezawa@vceew46.lsi.tmg.nec.co.jp

I made a new port of the `15mar93' release of Scheme->C for
NeXT's MC680x0-based machines. It supports NEXTSTEP 3.0.
The context diff follows.

Noritake YONEZAWA <yonezawa@lsi.tmg.nec.co.jp>
----------------------------------------------

#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1995-05-05 20:02 JST by <yonezawa@localhost>.
# Source directory was `/usr/local/src/schemetoc'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   9332 -rw-rw-r-- NeXT3-15mar93.diff
#
# ============= NeXT3-15mar93.diff ==============
if test -f 'NeXT3-15mar93.diff' && test X"$1" != X"-c"; then
  echo 'x - skipping NeXT3-15mar93.diff (file already exists)'
else
  echo 'x - extracting NeXT3-15mar93.diff (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'NeXT3-15mar93.diff' &&
diff -crN -X Exclude 15mar93-original/README 15mar93/README
*** 15mar93-original/README	Tue Mar  2 08:11:35 1993
--- 15mar93/README	Tue May  2 11:09:39 1995
***************
*** 96,101 ****
--- 96,105 ----
X  	 
X  		1 > make forWIN16
X  
+ 	For NeXT systems based on MC680x0 processors:
+ 
+ 		1 > make forNeXT
+ 
X  3.  Build Scheme->C for a specific processor:
X  
X  	For Alpha AXP OSF/1:
***************
*** 158,163 ****
--- 162,172 ----
X  		No further steps are done on the workstation.  Follow the
X  		instructions in WIN16/README to transfer files to a PC and
X  		complete the build.
+ 
+ 
+ 	For NeXT systems:
+ 
+ 		2 > cd NeXT;make port
X  
X  4.  Verify that the interpreter and compiler were correctly built:
X  
diff -crN -X Exclude 15mar93-original/makefile 15mar93/makefile
*** 15mar93-original/makefile	Wed Feb 17 04:20:09 1993
--- 15mar93/makefile	Mon May  1 23:54:33 1995
***************
*** 103,108 ****
--- 103,115 ----
X  	cp ports/WIN16/*.def WIN16/server
X  	cp ports/WIN16/*.mak WIN16/server
X  
+ forNeXT:
+ 	make "CPU=NeXT" forANY
+ 	cp ports/NeXT/m68k.s NeXT/scrt
+ 	cp ports/NeXT/options.h NeXT/scrt
+ 	cp ports/NeXT/m68k.s NeXT/server
+ 	cp ports/NeXT/options-server.h NeXT/server/options.h
+ 
X  # Clean out working files.
X  
X  clean:
diff -crN -X Exclude 15mar93-original/ports/NeXT/m68k.s 15mar93/ports/NeXT/m68k.s
*** 15mar93-original/ports/NeXT/m68k.s	Thu Jan  1 09:00:00 1970
--- 15mar93/ports/NeXT/m68k.s	Tue May  2 13:07:21 1995
***************
*** 0 ****
--- 1,29 ----
+ |
+ | SCHEME->C
+ |
+ | m68k assembly code.
+ |
+ 
+ |
+ | sc_a2to5d2to7
+ |
+ |   sc_a2to5d2to7( a )
+ | will return the contents of A2, ..., A5, D2, ..., D7 starting at address 'a'.
+ |
+ |
+ 	.text
+ 	.globl	_sc_a2to5d2to7
+ 	.even
+ _sc_a2to5d2to7:
+ 	movl	sp@(4),a0
+ 	movl	a2,a0@(0)
+ 	movl	a3,a0@(4)
+ 	movl	a4,a0@(8)
+ 	movl	a5,a0@(12)
+ 	movl	d2,a0@(16)
+ 	movl	d3,a0@(20)
+ 	movl	d4,a0@(24)
+ 	movl	d5,a0@(28)
+ 	movl	d6,a0@(32)
+ 	movl	d7,a0@(36)
+ 	rts
diff -crN -X Exclude 15mar93-original/ports/NeXT/makefile-head 15mar93/ports/NeXT/makefile-head
*** 15mar93-original/ports/NeXT/makefile-head	Thu Jan  1 09:00:00 1970
--- 15mar93/ports/NeXT/makefile-head	Tue May  2 11:31:48 1995
***************
*** 0 ****
--- 1,27 ----
+ #
+ # This is the header file for constructing make files for NeXT.
+ #
+ 
+ # Default flags to use when invoking the C compiler.
+ 
+ CFLAGS = -O
+ CC = cc
+ 
+ # Assembly language object files.
+ 
+ Aruntime = m68k.o
+ 
+ # Profiled library
+ 
+ Plib =
+ 
+ # Installation tools
+ 
+ RANLIB = ranlib
+ 
+ # X library
+ 
+ XLIB = -lX11
+ XLIBCFLAGS =
+ 
+ # End of NeXT header.
diff -crN -X Exclude 15mar93-original/ports/NeXT/options-server.h 15mar93/ports/NeXT/options-server.h
*** 15mar93-original/ports/NeXT/options-server.h	Thu Jan  1 09:00:00 1970
--- 15mar93/ports/NeXT/options-server.h	Tue May  2 13:14:59 1995
***************
*** 0 ****
--- 1,32 ----
+ /* SCHEME->C */
+ 
+ /* This file defines compilation options for a specific implementation */
+ 
+ #define CHECKSTACK	1
+ #define TIMESLICE	1
+ #define COMPACTPUSHTRACE 0
+ #define COMPACTPOPTRACE 0
+ #define S2CSIGNALS	0
+ #define	MATHTRAPS	0
+ 
+ #define MC680X0 1
+ 
+ #define IMPLEMENTATION_CPU	"680x0"
+ #define	IMPLEMENTATION_MACHINE	"NeXT"
+ #define	IMPLEMENTATION_OS	"MACH"
+ #undef	IMPLEMENTATION_FS
+ #define	STDERR_ISNT_UNBUFFERED
+ 
+ #define BIGENDIAN 1
+ 
+ typedef int S2CINT;			/* Signed pointer size integer */
+ typedef unsigned S2CUINT;		/* Unsigned pointer size interger */
+ 
+ typedef int PAGELINK;			/* 32-bit sc_pagelink values */
+ #define MAXS2CINT  0x7fffffff		/* Maximum value of an S2CINT */
+ #define MSBS2CUINT 0x80000000		/* S2CUINT with 1 in the MSB */
+ 
+ #include <setjmp.h>
+ typedef jmp_buf sc_jmp_buf;
+ 
+ #define STACKPTR(x) ((x) = (sc_processor_register (15)))
diff -crN -X Exclude 15mar93-original/ports/NeXT/options.h 15mar93/ports/NeXT/options.h
*** 15mar93-original/ports/NeXT/options.h	Thu Jan  1 09:00:00 1970
--- 15mar93/ports/NeXT/options.h	Tue May  2 13:13:41 1995
***************
*** 0 ****
--- 1,32 ----
+ /* SCHEME->C */
+ 
+ /* This file defines compilation options for a specific implementation */
+ 
+ #define CHECKSTACK	0
+ #define TIMESLICE	0
+ #define COMPACTPUSHTRACE 0
+ #define COMPACTPOPTRACE 0
+ #define S2CSIGNALS	1
+ #define	MATHTRAPS	0
+ 
+ #define MC680X0 1
+ 
+ #define IMPLEMENTATION_CPU	"680x0"
+ #define	IMPLEMENTATION_MACHINE	"NeXT"
+ #define	IMPLEMENTATION_OS	"MACH"
+ #undef	IMPLEMENTATION_FS
+ #define	STDERR_ISNT_UNBUFFERED
+ 
+ #define BIGENDIAN 1
+ 
+ typedef int S2CINT;			/* Signed pointer size integer */
+ typedef unsigned S2CUINT;		/* Unsigned pointer size interger */
+ 
+ typedef int PAGELINK;			/* 32-bit sc_pagelink values */
+ #define MAXS2CINT  0x7fffffff		/* Maximum value of an S2CINT */
+ #define MSBS2CUINT 0x80000000		/* S2CUINT with 1 in the MSB */
+ 
+ #include <setjmp.h>
+ typedef jmp_buf sc_jmp_buf;
+ 
+ #define STACKPTR(x) ((x) = (sc_processor_register (15)))
diff -crN -X Exclude 15mar93-original/ports/makefile 15mar93/ports/makefile
*** 15mar93-original/ports/makefile	Wed Feb 17 10:18:23 1993
--- 15mar93/ports/makefile	Tue May  2 12:26:38 1995
***************
*** 2,7 ****
--- 2,9 ----
X  # This file is used to make the Scheme->C system for a specific processor
X  # type.
X  #
+ BINDIR=/usr/local/bin
+ LIBDIR=/usr/local/lib
X  
X  # The Scheme->C system is initially compiled from the C sources by the
X  # following:
***************
*** 16,21 ****
--- 18,27 ----
X  install-private:
X  	cd scrt; make "DESTDIR = ${DESTDIR}" install-private
X  	cd scsc; make "DESTDIR = ${DESTDIR}" install-private
+ 
+ install:
+ 	cd scrt; make "BINDIR = ${BINDIR}" "LIBDIR = ${LIBDIR}" install
+ 	cd scsc; make "BINDIR = ${BINDIR}" "LIBDIR = ${LIBDIR}" install
X  
X  # Clean out working files.
X  
diff -crN -X Exclude 15mar93-original/scrt/callcc.c 15mar93/scrt/callcc.c
*** 15mar93-original/scrt/callcc.c	Wed Feb 24 08:25:41 1993
--- 15mar93/scrt/callcc.c	Mon May  1 23:17:56 1995
***************
*** 70,75 ****
--- 70,80 ----
X  #define  SETJMP( x )		setjmp( x )
X  #endif
X  
+ #ifdef NeXT
+ #define  LONGJMP( x, y )	longjmp( x, y )
+ #define  SETJMP( x )		setjmp( x )
+ #endif
+ 
X  #ifdef MAC
X  #define  LONGJMP( x, y )	longjmp( x, y )
X  #define  SETJMP( x )		setjmp( x )
diff -crN -X Exclude 15mar93-original/scrt/cio.c 15mar93/scrt/cio.c
*** 15mar93-original/scrt/cio.c	Wed Feb 24 08:26:58 1993
--- 15mar93/scrt/cio.c	Tue May  2 20:43:32 1995
***************
*** 143,148 ****
--- 143,152 ----
X  #define HAVE_RUSAGE
X  #endif
X  
+ #ifdef NeXT
+ #define HAVE_RUSAGE
+ #endif
+ 
X  #ifdef SYSV
X  #define HAVE_TIMES
X  #else
***************
*** 898,904 ****
X  #else
X  	VOIDP  memp;
X  
! #ifdef MAC
X  	memp = malloc( (size_t)(bytes+PAGEBYTES-1) );
X  	if  ((S2CINT)memp & (PAGEBYTES-1))
X  	   memp = (VOIDP)((char*)memp+(PAGEBYTES-((S2CINT)memp &
--- 902,908 ----
X  #else
X  	VOIDP  memp;
X  
! #if defined(MAC) || defined(NeXT)
X  	memp = malloc( (size_t)(bytes+PAGEBYTES-1) );
X  	if  ((S2CINT)memp & (PAGEBYTES-1))
X  	   memp = (VOIDP)((char*)memp+(PAGEBYTES-((S2CINT)memp &
diff -crN -X Exclude 15mar93-original/scrt/objects.h 15mar93/scrt/objects.h
*** 15mar93-original/scrt/objects.h	Wed Feb 24 08:29:09 1993
--- 15mar93/scrt/objects.h	Tue May  2 00:09:45 1995
***************
*** 1102,1108 ****
X  #define S2CINT_TSCP	sc_s2cint_tscp
X  #define S2CUINT_TSCP    sc_s2cuint_tscp
X  #define POINTER_TSCP	sc_s2cuint_tscp
! #define DOUBLE_TSCP	FLTV_FLT
X  #define CSTRING_TSCP	sc_cstringtostring 
X  #define INITHEAP( a,b,c,d ) \
X  			if (sc_stackbase == 0) { STACKPTR( sc_stackbase ); }\
--- 1102,1108 ----
X  #define S2CINT_TSCP	sc_s2cint_tscp
X  #define S2CUINT_TSCP    sc_s2cuint_tscp
X  #define POINTER_TSCP	sc_s2cuint_tscp
! #define DOUBLE_TSCP(x)	FLTV_FLT(x)
X  #define CSTRING_TSCP	sc_cstringtostring 
X  #define INITHEAP( a,b,c,d ) \
X  			if (sc_stackbase == 0) { STACKPTR( sc_stackbase ); }\
diff -crN -X Exclude 15mar93-original/scrt/options.h 15mar93/scrt/options.h
*** 15mar93-original/scrt/options.h	Tue Feb 23 01:14:40 1993
--- 15mar93/scrt/options.h	Wed May  3 12:33:12 1995
***************
*** 254,259 ****
--- 254,262 ----
X  #define MAXS2CINT  0x7fffffff		/* Maximum value of an S2CINT */
X  #define MSBS2CUINT 0x80000000		/* S2CUINT with 1 in the MSB */
X  
+ #include <setjmp.h>
+ typedef jmp_buf sc_jmp_buf;
+ 
X  #define STACKPTR(x) ((x) = (sc_processor_register (15)))
X  
X  #ifdef __hp9000s400
***************
*** 265,270 ****
--- 268,281 ----
X  #endif
X  
X  /* HP-UX dependent conditionalizations performed above.  */
+ 
+ #ifdef NeXT
+ #define	IMPLEMENTATION_MACHINE	"NeXT"
+ #define	IMPLEMENTATION_OS	"MACH"
+ #undef	IMPLEMENTATION_FS
+ #define	STDERR_ISNT_UNBUFFERED
+ #endif
+ 
X  
X  #endif
X  
diff -crN -X Exclude 15mar93-original/scrt/scinit.c 15mar93/scrt/scinit.c
*** 15mar93-original/scrt/scinit.c	Tue Mar  2 04:32:10 1993
--- 15mar93/scrt/scinit.c	Tue May  2 20:46:46 1995
***************
*** 337,342 ****
--- 337,345 ----
X  }
X  
X  /* The following function is called to initialize the heap from scratch. */
+ #ifdef STDERR_ISNT_UNBUFFERED
+ #include <stdio.h>
+ #endif
X  
X  sc_newheap()
X  {
***************
*** 344,349 ****
--- 347,355 ----
X  	TSCP  unknown;
X  	SCP  ep;
X  
+ #ifdef STDERR_ISNT_UNBUFFERED
+ 	setbuf(stderr, (char*)0);
+ #endif
X  	sc_limit = sclimit;
X  	sc_heappages = 0;
X  	sc_maxheappages = scmaxheap*(ONEMB/PAGEBYTES);
SHAR_EOF
  chmod 0664 'NeXT3-15mar93.diff' ||
  echo 'restore of NeXT3-15mar93.diff failed'
  shar_count="`wc -c < 'NeXT3-15mar93.diff'`"
  test 9332 -eq "$shar_count" ||
    echo "NeXT3-15mar93.diff: original size 9332, current size $shar_count"
fi
exit 0
