Information about installing Emacs from source on macOS seems to be surprisingly sparse, so putting it all here together for easy reference. If it matters, the Emacs version I installed was 27.0.50, on macOS 10.14.
-
Pick from either
git://git.sv.gnu.org/emacs.git
orgit@github.com:emacs-mirror/emacs.git
(or have both as different remotes). -
Install
texinfo
,gnutls
, and make sure you have Command Line Tools installedxcode-select --install
. Additionally, you need the SDK headers. -
Run
./autogen.sh
, then./configure
(with any other flags you may want, I have--with-modules
forvterm
support), then finallymake install
, which will compile it into an application binary for your perusal.
brew install texinfo
echo 'export PATH="/usr/local/opt/texinfo/bin:$PATH"' >> ~/.zshrc # or follow the instructions given by brew info
brew install gnutls
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
git clone git://git.sv.gnu.org/emacs.git
cd emacs
./autogen.sh
./configure --with-modules # flag optional
make install # takes some time, grab caffeinated beverage of choice
Various error messages that you may encounter:
checking for makeinfo... /usr/bin/makeinfo
configure: error: You do not seem to have makeinfo >= 4.13, and your
source tree does not seem to have pre-built manuals in the 'info' directory.
Either install a suitable version of makeinfo, or re-run configure
with the '--without-makeinfo' option to build without the manuals.
You’re missing makeinfo
/texinfo
.
xml.c:23:10: fatal error: 'libxml/tree.h' file not found
#include <libxml/tree.h>
^
1 error generated.
make[1]: *** [xml.o] Error 1
make: *** [src] Error 2
You need to install the SDK headers as above.