This pages describes how to get TOM running on a system using Tesla as the TOM compiler. If you already have a working
TOM environment but want to switch to Tesla as the compiler, remove all
things TOM before proceeding.
All links on this page that point to software point to stable snapshots
of the source code; you can get the same functionality by using them from
the TOM CVS repository.
Dependencies
Before attempting to create a Tesla-based system, get rid of any and
all remains of an old (tomc-based) TOM installation or make sure
they are fully inaccessible. This means you must remove:
- TOM libraries in
$old_tom_prefix/lib (including
libtom , libtrt , libtoo ,
libC , and possibly libmu and
libgps ),
- TOM include files in
$prefix/include/tom ,
- TOM library units in
$old_tom_prefix/lib/tom ,
- the old TOM tools (tomc, tomr, and gi) in
$old_tom_prefix/bin , and
- the TOM makefiles in
$old_tom_prefix/lib/tom/makefiles .
If you are using the Debian TOM packages, TOM can be removed by the command
# dpkg -r tom libtom2 libtom2-dev
To build Tesla, you need the following:
- GNU make
- depending on your target you may need GNU CC (gcc or egcs) to build
the TOM run time library
- from the TOM CVS repository,
check out the following modules (or fetch the stable snapshots, but those are less
bleedin' edge than the sources in CVS):
- tom
- containing the TOM standard libraries,
- tom-makefiles
- containing the TOM makefiles (mark II),
- and, finally, the Tesla bootstrap, containing all necessary C code to build Tesla
for a 32-bit machine.
Build
In what follows, /my/dir/bootstrap is the path where the
Tesla bootstrap sources have been extracted and /my/dir/tom
is the path to the TOM library sources. Furthermore, in the prompt of
the example commands it is visible in which of the packages a subsequent
command is executed. A prompt that includes a hash (`#') indicates that
more than the usual privileges may be necessary. Output of the commands
is not shown.
- Configure and install the
tom-makefiles :
tom-makefiles$ ./configure --prefix=/PREFIX
tom-makefiles# make install
- Configure
tom :
tom$ ./configure --prefix=/PREFIX
- Compile the TOM Run Time library, directing the C compiler to the
bootstrap code, creating only the static library.
tom$ cd trt
tom$ make CFLAGS=-I/my/dir/bootstrap libtrt.a
- Configure the Tesla bootstrap sources. (In this example,
TOM_ROOT=/my/dir/tom is Shell syntax to set the environment
variable TOM_ROOT . Use setenv when you are
using csh.)
bootstrap$ TOM_ROOT=/my/dir/tom ./configure --prefix=/PREFIX
- Compile Tesla bootstrap.
bootstrap$ make
- Install the Tesla bootstrap.
bootstrap# make install
This installs the programs tesla (compiler), tug
(unit file generator), and tig (interface generator).
The net result of all these steps is an installed TOM tool chain and
makefiles. The tools are linked to static TOM libraries. To create a
fully working environment, you need to compile and install the following
TOM packages:
_builtin_
- This library defines the builtin types. It currently is part of the
bootstrap package, but its use will probably vanish in the future. For
now, just install it.
bootstrap$ cd _builtin_
bootstrap# make install
- tom
- the TOM standard libraries, which you have already configured.
tom$ make
tom# make install
This phase is the first time the bootstrapped tools are invoked. Since
the bootstrap C code was created on a different machine, with a different
configuration --prefix, it is quite likely that your --prefix differs.
This will result in messages like:
unable to locate resource `map' of encoding `iso-8859-1'
can't find encoding named `iso-8859-1'
These messages are generated by the TOM library and will be generated by
every TOM program. To solve the problem, and make the TOM library find
its resources, you can pass the following library option to every
TOM program:
:rt-resource-dir /PREFIX/lib/tom/charmaps
- gp
- the TOM parser generator and skeleton library
gp$ ./configure --prefix=/PREFIX
gp$ make
gp# make install
- mu
- the TOM meta unit of TOM parsers
mu$ ./configure --prefix=/PREFIX
mu$ make
mu# make install
- tesla
- the TOM compiler. You have already built this in the bootstrap, but
it should be rebuilt since the one resulting from the bootstrap is
statically linked to the mu library and the gp skeleton library. In
addition, the bootstrap libraries lag in bug fixes, as the bootstrap need
only be good enough to bootstrap Tesla.
tesla$ ./configure --prefix=/PREFIX
tesla$ make
tesla# make install
This page last modified: $Id: install.shtml,v 1.16 2000/05/07 19:37:24 tiggr Exp $
|