How to compile git and cogito on Mac OS X
2005-04-28
I’ve been interested in git and cogito ever since I heard about them. They are a file system and very basic SCM tool started by Linus Torvalds when he decided to stop using BitKeeper for Linux development. I wanted to check out these new tools but they don’t compile and run right out-of-the-tarball on Mac OS X like those nice programs I’m used to from Fink.
By the way, you can grab the latest tarball from http://kernel.org/pub/software/scm/cogito/
Also, everything I say in this post applies to cogito 0.8. I don’t claim to be very knowledgeable about Mac OS X or Unix or Linux or git or cogito, but I do want to share what worked for me.
Anyway, the problem appeared when I ran make. I got this error:
ld: /var/tmp//ccJvrFXD.o illegal reference to symbol: _SHA1_Update
defined in indirectly referenced dynamic library
/usr/lib/libcrypto.0.9.7.dylib
The fix is actually very trivial once you know what’s going on. Just
open Makefile and find this line
LIBS = -lz
and change it to
LIBS = -lz -lcrypto
Now Mac OS X won’t get confused with implied dynamic library linking because the crypto library is listed explicitly.
There is another twist before you can actually use git and cogito. You do want to use them now that they are installed, right?
It turns out that the tools are installed in ~/bin instead of more
standard locations on OS X. You need to tell OS X how to find the new
tools, so type env on the command line and notice the contents of the
PATH variable. Now open your .profile and redefine PATH with
~/bin added. Mine turned out like this:
PATH="~/bin:/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin"
Save that, cd to your cogito folder, and then just run
$ make
$ make install
and you have git and cogito installed.
Not everything works because OS X doesn’t support all the same
functionality as typical Linux systems, but it’s good enough to play
with. Check out the README for help getting started. Also, the git
mailing list has a lot of traffic from some very smart people.
If anyone out there figures out anything else to help git or cogito work better on Mac OS X then please let me know.