Building emacs on Mac OS X Mavericks

To remove one possiblility as to why emacs would randomly crash under OS X Mavericks, I decided to build it from scratch under Mavericks itself. This involved jumping through a number of hoops.

Hoop One

Downloading the latest version of emacs source from, using Bazaar. This involved building Bazaar (aka bzr) on one of my FreeBSD boxes and then:

  bzr branch bzr://

The repository copy takes some time. Once complete, the trunk directory contains this:

  BUGS      lisp/           nt/
  COPYING         README          doc/            lwlib/          oldXMenu/
  ChangeLog       admin/          etc/            m4/             src/
  GNUmakefile*     leim/           make-dist*      test/
  INSTALL         build-aux/      lib/            msdos/
  INSTALL.BZR     config.bat      lib-src/        nextstep/

As I was waiting for the repository to be cloned, I started reading the doc for devs, which indicated just jumping straight in like this was not the right thing to do, but it seemed to work OK. Next time I'll try and remember to do it the right way, viz:

  bzr init-repo emacs/

The trunk diretory was then copied to the Macbook Pro.

Hoop Two

Next, you will note there is no configure script. To create it, one has to run ./, but for that to work you need autoconf and automake, which are not present by default on Mac OS X Mavericks (even with XCode installed). So, using this guide from Jean-Sebastien Delfino, we can build them. To summarise the steps:

  export build=~/dev
  mkdir -p $build

  cd $build
  curl -OL
  tar xzf autoconf-2.68.tar.gz
  cd autoconf-2.68
  sudo make install

  cd $build
  curl -OL
  tar xzf automake-1.11.tar.gz
  cd automake-1.11
  sudo make install

  # dunno if you need libtool, but just to be on the safe side...
  cd $build
  curl -OL
  tar xzf libtool-2.4.tar.gz
  cd libtool-2.4
  sudo make install

Unlike Mr. Delfino, I installed everything in the Max OS X system directories. (i.e. no --prefix=$build/bin or some such)

Once these tools were in place, I could run ./ and then the configure script was built. This is run like:

  ./configure --build=i686-apple-darwin --with-ns

The required arguments to configure kindly supplied by David Caldwell's GitHub site.

The Build!

At this point, we can now run:

  make && sudo make install

The setup is built in the nextstep directory. I installed it over the existing version; let's see if it behaves any better.