Building Emacs for Mac OS X

2 minute read

On December 23rd Stefan Monnier announced that the trunk, on which GNU Emacs is developed, has been frozen. This means that no new features will be added until work on version 24.4 has been completed.

This of course caused a post on what is new in GNU Emacs 24.4. This is a very long list of changes that impact the user in some manner.

Personally I try to keep up with the development by building a version of GNU Emacs regularly. I thought I would share my proces with the world as other Mac OS X users might want to try this as well. If you would just like to try one of the newest versions without building it yourself, please take a look at Emacs for Mac OS X for prebuilt versions. If you would like to try and build it yourself, please continue on reading.

Firstly, you will need some build tools to do this. The easiest way to do this is to grab a copy of XCode from the Appstore. In previous versions XCode would also include the command line tools needed to build GNU Emacs. Sadly this is no longer the case, but luckily it is quite easy to get them. Open the Terminal application and issue the following command:

$ xcode-select --install

This will generate a popup asking if you want to install the command line tools, of course you do....

Next thing to achieve is that you will want several other tools that used to be included in the command line tools, namely automake and autoconf. The easiest way to get them is to use a second tool called Homebrew. Or you can just execute the following statement in the Terminal that you still have open:

$ ruby -e "$(curl -fsSL"

After installation is complete and you followed the instructions given by the installer we can go ahead and install the needed tools.

$ # Previously part of the command line tools
$ brew install autoconf
$ brew install automake
$ brew install libtool
$ # Needed to build GNU Emacs
$ brew install bzr
$ brew install xz

Next we will get the build script I use for building GNU Emacs. This script was made by the wonderful David Caldwell.

$ git clone

You can now execute the following commands to start the build process. The build-emacs script takes care of all the steps necessary to build GNU Emacs for Mac OS X.

$ ./build-emacs bzr

In the end you will be left with a DMG file in the emacs-builds directory.

Tags: ,