Cydia is a new package management replacement to the existing Installer.app. And it now also brings the gcc compiler to iPhone in firmware 1.1.x
Although it is slow to compile in iPhone but it is stable and very native.
You can follow these steps to install the compiler and related headers and utilities:
1. Set your iPhone Auto-Lock to "Never"
2. Goto Installer and install the package called "Cydia Installer" (version 1.0). It will take some time to download and install, so you should have connected your iPhone to Wifi
3. After installation of Cydia, iPhone will reboot and you will find a new icon "Cydia" in your Home Screen. Start "Cydia" and it will tell you to update Critical Packages. Follow the instructions to "Update All"
4. After update of Critical Packages in Cydia, install the following 3 packages
GNU C Compiler
iPhone 1.1.1 Headers
5. Then you can have gcc compiler in your iPhone now. You can use Mac Terminal or putty to access the terminal of iPhone and start building your application.
Please take note that after the installation of Cydia, your BSD subsystem is now changed to Fake BSD subsystem and also fixed a number of bugs. So don't update BSD subsystem from the Installer.app
You may want to try some HelloWorld example, and here is the project that you can try
copy and unzip it to your iPhone
Then you will have a new program HelloWorld.
To uninstall this HelloWorld