Building emacs22 on Mac OS X
A Slashdot blurb from a while back, The Future of Emacs said that "Emacs 22 will have many new features such as support for Mac OS X and Cygwin; mouse wheel support and many new modes and packages."
Woo hoo! Mac OS X support. This is a big deal, because Emacs has been somewhat notorious in terms of its Mac maintainability. Here's what I mean: a few laptops ago, I had a Rev/A iBook which didn't get any hardware acceleration from OS X (we're talking 10.0 and maybe 10.1 here), so I found myself using X11 and
But things change. Two computers later, I now prefer the Terminal, since it supports UTF-8 text (i.e., two-byte character sets), and is easier to do copy-and-paste with. But I still wanted to be able to do Emacs in separate windows, since my typical Java development environment is to have one or two terminals and 2-5 editor windows open. Mixing Terminal and X11 didn't seem like a great idea, so I needed a real Mac OS X app. There are a couple projects to do this listed in Version Tracker, but they seemed a little fragile.
Speaking of fragile, back in the fink world, every time a major version of OS X came out, they'd be broken for a few months, so when I was on X11, I'd be broken. I checked out Darwin Ports, but their emacs port crashed if you tried to build it with X11 support. So I filed a bug in November, 2002. And it defied fixing, because when Darwin Ports' Landon Fuller looked at how Fink got it to work, he reported "The fink hacks are pretty ugly" and opted to wait for "upstream fixes".
Long wait, because I started getting mail about this last fall, three years after filing it. It had become one of the longest-open bugs in Darwin Ports.
So, I need my own Emacs .app, which various projects provide in a fairly fragile form, and also want an X11 version, which the major port projects have had problems building (Darwin Ports) or maintaining (Fink). And since I'm rapidly falling out of love with Fink because of what seems to be an abandoned port problem with them, I decided that I'm finally going to just start building my own stuff and give up on package managers.
So, um, how do we build this thing?
First, you need the source. When I went googling after reading the Slashdot post, I found a blog on building emacs22 for Tiger (in Japanese). It's mostly right, but the checkout information has changed.
To check out emacs, drop into the command line and create a temporary folder...
This will create an
The basics of building
You have two choices: building a double-clickable
The build uses the following basic steps
Each build tweaks these steps, so read on...
Building the Carbon app
To build the double-clickable app, you pass the flag
The last step installs the
Two interesting things to note: if you want to launch the Emacs.app from the command-line, you can use the path
Also, this is interesting:
Speaking of the Dock, double-clicking the app icon after an instance is running, or kicking off a second one from the command-line, will cause multiple Emacs applications to appear in the Dock, as pictured below. Not very Mac-like of course: a proper Mac application would open a new window in the already-running instance.
Building for X11
OK, if you want an X11 version (instead
First, the docs advocate a
Also, you generally need to have installed not only Apple's X11, but also the X11 SDK (an option in Apple's installer), to compile X11 stuff on OS X. No, I didn't try uninstalling mine just to see if it breaks... seriously, folks...
So here's the deal:
Get X11 running and kick off a
And hey, check out the version number:
So does it work on the Intel Macs?
Good question. I don't see a
Your mileage may vary
This has worked for me for a month or so, and I'm really happy with it, and looking forward to Emacs 22 being final someday. Hats off to the development team for making the Mac build so painless.
...and if it doesn't work for you, I'm not tech support and I'm not your mom. Attempt to deal.
Chris Adamson is an author, editor, and developer specializing in iPhone and Mac.
Comments on this weblog
1 to 4 of 4
2006-01-22 18:17:43 MactOSiX [View]
2006-01-22 01:30:20 m_keightley [View]
2006-01-21 21:07:00 ShrinkyNutsMcAngryPants [View]
1 to 4 of 4
Return to weblogs.oreilly.com.