Toolchain 2.0http://www.theiphonewiki.com/wiki/index.php?title=Toolchain_2.0#LinuxJump to:
navigation,
search
This article explains how to build a tool chain for iPhone OS 2.0.
Please note that this section is under development.
| Contents [hide]
- 1 Mac OS X
- 2 Windows XP
- 2.1 Extraction of iPhone OS 2.0 SDK
- 3 Linux
- 3.1 Extraction of iPhone OS 2.0 Installation Packages (.pkg)
- 3.2 Framework Headers
- 4 iPhone/iPod Touch
|
Mac OS X
fill this in. somebody did not get this memo :P
toolchain != apple sdk
Windows XP
Extraction of iPhone OS 2.0 SDK
- Download the iPhone OS 2.0 SDK from Apple iPhone Dev Center.
- Download and install HFSExplorer from catacombae software.
- Start HFSExplorer and choose the menu File→Open UDIF Disk Image (.dmg)...
- Select the iPhone 2.0 SDK disk image iphone_sdk_final.dmg and press Open
- When the tool asks Which partition to read leave it at "Mac_OS_X" (Apple_HFS) and press OK
- Go to Packages and select the package you want to extract, e.g. iPhoneSDKHeadersAndLibs.pkg for the iPhone OS 2.0 header files.
- With right mouse button choose Extract data to extract an installation package.
- Please note that in order to extract this .pkg file on Windows, you must compile xar using Cygwin. Make sure you have libxml2, libxml2-devel, openssl and openssl-devel. You can then follow the instructions below.
Linux
Currently we can only describe how to get the headers from the iPhone OS 2.0 SDK.
Extraction of iPhone OS 2.0 Installation Packages (.pkg)
- Extract iPhoneSDKHeadersAndLibs.pkg from iPhone OS 2.0 SDK:
mount -t hfs -o loop /path/to/iphone_sdk_final.dmg /somepath/somedir
-
Copy iPhoneSDKHeadersAndLibs.pkg from /somepath/somedir
- Use the eXtensible ARchiver xar to extract the file Payload file containing the actual header files:
xar -xf iPhoneSDKHeadersAndLibs.pkg Payload
- Rename the Payload file since it is gzipped:
mv Payload Payload.gz
- Uncompress the Payload.gz file:
gunzip Payload.gz
- Extract the contents of the resulting Payload file:
cat Payload | cpio -i
or
cat Payload | cpio -i -d '*.h'
to extract only all header files included in the package.
Framework Headers
This section assumes that
cat Payload | cpio -i -d '*.h'
got used in previous section.
If you want to move all Framework headers into an include directory continue as follows:
- Remove the project XCode templates since they will not be required anymore:
rm -rf Platforms/iPhoneOS.platform/Developer/Library
- Create your target include directory:
mkdir include
- Get just the System and usr directories from the iPhone Os 2.0 SDK and remove the empty Platforms directory hierarchy:
mv Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/* .rmdir -p Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/
- Move the Framework headers to current directory and clean-up empty directory hierarchy:
mv System/Library/Frameworks/* .rmdir -p System/Library/Frameworks/
- Rename/move all Framework header directories into include directory and cleanup
mv AddressBook.framework/Headers include/AddressBookmv AddressBookUI.framework/Headers include/AddressBookUImv AudioToolbox.framework/Headers include/AudioToolboxmv AudioUnit.framework/Headers include/AudioUnitmv CFNetwork.framework/Headers include/CFNetworkmv CoreAudio.framework/Headers include/CoreAudiomv CoreFoundation.framework/Headers include/CoreFoundationmv CoreGraphics.framework/Headers include/CoreGraphicsmv CoreLocation.framework/Headers include/CoreLocationmv Foundation.framework/Headers include/Foundationmv MediaPlayer.framework/Headers include/MediaPlayermv OpenAL.framework/Headers include/OpenALmv OpenGLES.framework/Headers include/OpenGLESmv QuartzCore.framework/Headers include/QuartzCoremv Security.framework/Headers include/Securitymv SystemConfiguration.framework/Headers include/SystemConfigurationmv UIKit.framework/Headers include/UIKitrmdir -p *.framework
- The remaining directories are include with all Framework headers and usr with all system related headers.
- You may still remove the Payload file since we don't need it anymore:
rm Payload
iPhone/iPod Touch
There is a tool chain available after jailbreak from the Cydia installer. You just need to install the iPhone 2.0 Toolchain from Cydia to get a 1.1.x based development environment on your iPhone or iPod Touch. The maintainer of this package - BigBoss - has some comments on this Toolchain on his webpage Toolchain 2.0.
If you want to use the header files from iPhone OS 2.0, you can obtain them from the iPhone OS 2.0 SDK as described in section Framework Headers.
When using iphone-gcc ( the native compiler ) to compile iPhone applications, you must do one of the following: 1. Patch the SDK header files for use with the compiler ( stupid thing doesn't like the new headers! ) or 2. Use the old header files ( which are great, but some things dont work/exist the same anymore! )