How do I compile mjpegtools (mpeg2enc etc) on Mac OS X 10.2.8?

http://mjpeg.sourceforge.net/

mjpegtools INSTALL info indicates that I need glib (I installed it via DarwinPorts' sudo port install glib), (g)cc/g++/c++ (I installed it via Apple's Developer Tools), libjpeg (I installed it via jpegsrc.v6b.tar.gz and ./configure, make, sudo make install), XFree86 (I installed it via sudo fink install xfree86-base).

But mjpegtools' make gives the following error:

cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
make[2]: *** [jpegutils.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

There are mpeg2enc and mplex Mac OS X binaries and compiling instructions as well as some old instructions at:

http://mjpeg.sourceforge.net/MacOS/
http://www.bu.edu/linguistics/UG/hagstrom/vcd.html

But so far my mjpegtools compiling efforts have been unsuccessful.

With fink and DarwinPorts I can compile several tools like automake, autoconf, libtool, gtk, popt, pkgconfig although I don't know whether mjpegtools needs all of these, my efforts to compile libdv have also been unsuccessful.