PDA

View Full Version : [howto] crosscompilation iphone apps with sdk, without xcode


netkas
03-12-2008, 10:12 PM
it's to compile e.g. console utils, like sshd

so , open terminal.app
type this

export CFLAGS="-I/Developer/Platforms/Aspen.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include/ -I/Developer/Platforms/Aspen.platform/Developer/SDKs/Aspen1.2.sdk/usr/include -I/Developer/Platforms/Aspen.platform/Developer/usr/include/ -I/Developer/Platforms/AspenSimulator.platform/Developer/SDKs/AspenSimulator1.2.sdk/usr/include"

export CPP="/Developer/Platforms/Aspen.platform/Developer/usr/bin/cpp-4.0"

export CPPFLAGS=$CFLAGS

export LDFLAGS="-L/Developer/Platforms/Aspen.platform/Developer/SDKs/Aspen1.2.sdk/usr/lib/"

export PATH="$PATH:/Developer/Platforms/Aspen.platform/Developer/usr/bin/"

now, cd to dir with ur app (e.g. openssh)

./configure --host=arm-apple-darwin9 --build=i386-apple-darwin9.2.0

if u have powerpc mac, then replace i386 with powerpc

make and u done :D

AriX
03-12-2008, 10:29 PM
Cool - is this going to help us create SDK apps that run on jailbroken 1.1.4 phones in any way? Or just to make SDK apps without XCode? :)

EDIT: Hmm. I just had an idea on how to possibly make SDK apps for 1.1.4 - The apps require a new Foundation.framework, but you can't replace the Foundation.framework because it'll break the system. What if we included the framework in the app and loaded it from there? I think this has been thought of before, but I've never seen anyone try it. I'll try it now. Forgive me if I'm doing something stupid - I'm pretty new to the iPhone development scene, with SDK or without.

netkas
03-12-2008, 10:38 PM
u can try replace frameworks in Aspen1.2 sdk, with 1.1.4's one, so apps will be linked to 1.1.4 frameworks, not a 2.0 (then rebuild app)

or smth like that

netkas
04-13-2008, 11:36 PM
for beta3 vars is next:

export CFLAGS="-I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include/ -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/include -I/Developer/Platforms/iPhoneOS.platform/Developer/usr/include/ -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/usr/include"

export CPP="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp-4.0"

export CPPFLAGS=$CFLAGS

export LDFLAGS="-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/lib/"

export PATH="$PATH:/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/"