caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Making OS X universal binaries
@ 2007-09-12 10:08 Richard Bornat
  0 siblings, 0 replies; only message in thread
From: Richard Bornat @ 2007-09-12 10:08 UTC (permalink / raw)
  To: caml-list

I have a need to build a OS X universal binary of an OCaml program. I  
found out how to do it (apologies if this is already posted, but I  
couldn't find a solution in the archives).

1. Install the PowerPC version of OCaml. Squirrel away /usr/local/bin/ 
ocamlopt and /usr/local/lib/ocaml (I just added ppc to their names).

2. Install the Intel version of OCaml.

3. To make a ppc version of the program, compile with /usr/local/bin/ 
ocamloptppc (no need to add any extra arguments), and link with /usr/ 
local/bin/ocamloptppc -ccopt "-arch ppc" -nostdlib -I /usr/local/lib/ 
ocamlppc.

That's it. When you've made both versions, merge them with lipo. ppc  
compilation and loading is a bit slow, but that's the only drawback  
I've found.

Sorry again if this is a bit obvious ...

Richard Bornat


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-12 10:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-12 10:08 Making OS X universal binaries Richard Bornat

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).