views:

74

answers:

2

Since Objective-C exists and is supported even in MinGW, by passing -x objective-c, is there a hack to achieve this with Android SDK? I've did a rudimentary test on a colleague's machine where it appears that language objective-cis not supported.

I am not interested in getting UIKit or AppKit, or even Foundation, to work; I've written most of an OpenGLES game in Objective-C, and successfully ported it to Mac OS X and Windows; I am fairly certain I could easily port it to GNU/Linux once I get time to figure out enough of GNUStep (and even without it, I could create the classes to get the game running).

I'm just interested in the base language and basic runtime (including properties, if possible); even NSObject can be easily written to the extent I need it.

+1  A: 

You probably have to recompile the ndk gcc's sources with that option enabled. At the extreme you might have to find the code for that option upstream and add it to the ndk gcc's sources.

Porting runtime libraries to work on top of bionic instead of glibc may be more interesting.

Note that android doesn't really handle pure-native binaries very well, you will need to either be called as a jni library from a java wrapper application which you will have to call back up through for audio or forked and exec'd off of one (not recommended, and leaving you with device-dependent hacks for audio).

Chris Stratton
That's somewhat too in-depth for me. I never liked recompiling GCC. I will accept, however, if you get a few upvotes from people more knowledgeable than me.
Ivan Vučica
A: 

There is this Google Code project: http://code.google.com/p/android-gcc-objc2-0/ however I have not tested it yet.

Also, I have inquired on the Cocotron mailing list whether or not this compiler is usable with Cocotron's Foundation and CoreFoundation; one person responded that it is not, and that he has worked on the problem: http://groups.google.com/group/cocotron-dev/browse_thread/thread/448355f2a6c9c28e#

Ivan Vučica