Skip to content

Instantly share code, notes, and snippets.

@Yousuf28
Forked from lopesivan/build_emacs-nox.md
Created December 27, 2023 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yousuf28/7ed3bf9c434e8dd3fb78b48ec482bc06 to your computer and use it in GitHub Desktop.
Save Yousuf28/7ed3bf9c434e8dd3fb78b48ec482bc06 to your computer and use it in GitHub Desktop.
Build emacs

Build emacs

A one-liner to install all dependencies is:

$ 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

Download source

$ 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment