Opé Thot Editor Using

Compiling Thot Editor Sources

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:

  1. prerequisite
  2. How to build
  3. More info on the make files
  4. More info on the build process
  5. If make failed
  6. If thot binary doesn't work

Prerequisite:

The complete source tree must have been set-up accordingly to the source distribution installation instructions.

How to build, short version:

Here is a simple recipe explaining how to build on one of the supported target:

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.

More on the make files:

The Thot/makes directory contains a few important files related to Thot Editor compilation process:

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:

More info on the build process

Here are the steps done when starting make in the Thot/Target directory:

  1. make fetch the current Makefile, ../makes/CommonMake, ../makes/Make.files and ../makes/Make.depends, if the latests are non-existent it tries to rebuild them and stop.
  2. if needed make build all the directories needed to receive the objects files and the results from the compilation, for example Thot/Target/bin , Thot/Target/thotlib/base, etc.
  3. make build 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.
  4. make create the compilers associated to the Thot library using the libThotKernel.a
    1. grm
    2. str
    3. prs
    4. tra
    5. app
    6. rescandialogue
  5. make build 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.
  6. make build print.

Next steps are related to the make thot execution:

  1. the app compiler compiles the 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).
  2. then make compiles the C files from the Thot/thot directory to objects.
  3. Lastly make links thot object files, with the libThotEditor.a , the graphic libraries, the three editing libraries, Motif, Intrinsics, X-Windows and math to produce the Thot Editor binary.

Next section try to give some hint on debugging errors at compile-time.

If make failed:

Errors may append at diffferent stages in the compilation process. Here is a small checklist:

If thot binary doesn't work:

Here is a few rules to check if the thot binary just produced does not start:

  1. Check your DISPLAY environment variable is correctly set.
  2. Check that the shared libraries needed by amaya are found on the system. The command

    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.

  3. Check that the amaya compiled shemas are present, namely Thot/amaya/HTML.STR, Thot/amaya/HTMLP.PRS.
  4. Verify that the main registry file 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.


Daniel Veillard
Webmaster
$Date: 1997/02/0201:01:51$