So after the most recent 10.5.3 Leopard upgrade, I go to fire up the Erlang REPL and I get "Bus error." Evidently this is somewhat common (as noted in #couchdb IRC channel), so I thought I'd just upgrade to a more recent Erlang.
MacPorts barfs on me, so I decide to clean everything and start over. Now with no trace of erlang, couchdb, or couchdb-devel, I start again.
Hitting the megaco flex errors pisses me off, but I find this nice article that helps. Basically, update flex to 2.5.35 or higher before trying erlang on OS X 5.3. Here's a sample of the errors:
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/ _opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R12B-2" && make all " returned error 2
Command output: megaco_flex_scanner_drv.flex:31: unknown error processing section 1
megaco_flex_scanner_drv.flex:31: unknown error processing section 1
megaco_flex_scanner_drv.flex:31: unknown error processing section 1
megaco_flex_scanner_drv.flex:31: unknown error processing section 1
megaco_flex_scanner_drv.flex:31: unknown error processing section 1
megaco_flex_scanner_drv.flex:32: bad character: *
So, given errors surrounding hipe (MacPorts bug, can't find link) I removed it from my install command:
sudo port install erlang -hipe +smp
Cool, now Erlang works. Let's get a new CouchDB from /trunk...
./bootstrap
./configure --with-erlang=/opt/local/lib/erlang/usr/include --prefix=/opt/local
make
sudo make install
Nice. Now I have all of the new reduce hotness.