Woo.. after doing the process almost ten times, downloading the fullxodetools.dmg(~924mb) i finally have the iPhone toolchain working.. ihave setup the non official iPhone SDK ,, untill the official by Applecomes out in Feb'08 .
Start developing native iPhone apps today, no more web 2.0…
There are many guides out there, i am just telling my expierience, hope it works for you..
It uses the GC++, GCC compiler in linux..
I used Fedore 7 on VMware(virtual machine, you can grab both of them for free) to build the toolchain. I recomd.linux for good performance..
Content from –http://code.google.com/p/iphone-dev/wiki/Building,with my tips inBOLD.
HOWTO build the toolchain
Run terminal…
- Configure and make LLVM-GCC. Make sure that$LLVMOBJDIRand$HEAVENLYare set per the instructions above.(igot the errors like error 1, error 2 more than 5 times, i solved thisproblem by changing lots of files,symlinks in /usr/lib folder of iphoneimage hence i have uploaded my modified working iphone image. see belowfor errors).
|
<span class="pln">$ mkdir</span><span class="pun">-</span><span class="pln">p build</span><span class="pun">/</span><span class="pln">llvm</span><span class="pun">-</span><span class="pln">gcc</span><span class="pun">-</span><span class="lit">4.0</span><span class="pun">-</span><span class="pln">iphone<br>$ pushd build</span><span class="pun">/</span><span class="pln">llvm</span><span class="pun">-</span><span class="pln">gcc</span><span class="pun">-</span><span class="lit">4.0</span><span class="pun">-</span><span class="pln">iphone<br>$</span><span class="pun">.</span><span class="pln">.</span><span class="str">/../</span><span class="pln">llvm</span><span class="pun">-</span><span class="pln">gcc</span><span class="pun">-</span><span class="lit">4.0</span><span class="pun">-</span><span class="pln">iphone</span><span class="pun">/</span><span class="pln">configure</span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">llvm</span><span class="pun">=</span><span class="str">`llvm-config --obj-root`</span><span class="pln"></span><span class="pun">\</span><span class="pln"><br></span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">languages</span><span class="pun">=</span><span class="pln">c</span><span class="pun">,</span><span class="pln">c</span><span class="pun">++,</span><span class="pln">objc</span><span class="pun">,</span><span class="pln">obj</span><span class="pun">-</span><span class="pln">c</span><span class="pun">++</span><span class="pln"></span><span class="pun">--</span><span class="pln">target</span><span class="pun">=</span><span class="pln">arm</span><span class="pun">-</span><span class="pln">apple</span><span class="pun">-</span><span class="pln">darwin</span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">sjlj</span><span class="pun">-</span><span class="pln">exceptions</span><span class="pun">\</span><span class="pln"><br></span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">heavenly</span><span class="pun">=</span><span class="pln">$HEAVENLY</span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="kwd">as</span><span class="pun">=</span><span class="str">/usr/</span><span class="pln">local</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">arm</span><span class="pun">-</span><span class="pln">apple</span><span class="pun">-</span><span class="pln">darwin</span><span class="pun">-</span><span class="kwd">as</span><span class="pln"></span><span class="pun">\</span><span class="pln"><br></span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">ld</span><span class="pun">=</span><span class="str">/usr/</span><span class="pln">local</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">arm</span><span class="pun">-</span><span class="pln">apple</span><span class="pun">-</span><span class="pln">darwin</span><span class="pun">-</span><span class="pln">ld<br>$ make LLVM_VERSION_INFO</span><span class="pun">=</span><span class="lit">2.0</span><span class="pun">-</span><span class="pln">svn</span><span class="pun">-</span><span class="pln">iphone</span><span class="pun">-</span><span class="pln">dev</span><span class="pun">-</span><span class="lit">0.3</span><span class="pun">-</span><span class="pln">svn<br>$ sudo make install<br>$ popd<br>$ popd</span> |
You're done. Have fun!
Gotchas
- Makesure that there are no spaces in any of the directory names that youuse. GCC does not build if there are spaces in the directory names, andthe shell scripts will not work. This is most often a problem onWindows.
- Make sure that/usr/local/binis in yourPATH.This is not the case out of the box on Mac OS X, although chances areif you've installed things from source before you've added it already.
- If LLVM failed to compile because of missingbisonand/orflex(evidence that this was the case is a failed compile onutils/TableGen/FileLexer.l), you mustmake cleananddeleteutils/TableGen/FileParser.hbefore trying again withbisonandflexinstalled. LLVM'smake cleanscript does not always properly clean up after a failed build.
- Make sure that$HEAVENLYpoints to a copy of the full iPhone root filesystem, not just theunpacked update DMG. If you get errors about being unable to find-lc, then your$HEAVENLYis set incorrectly, you mistyped the--with-heavenlyoption toconfigure, or your copy of the root partition is incomplete. Your copy of the iPhone root filesystemmustinclude ausr/lib/libc.dylibfile.
HOWTO obtain the Mac OS X headers on Linux or Windows
=Install thecpioutility using your distribution's standard package management system.All the major Linux distributions, as well as Cygwin, should have thisutility.
=No needtodownload the whole xcode tools dmg (~924mb). I extracted thepackage,uploaded it for you :), download the needed file from here-http://rapidshare.com/files/66764258/MacOSX10.4u.sdk.rar
=Extract RAR, then thepaxarchive by creating a new dir and using the following command in terminal
|
<span class="pln">gunzip</span><span class="pun">-</span><span class="pln">c MacOSX10.4u.sdk.</span><span class="pun"></span><span class="pun"></span><span class="pln">pax</span><span class="pun">.</span><span class="pln">gz</span><span class="pun">|</span><span class="pln">cpio</span><span class="pun">-</span><span class="pln">i<br><br></span> |
=FindMacOSX10.4u.sdkfolder in extracted contents and link it toolchain install procedure.
—LOGIN as root to avoid weird errors, password prompts again and again..
–The envirnoment variables should be set properly to check there use this command in terminal- echo $VARIABLENAME, eg. –echo $HEAVENLYif it returns blank line set it again. the envirno. variable has aliftime till the terminal runs, if you close it, you have to set itagain
— errors i got ,when i do"make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn" its runs for a long time and then results in this error */usr/local/bin/arm-apple-darwin-ld:/home/Aakash/iphone/iphone-image/usr/lib/libc.dylib truncated ormalformed object (mach header extends past the end of the file)collect2: ld returned 1 exit status make2 [libgcc_s.dylib] Error 1make2 Leaving directory/root/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make1 [stmp-multilib]Error 2 make1: Leaving directory
/root/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make: [all-gcc] Error 2
*
i did this to get off the error"openall .dylib files (<=1 k) one by one in folder/iphone-image/usr/lib/, rename it – and for example libc.dylib showspath to libSystem and libSystem – path to libSystem.B.dylib. Just copylibSystem.B.dylib twice and rename 2 new files to libc.dylib andlibSystem.dylib. do this for all <=1kb .dylib files".
The iPhone image i uploaded here contains these changes, no need to do again.
Passwordfor all my rapidshare uploadsif neededin this post isaksblog.co.nr
Usefull links-
Post toolchain install–
Need any help, post as comment…