Compiling Emacs with eww on OS X

I’m old school and like to compile applications myself rather than use something like Homebrew. I have nothing against Homebrew and its brethren, it’s just that compiling things myself helps me stay connected to the development process. Besides, it’s what real geeks do. One consequence of this is that I compile Emacs from source rather than downloading the prebuilt binaries.

I compiled Emacs 24.4 recently and didn’t experience any problems until I tried to use eww. Emacs told me that it had to be compiled with libxml2 to use eww. After a bit of investigation, I discovered that libxml2 was not installed with OS X so I downloaded and compiled it and rebuilt Emacs. Sadly, it still didn’t compile with libxml2. I could see from config.log that configure wasn’t finding the include files for the library. That’s because they installed in /usr/local/include rather than in /usr/include.

After a bit more fumbling around, I discovered the proper spell. If you’re trying to compile Emacs on a Mac and want it to build with libxml2, here it is.

configure --with-ns CFLAGS="-I /usr/local/include/libxml2"
make
make install
This entry was posted in General and tagged . Bookmark the permalink.