GNU TeXmacsUser manualReferenceAboutEnglish
Building TeXmacs and running the tests

1.Introduction

This chapter explains how a TeXmacs binary is produced from the sources, which files are generated along the way, how distribution packages are made for the various platforms, and which automatic tests exist. It is meant for developers who want to build TeXmacs themselves, add a source file or a dependency, or check that a change does not break anything.

The general organization of the source tree is described in general architecture of TeXmacs; what the resulting program does when it starts, and its command line options, are described in the main program and crash handling. The generation of the Scheme glue is explained in detail in the Scheme glue.

All file names in this chapter are relative to the directory

src/

of the repository (the one which contains

configure.in

and

CMakeLists.txt

), unless stated otherwise.

2.Overview

There are two independent build systems, which compile the same sources:

GNU autotools

The traditional build: configure (generated from

configure.in

and the macros in

misc/m4/

) produces Makefile, src/makefile and the configuration headers, and make builds the binary. This build also knows how to make the distribution packages (make PACKAGE, make BUNDLE) and how to regenerate the glue (make GLUE).

CMake

The newer build (

CMakeLists.txt

,

src/CMakeLists.txt

and

cmake/

), which is convenient with Ninja, with IDEs and for the C++ unit tests. It only builds and installs the program; packaging is left to the autotools build and to the scripts in

packages/

.

Both builds produce the same layout: the runtime tree

TeXmacs/

(style files, Scheme programs, fonts, documentation, …) with the binary TeXmacs/bin/texmacs.bin inside it, and a small shell script texmacs (from

misc/scripts/texmacs.in

) which sets TEXMACS_PATH and the library path before starting the binary. A freshly built tree can therefore be run without installing it, by pointing TEXMACS_PATH to the

TeXmacs/

directory.

The Scheme interpreter is Guile. By default both builds use an embedded Guile 1.8, whose sources are expected in the directory src/tm-guile188/; they are not part of the TeXmacs sources but of the separate repository guile-texmacs (see Dockerfile, which copies it to that place). Alternatively, a system Guile can be used.

The tests come in three kinds: C++ unit tests in

tests/

(built with CMake and QtTest), Scheme regression tests (*-test.scm files run by run-all-tests), and document test suites which convert directories of documents and compare the results with a reference run.

3.Source files

configure.in
, misc/m4/*.m4

The autoconf input: one macro file per dependency or feature (

guile.m4

,

qt.m4

,

freetype.m4

,

tm_gui.m4

,

tm_platform.m4

,

tm_debug.m4

, …).

Makefile.in
,
src/makefile.in

The top level makefile (installation, plug-ins, packages) and the makefile which compiles the sources and the glue.

CMakeLists.txt
,
src/CMakeLists.txt

The CMake build: options, dependencies, source lists, configuration headers, and the executable targets per platform.

cmake/

Find modules (

FindCairo.cmake

,

FindGMP.cmake

,

FindSQLite3.cmake

, …) and a few helper scripts.

src/System/config.in
,
config.h.cmake
,
tm_configure.in
,
tm_configure.hpp.cmake

Templates of the two generated configuration headers.

src/Scheme/Glue/

The glue declarations and the glue generator.

packages/

Platform packaging:

macos/

, windows/,

msix/

,

debian/

,

redhat/

,

fedora/

,

centos/

,

mandriva/

,

appimage/

, android/,

linux/

,

haiku/

.

Dockerfile

A container build on Ubuntu with the embedded Guile, mainly used for running a TeXmacs server.

tests/

The C++ unit tests.

TeXmacs/progs/check/check-master.scm
,
TeXmacs/progs/kernel/boot/debug.scm
,
TeXmacs/progs/utils/test/

The Scheme regression tests and their macros, and the document test suites.

4.Contents of this chapter

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".