INSTALLATION GUIDE
==================

The document is divided into four sections.  Section A
gives instructions for building ICP on homogeneous systems
(i.e. Sun-3 only or Sun-4 only).  Section B gives
instructions for building ICP for a mixed environment (both
Sun-3 and Sun-4) that uses NFS.  Section C details the
procedure for installing a minimal ICP run-time system on a
second machine once it has been compiled on a machine with
the same architecture.  Section D explains how to install
the mailbox port numbers into /etc/services.

----------------------------------------------------------------

A) Building ICP on a Homogenous System

This is the procedure for installing the IC-Prolog ][
system on Sun-3 or Sun-4 machines running SunOS 4.x.

STEP 1:
Before installing, please check the user configurable
section at the top of the `makefile', and configure the
variables if necessary.  Then issue the command

        make makefiles

STEP 2: (Optional)
If you have the makedepend program, you can enhance the
the makefiles you have just built by adding dependency
lists.  To do this, type

        make depend

STEP 3:
Now you are ready to build the system, issue the command

        make all

STEP 4: (Optional)
If you do not have the ready-made .dvi and .info*
documentation and on-line manual (check the doc/parlog
and doc/prolog directories), you will need to generate
them from the texinfo files.  For this, you will need the
texinfo package version 2.88 or later.  If you have an
earlier version, please copy texinfo.tex (version 2.88)
included in the doc directory to your local tex macros
directory before generating the documentation.  To generate
the documentation and on-line manual, type

        make doc

STEP 5:
The run-time system will be built initially in ./runtime.
To install IC-PROLOG ][ in the final destination, you will
need write permission for

        $INSTALLDIR
        $INFODIR   
        $BINDIR    

If you are satisfied with these values, now type

        make install

STEP 6:
Now see section D for instructions on how to install the
mailbox port numbers into /etc/services.


NOTES :
Do not use the -k option of make unless you are sure
all the values for the variables are valid.

Do not edit the Makefiles in the subdirectories.  To make
changes, modify top level makefile and then reissue

        make makefiles

If more changes are required and you feel confident about
what you are doing, try modifying install/Makefile.sed,
install/Makefile.subdir and the Makefile.m4 files in
subdirectories.

Hardcopies of the manuals may be printed from the dvi
files in doc/*.

----------------------------------------------------------------

B) Building ICP in a Mixed Environment

The run time system of ICP can be shared by Sun-3 and
Sun-4 machines using NFS.  To do this, you need to first
build the architecture-specific executables/object files
for the Sun-3, and then do a full install for the Sun-4.
The steps are :

STEP 1:
On a Sun-3, check the user configurable section at the
top of the `makefile', and make any changes if necessary.
Then issue the command

        make makefiles

STEP 2:
Build the Sun-3 executables by typing

	make sun3

You will need write permission for BINDIR for this to
succeed.

STEP 3:
Login to a Sun-4 and WITHOUT changing the INSTALLDIR make
variable repeat the whole installation process as if
installing a system from scratch (i.e. go through all the
steps 1 to 5 in section A).

----------------------------------------------------------------

C) Installing a Run-Time System Only

Once ICP has been successfully compiled and installed, a
minimal system can be copied to another computer of the
same architecture and installed there without recompiling.
This is achieved by copying the ./runtime directory only.
For example, in the top level directory make a tar file
of the run time system :

	tar cvf ICPruntime.tar runtime

The file `ICPruntime.tar' can then be copied to another
machine and unpacked as follows,

	tar xvfpB ICPruntime.tar

This re-creates the runtime directory.  In this directory,
there is a Makefile.  The first three lines look like this :

    INSTALLDIR = <path1>
        BINDIR = <path2>
       INFODIR = <path3>

Configure these three paths for the new machine and type

	make install

to install ICP on this second machine.

Note that this only includes the on-line manual in the
form of an info file.  The hardcopy manual and the
example programs should be copied separately if required.

----------------------------------------------------------------

D) Adding mailbox ports to /etc/services

THE FOLLOWING  CAN ONLY BE DONE BY YOUR SYSTEM ADMINISTRATOR OR
SOMEONE WITH SUPERUSER PRIVILEGES.

To use the mailbox features of ICP, well-known port numbers
must be registered in /etc/services.  The file install/icp-services
should be appended to the end of /etc/services after checking
that the port numbers are not used by any other program.

A perl script is provided which performs the above task.  If
you have perl, you can run the script by typing

	make services

in the top level directory.  If you do not have perl, you will
need to add the lines to /etc/services manually.

If you are using NIS, the change to /etc/services should be made
on the NIS master server and propagated to the NIS clients.
