Home News Notes Projects Themes About

Compiling Emacs

A little personal reminder on how I usually compile Emacs… After cloning and cd'ing in the source directory:

./autogen.sh

Then:

./configure \
    --without-compress-install \
    --with-native-compilation=aot \
    --with-json \
    --with-mailutils \
    --with-tree-sitter \
    --with-gif \
    --with-png \
    --with-jpeg \
    --with-rsvg \
    --with-tiff \
    --with-imagemagick

Some of these flags are a bit arbitrary: this is a starting point, and I should look into this. Actually, starting from Emacs 30, we can read this in etc/NEWS:

Native JSON support is now always available; libjansson is no longer used. No external library is required. The '–with-json' configure option has been removed. 'json-available-p' now always returns non-nil and is only kept for compatibility.

So with this version of Emacs, the command becomes:

./configure \
    --without-compress-install \
    --with-native-compilation=aot \
    --with-mailutils \
    --with-tree-sitter \
    --with-gif \
    --with-png \
    --with-jpeg \
    --with-rsvg \
    --with-tiff \
    --with-imagemagick

Let's then build Emacs:

make -j $(nproc)

…and that's it! Of course many packages will probably miss, but I'll add them on this page the next time I compile Emacs from a fresh system.

I usually create a symbolic link in a directory on my path:

ln -s ~/src/emacs/src/emacs emacs