Building Emacs from Source on Yosemite

I just did a clean install of Yosemite. While reviewing my previous posts on getting up and running, I noticed some errors/missing information while following my own directions. I’ve edited those posts for clarity/omissions; however, my previous method of installing emacs via homebrew has been superceded by building it from source. This post details the steps to do so. It takes a bit longer, but allows me to keep up with current development. Caveat: following the master git repo of any software can potentially lead to a unstable/unusable build.

Also, rather than try to install every possible thing to cover every possible use case, I’ve moved to installing things as necessary. I’m a newbie to emacs, so my previous homebrew install of the Cocoa app included just about every possible configuration option; this one is much more minimal.

1. Prequisites:

-imagemagick (allows image viewing)
-gnutls (allows communication via SSL, TLS, amd DTLS)

Git, imagemagick and gnutls can all be installed via homebrew. The last 2 no longer come bundled with Xcode so must be manually installed. This can be done either through brew install autoconf and brew install automake, or by compiling from source:

cd /tmp
curl -O
tar xf autoconf-latest.tar.gz
cd autoconf-*/
sudo make install

cd /tmp
curl -O
tar xf automake-1.14.tar.gz
cd automake-1.14
sudo make install

2. get the source:
git clone git://
cd emacs

3. build
make configure
./configure –with-ns CFLAGS=”-I /usr/local/include/libxml2″

(As of 22 June 2015, –with-ns is no longer necessary)

./configure CFLAGS="-I /usr/local/include/libxml2"
make install

open -R nextstep/

Drag this to Applications to find in Launchpad.

updating and rebuilding:
# discard stuff from last build
git reset --hard

# delete all of the last build stuff
git clean -xdf

git pull
Delete the app from Applications, then follow steps from #3.

Building Emacs 24.4 from Source on the Mac, Spike Ilacqua.
Build Emacs for OSX, Sebastien Gross.
Building Emacs from Git Repository, Xah Lee.
Configure with libxml2, by Irreal.

comment by Offby1, referencing:
commit d97fbcbedce8f36050af7a55d34c6ed50c99507c
Author: Glenn Morris <>
Date: 2015-06-22 22:03:33 -0400
* (--with-ns): Enable by default on OS X.

This entry was posted in emacs, local.config. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *