caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Nathaniel Gray <n8gray@gmail.com>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: Joel Reymont <joelr1@gmail.com>,
	"O'Caml Mailing List" <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] arm backend
Date: Tue, 5 May 2009 11:21:15 -0700	[thread overview]
Message-ID: <aee06c9e0905051121v204e1d61sb92623769aa1e98f@mail.gmail.com> (raw)
In-Reply-To: <4A000A39.8070604@inria.fr>

[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]

On Tue, May 5, 2009 at 2:43 AM, Xavier Leroy <Xavier.Leroy@inria.fr> wrote:
>
> Concerning the iPhone, it is not supported out of the box by 3.11 nor
> by the CVS trunk code.  For 3.11, several patches have been mentioned
> on this list; it would be great if someone with iPhone development
> experience could combine them and publish a unified patch.

Feel free to attach any such patch to the bug in mantis:
  http://caml.inria.fr/mantis/view.php?id=4782

> For the CVS trunk code, it seems we are getting close: as far as I
> could see, MacOSX/ARM uses EABI plus Apple's "signature" approach to
> dynamic linking.  However, I haven't yet succeeded in running Apple's
> iPhone SDK compilers from the command-line.  (It looks like one of
> those Microsoft SDK's that assume everyone is developing from the
> vendor-supplied IDE...)  Again, I welcome feedback and patches from
> iPhone development experts.

I'm attaching (here and at the bug) a script I use to configure and
build an e-mail library for both the iPhone simulator (x86) and the
iPhone itself (arm).  There's some extraneous junk in there but you
should get the idea.  The important flags are '-arch armv6' and
'-isysroot /path/to/sdk'.  It might also be worth mentioning that
Apple prohibits the use of dynamic libraries in iPhone apps (for now
at least) and most iPhone projects are built in Thumb mode by default.

Cheers,
-n8

[-- Attachment #2: configure-libetpan --]
[-- Type: application/octet-stream, Size: 1479 bytes --]

#!/bin/zsh
# We do have iconv and libz built in on iPhone
# We have expat on the simulator but not the phone.  That's ok, we don't need it

# NOTE: be sure to verify the tool versions below!

# Where to install
PREFIX=$HOME/src/MyProject/usr
GCCVERSION=4.0.1
SDKVERSION=2.2.1
DARWINVERSION=9

case $1 in
    arm)
        PLAT=/Developer/Platforms/iPhone.platform
        SDK=$PLAT/Developer/SDKs/iPhoneOS$SDKVERSION.sdk
        export CFLAGS="-arch armv6"
        export LDFLAGS="-arch armv6"
        CONFIGOPTS=(--build=`config.guess` --host=arm-apple-darwin9)
        GCCPREFIX=arm
        ;;
        
    i386)
        PLAT=/Developer/Platforms/iPhoneSimulator.platform
        SDK=$PLAT/Developer/SDKs/iPhoneSimulator$SDKVERSION.sdk
        export CFLAGS=
        export LDFLAGS=
        CONFIGOPTS=
        GCCPREFIX=i686
        ;;
    *)
        echo "Usage: $0 (arm|i386)"
        echo " and make sure to verify the SDK version & gcc version are correct"
        exit 1
        ;;
esac

export CFLAGS="$CFLAGS -isysroot $SDK"
BIN=$PLAT/Developer/usr/bin
export CPP=$BIN/cpp
export CXXCPP=$BIN/cpp
export CC=$BIN/$GCCPREFIX-apple-darwin$DARWINVERSION-gcc-$GCCVERSION
export CXX=$BIN/$GCCPREFIX-apple-darwin$DARWINVERSION-g++-$GCCVERSION
export LD=$BIN/ld
export AS=$BIN/as

cd libetpan-0.57
PATH=$BIN:$PATH ./configure --prefix=$PREFIX --disable-shared --enable-static --disable-db --without-sasl --without-gnutls --with-openssl=$PREFIX $CONFIGOPTS

PATH=$BIN:$PATH make


  reply	other threads:[~2009-05-05 18:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-30 12:14 Joel Reymont
2009-04-30 13:28 ` Sylvain Le Gall
2009-04-30 18:03   ` [Caml-list] " Stéphane Glondu
2009-04-30 19:19     ` Nathaniel Gray
2009-05-01 12:02       ` Mattias Engdegård
2009-05-01 18:27         ` Nathaniel Gray
2009-05-01 19:24           ` Mattias Engdegård
2009-05-01 22:12       ` Jeffrey Scofield
2009-05-02  0:07         ` [Caml-list] " Nathaniel Gray
2009-05-02 23:15           ` OCaml on iPhone (was: arm backend) Jeffrey Scofield
2009-05-03 12:34             ` [Caml-list] " Robert Muller
2009-05-05  4:59               ` OCaml on iPhone Jeffrey Scofield
2009-05-05  9:43 ` [Caml-list] arm backend Xavier Leroy
2009-05-05 18:21   ` Nathaniel Gray [this message]
2009-05-06  3:56   ` Jeffrey Scofield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aee06c9e0905051121v204e1d61sb92623769aa1e98f@mail.gmail.com \
    --to=n8gray@gmail.com \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=joelr1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).