From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id E9562BC69 for ; Wed, 12 Sep 2007 12:08:36 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACNX50bVoHQYi2dsb2JhbACOFwEBCQIIDRo X-IronPort-AV: E=Sophos;i="4.20,243,1186351200"; d="scan'208";a="641109" Received: from smtp.ifl.telecomplete.net ([213.160.116.24]) by mail1-smtp-roc.national.inria.fr with ESMTP; 12 Sep 2007 12:08:51 +0200 Received: from [86.53.39.128] (helo=[192.168.1.24]) by smtp.ifl.telecomplete.net with esmtp (Exim 4.63) (envelope-from ) id 1IVP9P-0005MG-1f for caml-list@yquem.inria.fr; Wed, 12 Sep 2007 11:08:51 +0100 Mime-Version: 1.0 (Apple Message framework v752.3) Content-Transfer-Encoding: 7bit Message-Id: <7079E3A5-360C-402C-9F98-3E29C50D4186@bornat.me.uk> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: caml-list@yquem.inria.fr From: Richard Bornat Subject: Making OS X universal binaries Date: Wed, 12 Sep 2007 11:08:42 +0100 X-Mailer: Apple Mail (2.752.3) X-Spam: no; 0.00; ocaml:01 powerpc:01 ocaml:01 usr:01 ocamlopt:01 usr:01 lib:01 -nostdlib:01 lib:01 compilation:01 binaries:01 compile:01 bin:01 bin:01 archives:02 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