			INSTALLATION PROCEDURE
			----------------------



This system is currently available for the following architectures:

   - GNU/Linux / ix86
   - SunOS 4.1.3 / sparc
   - Solaris 2 / sparc



Installing the source distribution
**********************************

1) Introduction
---------------

The following tools are required to compile and install the source package:
   gcc, as, ranlib (if needed), sh, mkdir, cp, rm, sed, test,...

The installation process is as follows:

   % cd src					go to source directory
   % ./configure [OPTIONS]			configure the system
   % make					compile locally the package
   % make install or (make install-strip)	install the package

The whole package will be installed in the directory INSTALL_DIR which is
either:

   - PREFIX/gprolog-VERSION_NUMBER (this is the default)
	the default value of PREFIX is /usr/local but can be explicitely
        specified using the --prefix=PREFIX option

   - the source distribution directory (i.e. where reside this INSTALL file)
	this in-place installation can be specified using --prefix==in-place

The following sub-directories will be created under INSTALL_DIR:

   INSTALL_DIR/bin        all binaries (compiler, top-level,...)
   INSTALL_DIR/lib        all libraries and objects
   INSTALL_DIR/include    header files needed to write foreign C code
   INSTALL_DIR/doc        the documentation
   INSTALL_DIR/ExamplesPl some classical Prolog examples
   INSTALL_DIR/ExamplesFD some examples using FD constraint solving

The installation procedure can also create link to binaries of
INSTALL_DIR/bin. Those links will reside in the directory LINKS_DIR. The
default value for LINKS_DIR is EPREFIX/bin. The value of EPREFIX is the same
as PREFIX but can be explicitely specified using the --exec-prefix=EPREFIX
option. It is also possible to specify the full value of LINKS_DIR using
--with-links=LINKS_DIR option. Finally it is possible to prevent the
installation procedure from creating those links using the --without-links
option. This is the default when doing an in-place installation (see above).

The configure command displays the value of INSTALL_DIR and LINKS_DIR.

To summarize, by default the package is installed in /usr/local/gprolog-xxx
and linked files are installed in /usr/local/bin.


2) Configuration
----------------

GNU Prolog uses autoconf. To configure the package:

   % ./configure [OPTIONS]

This script attempts to guess correct values for various system-dependent
variables used during compilation. For more detail about autoconf refer to
src/AUTOCONF (try also './configure --help'). The GNU-Prolog specific options
are:

Options to control the installation directory:

   --prefix=PREFIX         configure for installation in PREFIX/gprolog-xxx
   --prefix=in-place       configure for installation in-place

   Default: --prefix=/usr/local

Options to control the links to binaries directory:

   --without-links         do not create link to binaries
   --with-links=LINKS_DIR  create links in LINKS_DIR
   --with-links            create links in EPREFIX/bin
   --exec-prefix=EPREFIX   set install prefix directory for the links

   Default: for an in-place installation: --without-links
            else: --with-links --exec-prefix=PREFIX

Options to control optimization C compiler flags:

   --without-c-flags       do not use any optimization flag
   --with-c-flags          use default C optimization flags
   --with-c-flags=CFLAGS   use CFLAGS (instead of default optimization flags)
   --with-c-flags=debug    use C debug flags '-g -Wall'

   Default: --with-c-flags

Options to control GNU feature to use/include:

   --disable-regs          do not use machine registers to optimize speed
   --disable-linedit       do not include line editor facility
   --disable-sockets       do not include sockets facility
   --disable-fd-solver     do not include the finite domain constraint solver

   Default: all features are included.


Some examples of using configure:

To configure the package for an installation in the default directory
/usr/local and links to binaries in /usr/local/bin:

   % ./configure

To configure the package for an installation in the home directory with
linked files in ~/bin/i386 use

   % ./configure --prefix=$HOME --with-links=$HOME/bin/i386

To configure the package for an in-place installation:

   % ./configure --prefix=in-place


3) Compiling the package locally
--------------------------------

To locally compile the package:

   % make


4) Installing the package
-------------------------

To install the package according to options given to ./configure (see 2):

   % make install

You can either install stripped versions of the binaries (whose size is then
reduced):

   % make install-strip

It is possible to re-run './configure' to change the value of some
installation directories (see 2) after the local compilation (i.e. the
compilation will not be done again).


5) Cleaning
-----------

To remove installed files (remove the content of INSTALL_DIR):

   % make uninstall

To clean up the local compilation (does not erase configuration files):

   % make clean

To fully clean up the local compilation:

   % make distclean


6) Rebuilding a source distribution
-----------------------------------

To rebuild a source distribution file:

   % make dist

this will create a file gprolog-xxx.tgz (in the src directory).



Setting up environment variables
********************************

To be able to execute GNU Prolog from anywhere the directory LINKS_DIR should
be a part of your PATH environment variable (generally this directory is
already in the PATH variable). However, if no links have been creeated
(either --without-links has been specified or in case of default in-place
installation) you should add the directory INSTALL_DIR/bin to your PATH
variable. This can be done as follows (let us suppose INSTALL_DIR is
/usr/local/gprolog-xxx):

under sh/bash:  PATH=$PATH:/usr/local/gprolog-xxx/bin; export PATH
under csh/tcsh: setenv PATH ${PATH}:/usr/local/gprolog-xxx/bin

GNU Prolog needs to know the value of INSTALL_DIR (to locate its
libraries). To do this, it uses its own path at execution-time, expanding
symbolic links. So you should not move or copy the executables, but you can
create links to them (as done by the installation procedure in LINKS_DIR).
However, to prevent this case, GNU Prolog first consults the value of the
PL_PATH environment variable. If it is defined GNU Prolog uses this path. If
you want to define it, simply set it to the value of INSTALL_DIR as follows:

under sh/bash:  PL_PATH=/usr/local/gprolog-xxx; export PL_PATH
under csh/tcsh:	setenv PL_PATH /usr/local/gprolog-xxx

To summarize, by default you can avoid to define PATH and PL_PATH. If you 
need to defines these variables it is a good idea to put them in your shell
start-up file ($HOME/.bashrc / .cshrc / .tcshrc depending on the used shell).



Problems
********

See file PROBLEMS for more information on architecture-dependent known
problems.

If your installation does not work (compilation is ok but when running the
system fails) you can try to recompile the whole system with --disable-regs
(after make distclean).

You can also send a mail to the author (Daniel.Diaz@inria.fr).

