$ sudo apt update
$ sudo apt install build-essential libgtk-3-dev libgnutls28-dev \
libtiff5-dev libgif-dev libjpeg-dev libpng-dev libxpm-dev \
libncurses-dev texinfo \
libxml2-dev \
libjansson4 libjansson-dev \
libgccjit0 libgccjit-11-dev gcc-11 g++-11
$ sudo apt update
$ git clone git://git.sv.gnu.org/emacs.git
$ cd emacs
$ ./autogen.sh
To use native Elisp compilation we will use gcc-11 so before starting the build run:
$ export CC=$(which gcc-11) CXX=$(which gcc-11)
$ ./configure \
--with-native-compilation \
--with-json \
--with-xml2 \
--with-x-toolkit=no \
--with-xpm=no \
--with-jpeg=no \
--with-png=no \
--with-gif=no \
--with-tiff=no
$ make