\def\bsd{{\csc BSD}}

Before \ctex\ can be installed, it must be configured and compiled.  As
much of the configuration task as possible is deferred until after
installation, but there is a bootstrap problem here:  The runtime
system must be configured to know where the runtime configuration is
to be found.  In addition, some of the library routines are necessarily
system dependent.  Clearly, the need for device drivers depends upon
your devices.  All of these should be properly configured in advance,
though changing the configuration later is easy.

All of the compile time configuration is intended to be performed by
the makefiles.  If you run a Unix machine, or even if this is the first
and last time you will ever set up Unix software, you should be
intimiately familiar with `make'.  Once you have read the supplementary
documentation on make, you are ready to peek at the Makefile in the
{\tt lib} directory.  This is the most system-dependent one, so we
shall tackle it first.

Scary, is it not?  Well, whether or no, some explanation is in order.
This Makefile has the same four standard targets as every other
Makefile in the \ctex\ system:  `all', `install', `clean', and
`depend'.  `All' puts the subsystem into shape for installation.
`Install' copies the subsystem to its ultimate resting place.  `Clean'
removes anything that is not needed to remake the subsystem.  And
`depend'?  This is the strangest one of all, and no doubt the scariest;
alas, it is also one you may need to adjust.  It uses a feature of the
4.3\bsd\ compiler, the {\tt -M} flag, to get a list of
dependencies, and inserts this list into the Makefile.  Between the
line marked `{\tt DO NOT DELETE THIS LINE}' and the end of the Makefile
you will find a full (and I do mean {\it full}) list of dependencies.
This list includes some of the standard system {\tt include} files,
such as {\tt /usr/include/machine/machparam.h}.  It may well be that
your system does not {\it have} some of these files.  This is not a
problem; {\tt seek.c} should still compile and run.  What {\it is} a
problem is that `make' will believe it needs this file, even though (on
your machine) it does not.

If you are lucky enough to be using a 4.3\bsd\ compiler or one with the
{\tt -M} flag, you can simply run `{\tt make depend}'.  If you are on a
4.2\bsd\ system, the dependency lists are probably already correct and
can be left alone.  If neither of these happy circumstances hold, a
sure-fire fix is simply to remove the {\tt /usr/include} dependencies
from the Makefile.  Another option is to try, in place of the {\tt cc
-M} command, the `{\tt getdep}' shell script provided in the `{\tt
misc}' directory.

The {\tt lib} directory Makefile exemplifies several more standard
entries.  {\tt DESTDIR} controls the top level directory for
installation.  Normally this is the null string: that is, files are
installed in normal binary or manual directories.  Setting it to (e.g.)
`{\tt /nbsd}' would install everything in {\tt /nbsd/usr/}\dots.  Two
entries {\it not} in this Makefile are {\tt BINDIR} and {\tt MANDIR},
which set the directories for executable programs (binaries) and for
manuals.  These default to {\tt /usr/local/bin} and {\tt /usr/man}.
System V sites (if any run \TeX) may need to tailor the manual
installation commands to conform to System V standards.

This pretty well covers the standard Makefile entries.  The {\tt lib}
Makefile, however, is full of non-standard entries as well.  Because it
attempts to hide system dependencies from the rest of the \ctex\ code,
it is itself necessarily system dependent.  There are two assembly
language files for 4.1BSD, and one `miscellaneous' file for 4.2BSD
Vaxen and Pyramids.  The former are listed in the {\tt ASSRC} and {\tt
ASOBJ} macros, and the latter are listed in the {\tt MISCC} and {\tt
MISCO} macros.  These must be adjusted to match your system.  If you
are running some other system, you may need to write your own {\it bcopy} and
{\it bzero} routines, starting with the C versions in the {\tt misc} directory.
On System V machines, {\it memcpy} and {\it memset} may be used instead.

BEGIN TRASH


When you have the makefiles correct, run `make conf' to configure
for the Imagen and/or Versatec.  Then type `make' to compile
everything.  If all is successful, type `make install' to install
everything.

Versatec stuff:
-------- -----

The Versatec driver has page accounting built in.  If compiled with
ACCOUNT_FILE defined, it will write (to ACCOUNT_FILE) a line of
the form

	tex <username> <number of pages used>

The account file can be defined in either dev/Makefile or h/verser.h.

There is also a definition for the device name `/dev/vp0' in
h/verser.h, although a redefinition in dev/Makefile will override
it; alternatively, if your spooling program opens the Versatec
itself, use the `-v' argument to verser2.  `-v 1' implies that
the Versatec is already open as standard output, for example.

The Imagen driver ought to work for all of the Imagen printers,
though all I've tested is the 8/300.  The `iptex' shell script will
have to be adjusted for the 10/240, which needs nonzero default
margins.
