摘要:HOW TO install toolchain4 for iOS
1. Ubuntu 10.10 iPhone Toolchain 4
If you use Ubuntu 11.04, please see wiki on how to use gcc-4.4 to compile
2. Install the following packages in Ubuntu
sudo apt-get update
sudo apt-get install bison flex build-essential wget patch
sudo apt-get install git autoconf gawk libssl-dev libxml2-dev uuid-dev
sudo apt-get install clang
NOTE: You must check gcc version after installion. As my condations, after upgrade, gcc version is 4.4.5 in Ubuntu 10.10
If your gcc >= 4.4,you need bleow to do :
sudo apt-get install gcc-4.4 g++-4.4 gobjc-4.4
sudo update-alternatives --remove-all gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 44 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.4
3. Clone Project
cd /
sudo git clone git://github.com/javacom/toolchain4.git
sudo chown -R <yourusername>:<yourusername> /toolchain4
4. Put iPhoneOS4.2.sdk.tgz to /toolchain4/sdks/
or build xar
sudo apt-get install libxml2-dev
./toolchain.sh xar
then put iPhoneSDK4_2.pkg to /toolchain4/sdks/
./toolchain.sh buildsys #This is used to build llvmgcc
to build sys
Put iPhoneSDK5_0.pkg to /toolchain4/sdks/
./toolchain.sh buildsys50
to build sys50 folder
Put iPhoneSDK4_3.pkg to /toolchain4/sdks/
./toolchain.sh buildsys43
to build sys43 folder
Put iPhoneSDKHeadersAndLibs.pkg to /toolchain4/sdks/
./toolchain.sh build313
to build sys313 folder
Put iPhoneSDKHeadersAndLibs_32.pkg to /toolchain4/sdks/
./toolchain.sh build32
to build sys32 folder
5. Build headers tools and gcc
cd /toolchain4
./toolchain.sh buildsys
./toolchain.sh cctools
./toolchain.sh llvmgcc
./toolchain.sh ldid
NOTE: When you build cctools, there must be a error. edit toolchain/src/cctools/otools/print-objc.c,comment all because there is no objc runtime headers on ubuntu6.
#if 0
...... (the all code here)
#endif
cd /toolchain4/as_driver
make
cd /usr/bin
sudo mv as i686-linux-gnu-as
sudo cp -p /toolchain4/as_driver/as_driver as
sudo ln -s /toolchain4/pre/bin/arm-apple-darwin9-as .
sudo mv ld i686-linux-gnu-ld
sudo cp -p /toolchain4/as_driver/as_driver ld
sudo ln -s /toolchain4/pre/bin/arm-apple-darwin9-ld .
7. Test iOS4 sample code
cd /toolchain4/Projects/LocalPush
make
make dist
(LocalPush.app & LocalPush.ipa will be in build/4.0/ folder)
8. Checkout the updated UICatalog in svn here
sudo apt-get install subversion
cd /toolchain4/Projects
svn checkout http://apiexplorer.googlecode.com/svn/trunk/UICatalog UICatalog-read-only
cd UICatalog-read-only
make -f Makefile.ios4
make -f Makefile.ios4 dist
(Then install the build/4.0/UICatalog.ipa to iPhone for testing)
Enjoy.
Some of pkg files can download as below:
If you want to ./toolchain.sh buildsys
Download iPhoneSDK4_2.pkg here or here
If you want to ./toolchain.sh buildsys50
Download iPhoneSDK5_0.pkg here or here
If you want to ./toolchain.sh buildsys43
Download iPhoneSDK4_3.pkg here or here
If you want to ./toolchain.sh build313
Download iPhoneSDKHeadersAndLibs.pkg (that is iPhoneSDK3.1.3) here or here
Download MacOSX10.5.pkg here or here
If you want to ./toolchain.sh build32
Download iPhoneSDKHeadersAndLibs_32.pkg (that is iPhoneSDK3.2) here or here
and MacOSX10.5.pkg
------------------------------
文章的授權使用CC BY-ND2.5協議。凡是標示“轉載”的文章,均來源於網絡並儘可能標註作者。如果有侵犯您的權益,請及時聯繫刪除或者署名、授權。
Gtalk/Email: cmd4shell [at] gmail.com