TestDisk and PhotoRec can be compiled on MacOS X.

Install libjpeg

Method 1: Building libjpeg

Download libjpeg source from ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
Mac OS X 10.3 ships with GNU libtool, albeit under a slightly different name, glibtool.

% tar xzf jpegsrc.v6b.tar.gz
% cd jpeg-6b
% ln -s `which glibtool` ./libtool
% ./configure --enable-shared --enable-static && make
% sudo make install

Method 2: Use Fink

You could go through the process of downloading, configuring, and compiling these yourself, but, if you’re using Fink, there’s really no need. Fink automates the installation of dozens of UNIX packages and is extremely easy to work with.

Follow these instructions and you’ll end up with a new directory called /sw with a great deal of software in it. You can now use Fink to install libraries with a single command. Here’s how you install libjpeg:

% sudo /sw/bin/fink install libjpeg