Saturday, January 09, 2010

Building git 1.6.6 on Snow Leopard

Geek stuff ahead. You have been warned.

I've been agonizing over the choice of revision control systems and finally decided to take the plunge and go with git instead of mercurial because it seems to be what all the cool kids are using. So I downloaded the latest version (1.6.6) but when I tried to build it on my Mac I got this:

ld: warning: in /opt/local/lib/libz.dylib, file is not of required architecture

Several hours of Googling, hacking, and premature hair loss later I found a blog entry from Simon Engledew revealing that the problem seemed to be an out-of-date copy of Macports. Simon recommends nuking Macports with a "terrifyingly brutal" (his words) string of rm -f commands.

It was a little too terrifyingly brutal for me. A little poking around revealed that there's a less terrifying way: just add the following line to the top of the Makefile:


(There's probably a Make wizard out there who knows how to do this at the command line, but I am not he.)

One final wrinkle: don't run configure. I accidentally forgot to run configure but it worked anyway. I went back and ran it figuring that I might have built a time bomb, and then the build failed. So I went back and did a clean configure-less build and ran the test suite (which is impressively extensive) and it passed.

That's how I did it. YMMV.

1 comment:

Anonymous said...

I'm guessing:


Stupid blogger, letting me use i and m tags, but not tt.