This is what I referred and I succeeded installing gcc on my ipad 1 with iOS 5.1.1.
http://www.ccvita.com/517.html
1. Prepare the terminal:
There are 2 options:
option 1 : Cydia install Terminal
option 2 : First install in Cydia OpenSSH and pTerm. Then use pTerm to connect 127.0.0.1 with password "alpine".
2. Start GCC installation
(1) install wget to download everything needed
apt-get install wget |
(2) install libgcc
wget http://apt.saurik.com/debs/libgcc_4.2-20080410-1-6_iphoneos-arm.deb |
dpkg -i libgcc_4.2-20080410-1-6_iphoneos-arm.deb |
(3) install gcc
apt-get install iphone-gcc |
(4) download the header files and libraries that gcc needed and then copy them to the system directory
wget http://www.syshalt.net/iphone/gcc-iphone/sdk-2.0-headers.tar.gz |
tar -xvzf sdk-2.0-headers.tar.gz |
cd include-2.0-sdk-ready-for-iphone |
cp -r * /usr/include |
cd.. |
wget http://www.syshalt.net/iphone/gcc-iphone/gcc_files.tar.gz |
tar -xvzf gcc_files.tar.gz |
cd gcc_files |
cp -r * /usr/lib |
(5) install useful command and libraries
apt-get install ldid |
apt-get install make |
apt-get install vim |
apt-get install curl |
apt-get install sqlite3 |
(6) now we could use "gcc" as command like "gcc hello.c -o hello"
But don't forget to ldid the executive file (here is "hello") before running.
ldid –S <application> |
References:
http://code.google.com/p/iphone-gcc-full/issues/detail?id=6
http://iklive.org/cc-compiling-on-ios/
http://stackoverflow.com/questions/14710849/get-gnu-c-compiler-working-on-ios-6-x/