This file contains hints for installing C++ in the bsd universe of
a Sequent Symmetry running DYNIX.  If you have the LaTeX text formatter,
please look for a LaTeX version of this document nearby.

About PRESTO

PRESTO is an environment for writing object-oriented parallel programs
in the C++ programming language.  We would greatly appreciate knowing
who has a copy of PRESTO.  Send email to presto@cs.washington.edu or
uw-june!presto.

About Copyright Protection

PRESTO requires the presence of C++.  Parts
of C++ are copyrighted by AT&T, and parts by AT&T Technologies.

Symmetry PRESTO itself uses source code from Sequent Computer Systems
and from the Free Software Foundation.  These organizations
hold copyrights to this source code.  Please note that the FSF
code provided here is provided in source form only, and the only
portion of this distribution which in whole or in part contains
or is a derivative of FSF programs or any part of FSF programs
is the file shmalloc.c.

Sequent has graciously allowed the UW Department of Computer Science
to make certain Sequent-copyrighted materials available to the public.

Installing PRESTO on a Sequent Symmetry

To get PRESTO running on a Sequent Symmetry, you must build a
PRESTO-Ready Version of C++.

Build a PRESTO-Ready Version of C++

This document assumes that you will build and run C++ in the DYNIX
bsd universe.  Most of the work involves porting C++ to the 
DYNIX bsd universe.  The remainder of the work involves
a new CC command line flag, and the addition of two keywords to C++.
If you already have C++ running in the bsd universe, you may
concentrate on ./C++/CC, ./C++/CC.1, ./C++/incl/parallel/parallel.h, and
./C++/incl/parallel/slock_asm.h.

		Put a copy of AT&T C++ 1.2.1 source code on disk
		Run AT&T's bsd.fix
		Replace certain AT&T header files with DYNIX header files
		Copy certain DYNIX header files
		Apply the diffs.
		Purify your command interpreter's environment
		Make C++ 

Put a copy of AT&T C++ 1.2.1 source code on disk

Our copy of AT&T source contains files dated February 24, 1987.
It is about 2.6 megabytes in size.

Run AT&T's bsd.fix

Replace certain AT&T header files with DYNIX header files

Place a copy of the following DYNIX header files at the indicated pathnames.
This amounts to replacing the AT&T files with the DYNIX files.
We use DYNIX 3.0.6 headers.  You might have to chmod the existing files
in order to overwrite them.

	Copy DYNIX /usr/include/fcntl.h to ./C++/incl/fcntl.h
	Copy DYNIX /usr/include/math.h to ./C++/incl/math.h
	Copy DYNIX /usr/include/nlist.h to ./C++/incl/nlist.h
	Copy DYNIX /usr/include/setjmp.h to ./C++/incl/setjmp.h
	Copy DYNIX /usr/include/stdio.h to ./C++/incl/stdio.h

Copy certain DYNIX header files

Place a copy of the following DYNIX header files at the indicated pathnames.
This will not replace any AT&T files.  We use DYNIX 3.0.6 headers.

	Copy DYNIX /usr/include/ctype.h to ./C++/incl/ctype.h
	Copy DYNIX /usr/include/sys/dir.h to ./C++/incl/sys/dir.h
	Copy DYNIX /usr/include/sys/signal.h to ./C++/incl/sys/signal.h
	Copy DYNIX /usr/include/sys/time.h to ./C++/incl/sys/time.h
	Copy DYNIX /usr/include/sys/types.h to ./C++/incl/sys/types.h
	Copy DYNIX /usr/include/parallel/parallel.h to
		./C++/incl/parallel/parallel.h.  Mkdir if necessary.
	Copy DYNIX /usr/include/parallel/parallel.h to
		./C++/incl/parallel/slock_asm.h

Apply the diffs

Sorry, context diffs didn't seem appropriate, given the copyrights.
In the absence of context diffs, be careful.
If you do not run DYNIX 3.0.6, be especially careful when you
get to the headers.


	patch ./C++/CC with provided diff.

Also, DYNIX ``basename'' differs from System V ``basename''.
We used DYNIX ``basename'' twice, once for little c, once for big c.
DYNIX does not have the ``cut'' command.  We used ``sed''
(sed 's/^-o//').  You may not have an acceptable ``test''
command.  We got one from another operating system.
If you are ambitious, feel free to add debugging and profiling support
to CC.  We did this, copying the interface from the cc(1) man page.
Be sure to leave CC with execute permission turned on.

	patch ./C++/CC.1 with provided diff
	patch ./makefile.

The following details will help with ck_task in ./C++/makefile:
The task portion of libC.a is not implemented on DYNIX.
DYNIX does not have a command called ``sun''.  Delete the sun
portion of the command.  Adding a minus character
before the if will allow make to proceed despite failure.

Also, DYNIX does not have a command called ``type''.  We used ``cat''.
	patch ./C++/incl/fcntl.h with provided diff
	patch ./C++/incl/math.h with provided diff
	patch ./C++/incl/nlist.h with provided diff
	patch ./C++/incl/setjmp.h with provided diff
	patch ./C++/incl/stdio.h with provided diff
	patch ./C++/incl/parallel/parallel.h.

At this path name, alter DYNIX /usr/include/parallel/parallel.h to
look like a C++ header.  I.e., Alter the declarations of sbrk(), shmalloc(),
and shsbrk() to include the types of the parameters.  sbrk takes an int
and returns a caddr_t.  shmalloc takes an unsigned and returns a char *.
shsbrk takes a caddr_t and returns a caddr_t.  Next, get rid of
the Assembler macros S_LOCK, S_UNLOCK, S_CLOCK, S_WAIT_BARRIER,
and _M_JOIN.

	patch ./C++/incl/parallel/slock_asm.h.

At this path name, alter DYNIX /usr/include/parallel/parallel.h to
look like a C (not C++) header, avoiding redeclarations of entities
declared in ./C++/incl/parallel/parallel.h. I.e., delete the two typedefs.

	patch ./C++/incl/sys/dir.h with provided diff
	patch ./C++/incl/sys/signal.h with provided diff
	patch ./C++/incl/sys/time.h with provided diff
	patch ./C++/lib/stream/out.c.

DYNIX bsd sprintf() returns a char *.  System V sprintf() returns
an int.  We added a call to strlen() on the line that uses the
return value of sprintf().

	patch ./C++/src/cfront.h with provided diff
	patch ./C++/src/lex.c with provided diff
	patch ./C++/src/norm.c with provided diff
	patch ./C++/src/norm2.c with provided diff
	patch ./C++/src/print.c with provided diff
	patch ./C++/src/size.h with provided diff.

If you plan to work with doubles, you might want to redefine
DAL_DOUBLE.  Our Symmetry DYNIX compiler seems to align to multiples of
eight.

	patch ./C++/src/token.h with provided diff

Purify your command interpreter's environment

If you have any att universe C++ stuff around, keep
it out of the way.  If you have any other C++ headers around,
keep them out of the way.  You might want to use the ``I''
and ``LIBRARY'' environmental variables.  We add the root
of the C++ build tree to our path before building C++.

Make C++

	Make scratch.  Then make.

(end of hints.txt)
