You will need a Fortran compiler for the NeXT if you are going to
compile the entire New S.  The cdef.h and mach.m files in this
directory are for use with the Absoft Fortran 77 compiler available
from

  Absoft
  2781 Bond Street
  Rochester Hills, MI 48309

Neither NeXT nor Absoft supplies a Ratfor preprocessor.  Go to
$SHOME/src/ratfor and make the one available there.  I changed the
makefile by adding the line

CFLAGS = -O

to turn on optimization but that is not necessary.  I installed the
a.out file in /usr/local/bin/ratfor since /usr/local/bin is on our
default search path.  This has the advantage that you don't clobber it
if you install a new version of the NeXT operating system.  Change the
definition of RATFOR in $C/makehead and in $QPE/Makefile.

The same procedure has to be followed for m4 after putting
CFLAGS = -g -0 -fwritable-strings
into $SHOME/src/m4/makefile.  If you then move it to
/usr/local/bin/m4, change the definition of m4 in $C/makehead and in
$QPE/Makefile.

Change the definition of the rule .i.x: in $C/makehead to

.i.x:
	-/bin/rm -f /tmp/$*.* >/dev/null 2>&1 || true
	$${SHOME}/cmd/icomp <$*.i >/tmp/$*.i
	$(M4) -DSHOME=$${SHOME} $${SHOME}/newfun/include/intf.m /tmp/$*.i >/tmp/$*.s
	$(M4) -DSHOME=$${SHOME} $(RMAC) /tmp/$*.s >/tmp/$*.r
	sed -n '/^integer qstble([0-9]*,7),/p' /tmp/$*.r >/tmp/qstble.def
	sed -e '/^integer q1e,q1p,/r /tmp/qstble.def' -e '/^integer qstble([0-9]*,7),/d' /tmp/$*.r > /tmp/$*.R
	mv /tmp/$*.R /tmp/$*.r
	$(RATFOR) "-6&" </tmp/$*.r >/tmp/$*.f
#	cd /tmp; $(F77COMPILE) -c -Nq500 -Nn801 $(FFLAGS) $*.f 2>&1 | sed "/local variable.*used/d"
	cd /tmp; $(F77COMPILE) -c $(FFLAGS) $*.f 2>&1 | sed "/local variable.*referenced/d"
	mv /tmp/$*.o $*.x
	$(RM)

Change the defintion of SYSLIB in $QPE/Makefile and in $L/S_makefile to

SYSLIB=-L/LocalApps -lf77 -lfmath -lm


In $C/makehead, $QPE/Makefile, and $QPE/S_makefile 
change the definition of FFLAGS to

FFLAGS = -q -k -O

Also, add the line to $QPE/Makefile

CCFLAGS = -O

(The "-q" for "quiet" and "-O" for "optimize" flags to the f77
compiler are optional but the "-k" flag must be there.  It alerts the
compiler to the fact that both C and Fortran are being used in the
program so the Fortran compiler will set up the return from
subroutines to comply with the C compiler's conventions.  The
optimizer flag for the C compiler is also optional.)

-- Experiences in compiling New S --

The Fortran compiler seemed to have some problems with a couple of
routines.

1) In $P it did not create xmedn.o correctly from xmedn.s.  I was unable
   to reproduce the problem so I just remade xmedn.o with $C/MAKE and
   added it into $L/psl.a by hand, then ranlib'd $L/psl.a

2) I used the optimizer flag (i.e. FFLAGS = -k -q -O in $C/makehead).
   After the compiler had been working on $GRZ/usabdy.r for over an hour,
   I aborted it and compiled that routine by hand without the "-O" flag.

Douglas Bates, Statistics Dept., U. of Wisconsin-Madison    10/24/89


-----

In file sys_funs.c near line 1341, the #ifdef ATT_UNIX that includes <nlist.h>
should be modified to say #ifdef NeXT (which also needs nlist.h).
Similarly, change the #ifdef ATT_UNIX just before the dummy definition of
routine dyn_load (near line 1820) to read #ifdef NeXT.

In file comp_util.c, you should comment-out the definition of the routine
atanh (near line 2490), since gcc will produce an in-line expansion
for this function that uses a builtin on the floating point chip.
