Build from source
These are instructions on how to build emacs-ng.
You will need Rust installed.
rust-toolchain indicates the version that gets installed. This
happens automatically, so don't override the toolchain manually. IMPORTANT:
Whenever the toolchain updates, you have to reinstall rustfmt manually.
You will need a C compiler and toolchain. On Linux, you can do something like:
apt install build-essential automake clang libclang-dev
apt install texinfo libjpeg-dev libtiff-dev \ libgif-dev libxpm-dev libgtk-3-dev gnutls-dev \ libncurses5-dev libxml2-dev libxt-dev
For native-comp you will also need
On MacOS, you will need Xcode.
brew install gnutls texinfo autoconf
To use the installed version of
makeinfo instead of the built-in
/usr/bin/makeinfo) one, you'll need to make sure
Mojave install libxml2 headers with:
If you want to use native-comp, you will need to compile with
--with-native-compilation. nativecomp will also require:
brew install zlib libgccjit
It seems to be more difficult to build native-comp on macOS than on Linux. There are several tutorials that provide instructions on how to successfully compile it (no guarantee that they work):
Compile and install#
$ ./autogen.sh $ ./configure --enable-rust-debug $ make -j$(nproc) # proc for number of processors (cores)
For a release build, don't pass
The Makefile obeys cargo's RUSTFLAGS variable and additional options can be passed to cargo with CARGO_FLAGS.
$ make CARGO_FLAGS="-vv" RUSTFLAGS="-Zunstable-options --cfg MARKER_DEBUG"
If you want to install it, just use
You may need to run
sudo make install depending on your system configuration.
Now emacs should be available at
./src/emacs. We can launch the application
./src/emacs. We can navigate to the lisp scratchpad by pressing C-x b and