W3CAmaya Using

Compiling Amaya Sources (old version)

The best way now to compile Amaya from sources is to use autoconf. Here are the information concerning the old build process which may be useful if autoconf make failed or if one already use the old building process.

This document explains how to compile the Amaya environment (Amaya 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 amaya binary doesn't work
  7. If everything suceeded

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 Amaya binary by starting bin/amaya from the shell.

More on the make files:

The Thot/makes directory contains a few important files related to Amaya 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 using

Next steps are related to the make amaya execution:

  1. the make process start str compiler on the Thot/amaya/HTML.S describing the structure schema of an HTML document. This produce the Thot/amaya/HTML.STR file.
  2. then the prs compiler is called to compile the four presentation schema for displaying HTML document in color displays, for printing, for printing on US Letter paper format and for black-and-white displays. This produces .PRS files from the HTMLP.P presentation schema.
  3. the tra compiler is used to compile Thot/amaya/HTMLT.T to HTMLT.TRA . This direct the generation of an HTML file from the Thot internal represenation of the document.
  4. the app compiler compiles the HTML.A describing the HTML specific user interface of Amaya into the HTML.h header, the HTMLAPP.c code and a prototype file HTMLactions.proto for the interface callbacks (the actual file used is HTMLactions.c).
  5. the app compiler compiles the EDITOR.A describing the generic user interface of Amaya 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).
  6. then make compiles the C files from the Thot/amaya directory to objects.
  7. Lastly make links amaya object files, with the libThotEditor.a , the graphic libraries, the WWW library, Motif, Intrinsics, X-Windows and math to produce the Amaya 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 amaya binary doesn't work:

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

  1. Check that the shared libraries needed by amaya are found on the system. The command

    ldd bin/amaya on Suns or Linux

    chatr bin/amaya on HP's

    should print all the shared libraries needed by amaya and the path to the corresponding libraries in the system.

  2. Check that the amaya compiled shemas are present, namely Thot/amaya/HTML.STR, Thot/amaya/HTMLP.PRS.
  3. 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 Amaya development Team, by sending the error to the www-amaya@w3.org 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.

If everything succeeded

You might want to try to build the Amaya with Java version. In these case follow the specific instructions for compiling Amaya with Java.


Daniel Veillard
Webmaster
$Date: 1997/10/20 19:20:19 $