KLIEG Version 3.2 Installation Guide
Copyright (C) 1999  Buntarou Shizuki (shizuki@is.titech.ac.jp)		  
		    Masashi Toyoda (toyoda@is.titech.ac.jp)

1. Software Packages Required to Compile KLIEG

Before building KLIEG, make sure that you have already installed
the following softwares on your system:

	klic: a KL1 compiler
	Amulet: a user interface development environment for C++

If you fail to compile some C++ sources and header files which
automatically generated by those utilities, you may have to
install Rie (a compiler compiler based on ECLR-attributed
grammar) to generate those files properly to your system.

Klic, Rie and Amulet can be obtained from:

klic 2.002	ftp://ftp.icot.or.jp/ifs/symbolic-proc/unix/klic/klic.tgz
Rie 1.0.6	ftp://ftp.is.titech.ac.jp/pub/Rie/rie-1.0.6.tar.gz
Amulet 2.0	http://www.cs.cmu.edu/afs/cs/project/amulet/amulet2/amulet.tar.Z

2. System Requirement

OS:
	SUN Sparc Station Solaris 2.5 or greater (tested on Solaris 2.5.1)
	Linux 2.0 or greater (tested on Debign GNU/Linux 2.0)
compiler:
	gcc 2.7.2.3 or greater
		(tested on gcc 2.7.2.3, failed to compile with gcc 2.8)
	libg++ 2.7.2 or greater (tested on libg++ 2.7.2)
	flex 2.5.3 or greater (tested on flex 2.5.4a)

3. Installation

3.1 klic and Amulet

Follow the instruction provided by each software.  We recommend
to apply a patch file to Amulet 2.0 to prevent KLIEG tracer from
failing due to bug of Amulet 2.0.  The patch file
(Patch-for-Amulet.patch) attached to this KLIEG distribution
will fix it.  The patch can be applied as follows:

	cd AMULET_DIR
	patch -p < Patch-for-Amulet.patch

	(AMULET_DIR is a directory of Amulet package)

For Linux users: Installation of Amulet 2.0 under Linux box can
be done as follows:

	*Expand the archive of Amulet distribution as /usr/local/lib/amulet-2.0
	cd /usr/local/lib/amulet-2.0
	*Apply Patch-for-Amulet.patch)
	cd /usr/local/lib/amulet-2.0/bin
	ln -s ../contrib/Makefile.vars.gcc.linux-ELF .
	setenv AMULET_DIR /usr/local/lib/amulet-2.0
	setenv AMULET_VARS_FILE Makefile.vars.gcc.linux-ELF
	make

3.2 Rie (optional)

Usually, you have no need to install Rie because we have
attached those files which are generated by Rie in this
distribution.  But if you fail to compile those files
(kl.tab.cc, kl.tab.h under `tracer' directory) on your
environment, you may need to install Rie.  After you install
Rie, you should do the following:

>make realclean

And redo installation process from the beginning.

3.3. KLIEG

First, set value of HOST_FILE variable in Makefile under top
directory of the KLIEG distribution.  This value chooses a
proper configuration file that sets variables of Makefile.  You
have to set the value depending on your UNIX Operating System.
For Solaris 2.5 or higher:

	HOST_FILE = Config.solaris

For Linux 2.0 or higher:

	HOST_FILE = Config.linux

Next, set values of KLIEG_DIR and KLIC_PATH in Config.solaris or
Config.linux suitable for your system. Then type:

>make
>make install

You should define KLIEG_DIR as the directory where KLIEG
binaries and libraries should be installed.  KLIC_PATH is the
path name of klic compiler `klic' which is invoked by KLIEG
tracer.  Default values of these variables are:

	KLIEG_DIR = /usr/local/lib/klieg
	KLIC_PATH = /usr/local/bin/klic

It may be convenient for you to make symbolic links from
/usr/local/bin to the binaries installed under KLIEG_DIR/bin.

Note: We have failed to compile tracer-types.cc (which resides
under tracer directory) using gcc with -02 option. You shuold
carefully use command line options of gcc for optimization.

4. Invoking KLIEG

4.1. Set up Environment

Set environment variable KLIEG_WORK_DIR as the name of the
directory where you want to put several temporary files
generated by compilation of KLIEG programs.  Default is
".klieg-work".  The directory will be automatically created by
KLIEG editor and KLIEG tracer and used as KLIEG_WORK_DIR.

You must create your own KLIEG working directory before you
start a KLIEG session for the first time.  Next, you should copy
a library of modules, which is attached to KLIEG distribution
package, to the KLIEG working directory.  The module files are
stored under KLIEG_DIR/modules\footnote directory:

>mkdir klieg
>cd klieg
>cp KLIEG_DIR/modules/* .

4.2 Invoke

To invoke KLIEG, cd to working directory for KLIEG and then
type:

>cd kileg 		(unnecessary if you are in this directory)
>KLIEG_DIR)bin/klieg
