DEV Community


Building emacs from source on macOS

brandelune profile image Jean-Christophe Helary ・1 min read

Caveat: I am on the latest Mojave version with Xcode and the command line utilities installed and the following instructions work for me :)

If you don't have Xcode and the command line utilities, install them first.

1) install the headers so that the build process can access them:


command: cp /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg ~/Desktop

and then double-click on the package to install them in /usr/include

2) get emacs from its git repository


command: git clone -b master git://

3) enter the emacs directory and run "make install" will be found in the nextstep/ directory

You can call it with Spotlight, and you can modify your path or create aliases so as to access the corresponding "emacs" command from the command line.

Once you have that done, just do a "git pull" regularly to get what's new and rebuild when you want to use the new code.


Editor guide
dgreatwood profile image

I recently wanted to build a patched version of the Emacs installed by brew/cask on macos. Notes are here (in the emacs bug reporting system), FYI:

-- Thanks!