[gambit-list] Gambit and oximeter

Petersen, Chris CPetersen at cw.bc.ca
Thu Feb 24 17:55:47 EST 2011


I'm afraid the autoconf script is not very exciting. There
is not much "auto" about it for one, and it's long. I've
tried to extract the gambit related essence of it and made a
little independent gambit build system to illustrate how it
works.  The attached setup will allow you to build gambit-c
on a mac for five different platforms; OSX, Linux, Windows,
iOS and Android (library only).  In order to make use it you
just need to drop the latest gambit-c non-development source
tarball (gambc-v4_6_0.tgz) into the directory and install
the compilers.  The windows and linux cross-compilers can be
found pre-made for example from here: 

http://crossgcc.rts-software.org/doku.php

and the rest are included in their respective SDK. In this
simple setup the android NDK will build the gambit library 
but not the gsi/gsc executables due to android's nonstandard
linking requirements. It's possible to do that, but it's
unnecessary trouble if you plan on using gambit from within a "proper" 
android app anyway. You might  need to tweak the paths in the 
script if the compilers end up in directories different from my 
own setup, but basically

./configure --with-platform=macosx|win32|linux|iphone|iphone4|android
make

will now build gambit for your system of choice.  The result
ends up in a platform subdirectory.  There is no need for a
virtual machine on the mac, everything is just
cross-compiled directly from OS X. The mobile vendor native SDKs 
are all instances the gcc cross-compiler, and can be
invoked in an almost identical way, as is hopefully clear
from the script.  The approach should work with any 
platform that has a gcc based development system. Most do.
Notable exceptions are from the vendors that doesn't allow
native code, like BlackBerry and Windows Phone 7.

The caveat is that although gambit-c and all the scheme code
builds just fine in this way, you still need to jump through
the various hoops that vendors have created in order to
build an executable that ties into the platform's windowing
and event system. This is were that hook I mentioned in the 
earlier post comes in.

The attached is just a quick hack, your mileage may vary.

Chris

________________________________________
From: Marc Feeley [feeley at iro.umontreal.ca]
Sent: Wednesday, February 23, 2011 2:53 PM
To: Petersen, Chris
Cc: gambit-list at iro.umontreal.ca
Subject: Re: [gambit-list] Gambit and oximeter

On 2011-02-23, at 10:06 AM, Petersen, Chris wrote:

> The development environment is a standard make/autoconf
> setup. For example, to build the oximeter (iPleth) for the
> iPhone you'd do:
>
> ./configure --with-app=iPleth --with-platform=iphone
> make
>
> This invokes gsc+gcc to build the binary, signs it and
> packages the app as needed for the particular platform.  The
> framework is modular, and allows you to define any number of
> apps. We are working on a handful of different ones at
> present. I do most development on a Mac, because I can then
> compile an app for OSX, iOS, Android, Windows and linux from
> the same box using just that single configure command.

I would love to see your configure script and makefile, in particular the iPhone part that builds the application without using Xcode (I assume from your message that you don't have to muck around with Xcode to build the application).

On the Mac are you using VirtualBox or Parallels workstation?  There too there is much to learn!  For Gambit I have used Parallels workstations to build the Windows releases, but it is done with a very brittle script.

Marc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gambit-crosscomiler.zip
Type: application/zip
Size: 41486 bytes
Desc: gambit-crosscomiler.zip
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20110224/0f79c183/attachment.zip>


More information about the Gambit-list mailing list