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=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 9344EBB84 for ; Sat, 27 Sep 2008 21:49:05 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArgDAIMr3khQRFuwiGdsb2JhbACTLwEBARUipXyBZw X-IronPort-AV: E=Sophos;i="4.33,322,1220220000"; d="scan'208";a="29658053" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 27 Sep 2008 21:48:56 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1Kjfmg-00030m-MX; Sat, 27 Sep 2008 20:48:54 +0100 Date: Sat, 27 Sep 2008 20:48:54 +0100 To: Joel Reymont Cc: O'Caml Mailing List Subject: Re: [Caml-list] embedding ocaml into a windows app: need gcc? Message-ID: <20080927194854.GA11374@annexia.org> References: <1253374D-FC84-4394-99E5-46C02D26C54C@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1253374D-FC84-4394-99E5-46C02D26C54C@gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Spam: no; 0.00; ocaml:01 gcc:01 0100,:01 gcc:01 ocaml:01 compiler:01 compiler:01 iirc:01 runtime:01 runtime:01 ocamlopt:01 -fpic:01 ocamlc:01 dynlink:01 dynlink:01 On Sat, Sep 27, 2008 at 08:27:18PM +0100, Joel Reymont wrote: > Can I do without gcc if I want to embed the OCaml compiler into a > commercial Windows app? The OCaml compiler uses gcc in various stages (linking IIRC). Also needs an assembler. > Do I need to become part of the OCaml consortium to do this? You certainly need to read the license very carefully. However is it necessary to embed the compiler? Can you not just call out to the compiler as a separate process? It's surely easier to do Sys.command, rather than working out the licensing and technical issues involved in linking your program to the compiler. > Ideally, I would like to generate OCaml code at runtime and compile it > into something that can be loaded by a runtime of some sort. > > Compiling into a DLL would be ideal, is it possible? ocamlopt -fPIC ... should be able to do it. Or compile the code with ocamlc and use Dynlink. Or wait for OCaml 3.11 which can use Dynlink on native code. Rich. -- Richard Jones Red Hat