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 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 A9F64BC69 for ; Wed, 21 Nov 2007 18:33:37 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAF/6Q0dQDPIRlmdsb2JhbACPNQEBAQEHAggREQc X-IronPort-AV: E=Sophos;i="4.21,447,1188770400"; d="scan'208";a="19544414" Received: from unknown (HELO smtp19.orange.fr) ([80.12.242.17]) by mail4-smtp-sop.national.inria.fr with ESMTP; 21 Nov 2007 18:33:37 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1913.orange.fr (SMTP Server) with ESMTP id 0A2046000040 for ; Wed, 21 Nov 2007 18:33:37 +0100 (CET) Received: from [192.168.1.59] (APuteaux-154-1-25-148.w83-199.abo.wanadoo.fr [83.199.80.148]) by mwinf1913.orange.fr (SMTP Server) with ESMTP id CE0D86000054; Wed, 21 Nov 2007 18:33:36 +0100 (CET) X-ME-UUID: 20071121173336844.CE0D86000054@mwinf1913.orange.fr Message-ID: <47446BE3.4070606@frisch.fr> Date: Wed, 21 Nov 2007 18:33:23 +0100 From: Alain Frisch User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: viktor tron Cc: Caml Mailing List Subject: Re: [Caml-list] C libs from Ocaml libs References: <8cc3d8520711202343q2951aee2lca188a185b84b511@mail.gmail.com> <4743FE39.9000208@frisch.fr> <8cc3d8520711210906k2c8ed0abg6f4305b275cddbf3@mail.gmail.com> In-Reply-To: <8cc3d8520711210906k2c8ed0abg6f4305b275cddbf3@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; frisch:01 frisch:01 libs:01 ocaml:01 libs:01 macos:01 powerpc:01 ocamlc:01 -output-obj:01 ocamlopt:01 -output-obj:01 foo:01 foo:01 stub:01 gcc:01 viktor tron wrote: > This is super! how is this on MacOS, I recall one of your comment earlier (on this list?) > that it doesn't work or something. Everything should work fine under Mac OS X x86. For PowerPC, I believe that "ocamlc -output-obj -o XXX.so" should be ok but that "ocamlopt -output-obj -o XXX.so" does not work. > well, I tried. > ar -rs foo_caml.o foo_stub.o > gcc -o foo_test.native foo_test.c -L. -lchainfreq_native -L/sw/lib/ocaml What is the name of the library you want to produce? > > * how do I create dynamic libs, dlls for windows? > > What do you want to put in your dynamic libs? If you want to create a > "stand-alone" dll with the OCaml runtime + arbitrary OCaml and C code, > the new behavior of "-output-obj -o XXX.{so,dll}" is/will be what > you want. > > > and not standalone ones? So, you want the OCaml code, but not the OCaml runtime? You can either use the -shared option to produce a .cmxs plugin (that must be explicitly loaded by the main program, using the OCaml Dynlink module), or -output-obj to produce a .o containing the OCaml code and the startup code for the OCaml side of your application. -- Alain