This document explains how to compile the Thot Editor environment (Thot Editor binary and Thot schemas compilers) from the distributed source tree and on one of the platforms . In the following we will use Target for the platform nickname (e.g. solaris2 for a Sun workstation running Solaris 2.5). Adding support to for a new achitecture is explained in the porting section.
Here is the content of this document:
The complete source tree must have been set-up accordingly to the source distribution installation instructions.
sed
,
awk
and cpp
should be available.
Here is a simple recipe explaining how to build on one of the supported target:
Thot
/Target directory.
Makefile.orig
file to Makefile
. Edit
the first top lines to change THOTDIR
to the base of the current
Thot Editor tree e.g:
THOTDIR=$(HOME)/Thot
libjpeg.a
, libpng.a
and libz.a
as well as the config.h
file describing the
Target. If these files are lacking, fetch the appropriate
thot-libs-Target-xxx.tar.gz distribution file and install it.
make
Take time for a comfortable coffee break (take 10 mn. on a 200 MHz Pentium-Pro).
This will build the thot libraries (libThotEditor.a, libThotKernel.a) and print binary.
This will create a subtree of Thot/Target, similar in it's
shape with the source one and populate it with the object resulting of the
make. The binaries and libraries produced are stored in the
Thot/
Target/bin
directory.
Thot/schemas
, type in make
,
this will compile the structure, presentation and translation schemas.
(compiled schemas are respectively suffixed by STR, PRS
and
TRA
)
hot/Target
directory and type in :
make thot
this wil build the editor libraries (libThotIndex.a, libThotTable.a, ) and thot binary.
If everything went well, the following files should be available in the
Thot/
Target/bin
directory:
One can test the resulting Thot Editor binary by starting
bin/thot
from the shell.
The Thot/makes
directory contains a few important files related
to Thot Editor compilation process:
Thot/
Target/Makefile
and is
also automatically generated. CommonMake includes
Make.depends.
Thot/
Target/bin/mkdep
used to generate the dependencies.
xxx_f.h
located in the
Thot/thotlib/internals/f
, Thot/batch/f
and
Thot/amaya/f
directories. We use a modified version of
cextract-1.7 to generate these headers from the function definition found in
the C files. If not present the
Thot/
Target/bin/cextract
binary is
built on the fly.
As explained above, the Makefile found in the Thot/Target
directory consists of a few options related to the corresponding platform and
include Thot/makes/CommonMake
containing all the make rules. Here
is a description of all the main make targets found in the
CommonMake and hence available when typing make from
Thot/Target directory:
Thot/
Target/bin
.
Here are the steps done when starting make
in the
Thot/
Target directory:
Makefile
,
../makes/CommonMake
, ../makes/Make.files
and
../makes/Make.depends
, if the latests are non-existent it tries
to rebuild them and stop.
Thot/
Target/bin
,
Thot/
Target/thotlib/base
, etc.
Thot/
Target/bin/libThotKernel.a
from subset of the Thot/thotdir
sources. This involve compiling
the C files, creating the archive with ar and running ranlib against the
archive.
Thot/
Target/bin/libThotEditor.a
from the Thot/thotdir
sources. This involve compiling the C
files, creating the archive with ar and running ranlib against the archive.
Next steps are related to the make thot
execution:
EDITOR.A
describing the generic
user interface of Thot Editor into the EDITOR.h
header, the EDITORAPP.c
code, the EDITORdialogue ressource file
and a prototype file EDITORactions.proto
for the interface
callbacks (the actual file used is EDITORactions.c
).
Thot/thot
directory
to objects.
Next section try to give some hint on debugging errors at compile-time.
Errors may append at diffferent stages in the compilation process. Here is a small checklist:
Thot/
Target directory doesn't work. This means
that the step 1 or 2 of the previous section failed.
Thot/
Target
directory ?
Thot/
Target/config.h
file present ? If not, fetch the the appropriate
amaya-libs-
target-xxx.tar.gz
distribution file and install it.
../makes/Make.files
and
../makes/Makes.depends
files present ? If not, make will try to
build them but with some versions of make this is not
possible. In this case, cd to ../makes
and type
make rebuild ; make depend
to rebuild both files. Go back in the Thot/Target directory and restart make.
Thot/
Target/Makefile
.
thot-developers@opera.inrialpes.fr
mailing-list. Please check first the archive, the
error may have been already reported.
On an unsupported platform see the document on porting to an new platform
ldd bin/app
#!/bin/sh exec `gcc --print-prog-name=cpp` $*
cd ../schemas
touch *.S
make
libjpeg.a
, libpng.a
and libz.a
for the Target. If these files are lacking, fetch the
appropriate
thot-libs-
target-xxx.tar.gz
distribution file and install it.
file libz.a
nm libz.a
should not print any errors
make libjpeg
make libpng
Compiling the graphic libraries should be quite straightforward.
Thot/
Target/Makefile
.
Thot/amaya/EDITOR.A
that the section USES does not refer to
Lookup. If needed, remove it, and restart
make amaya
This is related to the input of ISO-Latin-1 sequences in Motif dialog boxes.
thot-developers@opera.inrialpes.fr
mailing-list. Please check first the archive, the
error may have been already reported
Here is a few rules to check if the thot binary just produced does not start:
ldd bin/thot on Suns or Linux
chatr bin/thot on HP's
should print all the shared libraries needed by amaya and the path to the corresponding libraries in the system.
Thot/amaya/HTML.STR
, Thot/amaya/HTMLP.PRS
.
Thot/config/thot.ini
is present.
If everything seems Ok, one can debug the problem by using a system call tracer like truss on Solaris or strace on Linux. Check for syscalls errors near the end of the system trace dump.
All the remaining technics to find out what's wrong are software debugging
methods, for this of course one need to recompile the binary with debug option
enabled, and use a debugger program to see what's happening exactly. Once a
bug has been identified, please report it to the Thot Editor
development Team, by sending the error to the
thot-developers@opera.inrialpes.fr
mailing-list. Please check
first the archive, the
error may have been already reported. Of course, sending a contextual diff of
the modified files may help correcting the problem, and have it patched on
next release.