Skip to content

Instantly share code, notes, and snippets.

@zentrope zentrope/
Last active Jun 10, 2018

What would you like to do?
Build emacs on macOS

Build emacs on macOS

Build from scratch because most of the packages you use have updated to the nearly-completed next version, so why not pull that?

An alternative is to use home brew HEAD, but this is more fun.


Probably should have Xcode installed, but at least try:

$ xcode-select --install

to get the command line tools. Homebrew will probably insist on this, too. If you see a libxml2 error, this might be way.

Get the Source

Check out the official repo:

$ git clone git://

If you want a branch:

$ git checkout emacs-26

Homebrew for prerequisites

Install this stuff via Homebrew:

$ brew install make automake texinfo gnutls libxml2 imagemagick

Initial make

Add to your path before building:

$ export PATH=/usr/local/opt/texinfo/bin:$PATH

Fish shell version:

$ set -gx PATH /usr/local/opt/texinfo/bin $PATH


$ make configure
$ ./configure --build=x86_64-apple-darwin --without-dbus --with-ns CFLAGS="-I /usr/local/Cellar/libxml2/2.9.7/include/libxml2"
$ gmake install
$ cp -r nextstep/ /Applications

Note the CFLAGS thing above.

gmake is the homebrew installed version of make. Regular make works, too.

Also note, that you probably don't need the -- flags in ./configure. I think they're the defaults.


Fails due to missing LIBXML include

Make sure the include path is viable in the above ./configure command. For instance, after a Homebrew update.

Daily Fetch


$ git fetch
$ git log HEAD..FETCH_HEAD --pretty=format:"%C(auto)%h %C(auto)%d %s (%C(cyan)%aE)" --graph
$ git merge
$ gmake install
$ cp -r nextstep/ /Applications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.