It's a pain getting all the pieces for X11 on OS X 10.2 together. Here's most everything you need all in one place:

Mac OS X 10.2 only: Installation of Apple Developer Tools and Apple X11(SDK)

In order to download the Developer Tools CD, you need to register a free account on Apple's Developer Connection. After registration, log in on Apple's Developer Connection and click on Download Software in the left menu and then on Developer Tools.

From there, download the files

* December 2002 Mac OS X Developer Tools (301.2M) and then
* August 2003 gcc Updater (19.1M)

Then, download

* X11UserForMacOSX-beta3.dmg(41.8M) and finally

* X11SDK-beta3.dmg(4.0M)

I understand that Apple might want to mimize support issues with older products, but come on. Why not keep the 10.2 X11 beta accessible? Yeah, yeah, so that you have to upgrade to 10.3. Guess I oughta start learning some XonX.