![]() |
Building with the autotools | ![]() |
The traditional build, described for users in the file COMPILE, is
./configure make make install |
run from
src/
. When
configure.in
or one of the macros in
misc/m4/
has changed, configure must be regenerated first with autoreconf -fi (as in the Dockerfile). The build is done in the source tree: objects go to src/Objects/, dependency files to src/Deps/, and the binary to TeXmacs/bin/texmacs.bin.
configure.in
checks the compilers (preferring clang and clang++, with Objective-C for macOS), the sizes of the basic types and a few headers, and then calls one macro per subject. The options which matter most are:
(
guile.m4
) --with-guile=path gives the guile-config program to use; --with-guile=embedded18 uses the embedded Guile 1.8 in tm-guile188/, which is also chosen automatically when that directory exists. Without either, configure looks for guile18-config, guile1.8-config, guile16-config, …, guile-config and then guile20-config and similar names. Guile 2 and later are refused unless --enable-guile2 is given. The version determines the dialect macro GUILE_A to GUILE_D; when cross compiling, it must be given in the variable GUILE_VERSION.
(
tm_gui.m4
,
qt.m4
) --with-gui=port chooses the port, which defines one macro:
(the default) native Qt 5 or 6 widgets, QTTEXMACS. --enable-qt-new (the default on Android) compiles
Plugins/Qt6
instead of
Plugins/Qt
, and requires Qt 6.10 or later.
Qt as a platform layer with the Widkit widgets, QTWKTEXMACS together with QTTEXMACS.
The historical X11 port with Widkit, X11TEXMACS.
Widkit on SDL 3 (--with-sdl3), drawn with MuPDF, SDLTEXMACS.
SDL 3 windows and widgets drawn by Clay, VUETEXMACS; with --with-thorvg=dir the GPU renderer (OpenGL and ThorVG).
The native macOS port of
Plugins/NS
, AQUATEXMACS; it needs the macOS extensions.
SDL and Vue require MuPDF (--with-mupdf=dir,
mupdf.m4
); Qt uses it when it is found, X11 and Cocoa refuse it. --enable-qtpipes (on by default with Qt and Qtwk, refused with the other ports) replaces Unix pipes by Qt pipes. The Qt installation is found through qmake (variables QMAKE, QT_PATH, MOC, …). On macOS, the Objective-C code of
src/Plugins/MacOS
is added unless --disable-macosx-extensions is given.
--with-freetype, --with-iconv, --with-gnutls, --with-aspell, --with-cairo, --with-imlib2, --with-resvg, --with-sparkle (automatic updates on macOS and Windows, with --with-appcast), --with-axel, --disable-gs, --disable-pdf-renderer, and the SQLite check of
sql.m4
.
(
tm_debug.m4
,
tm_optimize.m4
) --enable-debug, --enable-assert, --enable-warnings, --enable-checks, --enable-profile, --enable-sanitizers, --enable-optimize, --disable-fastalloc (use the system allocator instead of the fast allocator for small objects, useful with memory checkers) and --enable-experimental (the style rewriting code in
src/Style/
).
--with-tmrepo=dir (
tm_repo.m4
) uses a TeXmacs SDK directory: its bin, include, lib and pkgconfig directories are put first in the search paths. It is also required for some packaging targets (see packages).
The platform macro (
tm_platform.m4
) chooses the operating system layer, the static or dynamic link mode (
tm_static.m4
) and the default packaging targets.
configure writes src/System/config.h (from
src/System/config.in
, as declared by AC_CONFIG_HEADERS) and the files listed in AC_CONFIG_FILES, among which:
Makefile, src/makefile and misc/admin/admin.makefile;
src/System/tm_configure.hpp (from
tm_configure.in
), with the version and the build description;
the scripts misc/scripts/texmacs and misc/scripts/fig2ps, the manual page misc/man/texmacs.1 and the Doxygen configuration;
the package descriptions: packages/redhat/TeXmacs.spec, the Debian control files, the macOS Info.plist and Xcode configuration, the Windows resource file and Inno Setup script, the MSIX manifests and the Android manifest;
the makefile of the example dynamic link plug-in
TeXmacs/examples/plugins/dynlink/
.
None of these generated files is under version control; only their templates (*.in) are.
The top level Makefile (from
Makefile.in
) has the following main targets:
(the default) Builds the embedded Guile if needed and then the binary through src/makefile.
A statically linked binary.
Regenerates the dependency files.
Regenerates the Scheme glue (src/Scheme/Glue/glue_*.cpp), see the Scheme glue. In src/makefile, a glue file also depends on its build-glue-*.scm declaration file, so the glue is regenerated automatically when the dependency files are up to date.
The binaries of the plug-ins in
plugins/
and of the example plug-ins.
Installation into the prefix: executables, data, plug-ins, icons, desktop files, include files and manual pages.
The default package and application bundle of the platform; see packages for the various platforms.
Remove the objects; distclean also removes the embedded Guile build, the makefiles, the configuration headers, the scripts and the manual page (but not the generated package descriptions in
packages/
).
The two build systems do not accept the same Guile versions: the autotools build refuses Guile 2 and later without --enable-guile2, whereas CMake with SCHEME_IMPL=system accepts Guile 3.0 silently.
An autotools build leaves src/System/config.h and tm_configure.hpp in the source tree, where they can shadow the headers of a later CMake build (see building with CMake).
The configuration is cached in config.status; after switching branches with different
configure.in
files, run autoreconf -fi and ./configure again rather than relying on config.status --recheck.