I'm so glad there is interest in running Chicken on mobile platforms. This is what I've been working on for the past few months, starting
chicken-android and
cocoscheme. I only have experience with Android, so I can't speak for other platforms.
My chicken-android project is intended to help embedding Chicken into your Android app. It does this by providing GNU Makefiles so that you can "easily" add Chicken as a dependency to your exisiting NDK module,
like this. I say "easily" because it's still a pain with paths and you'll never get a sensible error message with the NDK build chain (e.g. you'll get "cannot find chicken.h" instead of "cannot find module path for chicken"). It also has an extra
find-extension unit which allows you to load other chicken modules like
(use matchable) by prefixing "lib" as is mandatory with the NDK.
But to answer your question Stephen, the NDK handles chicken-generated .c files well. I've essentially done exactly what you did for iOS:
add those .c files to the build-sources. But I too want something prettier!
The cocoscheme project is a playable demo with a network repl available on Google Play, I brought it up on this mailing list
here. I'm using
Cocos2Dx. All my projects so far have exclusively relied on OpenGL ES and other game-like frameworks to deal with user-interaction, so I don't know about using Chicken for more general apps.
I have a few thoughts on problem (1) in Kevin's terminology: making it build/run on a mobile platform. Problem (2), to create bindings, I think should be a completely isolated (and bigger) project.
I think Stephen makes a very valid point: A separate csc for building mobile components would be very tricky. It would have to hook up to NDK's gcc and that's not pretty, nor officially supported (I think). However, a csc-like tool that generates buildfiles for the different architectures is something I think would work well like Stephen explains.
In my cocoscheme project, for example, I'm using a few eggs. There a lot of copy-paste like you can see
here. It should be possible to generate makefiles for this automatically, at least for the most basic eggs. Maybe we could even look at the .setup file for an egg and make a .mk file based on that. I suspect this could be handled in a similar manner on iOS?
I would love to have a "project.scm" file describing dependencies etc and have template- and build-files automatically built based on that. .c files would be re-generated automatically when they are older than their .scm owners so the ndk wouldn't recompile everything every time like it does now. And it should place all messy build-files into a single directory (maybe hidden) so I'm not constantly confused as to what to commit and what to not. Here's my dream:
$ chicken-mobile new hello-world
$ cd hello-world
$ chicken-mobile build android && ant debug && adb install bin/hello-world-debug.apk
$ chicken-mobile build ios && xcode-magically-install bin/hello-world.ipa
K.