I'd recommend making sure Xquartz is installed:
http://xquartz.macosforge.org/trac/wiki
And getting the latest greatest Xcode for Leopard/10.5 should get you a bit
farther. The last 10.5-compatible version was Xcode 3.1.4, I believe. You can
get it for free with an Apple developer account at:
http://connect.apple.com
I bundle a bunch of OS X prereqs up in my build script. Note that there are
some issues on 10.5 though, and I haven't had spare cycles to look into
them; 10.6 works like a champ (it's what I use), and I think 10.7 should
work as well, as long as the Xcode 3.2 from Snow Leopard is used. No idea on
Xcode 4 or 4.1 on Lion.
http://code.google.com/p/osxwinebuilder/
The 10.6/Snow Leopard update is $29, likely cheaper from retailers other than
Apple now that Lion is out, and it's a good deal more stable and supported
than 10.5. -r