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=1.1 required=5.0 tests=AWL,SPF_NEUTRAL 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 3B07ABC69 for ; Wed, 21 Nov 2007 13:54:04 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAIK4Q0fAXQImh2dsb2JhbACPNQEBAQgKKQ X-IronPort-AV: E=Sophos;i="4.21,446,1188770400"; d="scan'208";a="19533175" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 21 Nov 2007 13:54:03 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id lALCs18v010777 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 21 Nov 2007 13:54:03 +0100 X-IronPort-AV: E=Sophos;i="4.21,446,1188770400"; d="scan'208";a="6038064" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail3-relais-sop.national.inria.fr with SMTP; 21 Nov 2007 13:54:03 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Wed, _d Nov 2007 13:53:16 +0100 From: "Nicolas Pouillard" Cc: caml-list Subject: Re: [Caml-list] How can I convince ocamlbuild to link a library instead of object files? To: "alan.falloon" References: In-Reply-To: Date: Wed, 21 Nov 2007 13:53:16 +0100 Message-Id: <1195649417-sup-3332@port-ext2.ensta.fr> User-Agent: Sup/0.2 Content-Type: text/plain; charset=UTF-8 X-Miltered: at discorde with ID 47442A69.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 byte:01 cmo:01 cmo:01 bytecode:01 lib:01 ocaml:01 lib:01 binaries:01 binaries:01 caml-list:01 cma:01 alan:02 linking:02 native:03 Excerpts from alan.falloon's message of Wed Oct 17 17:10:21 +0200 2007: > I am working on a project in ocaml that has a number of libraries that > it depends on that are being concurrently developed. > > I can easily set up ocamlbuild to build the binaries and the libraries, > however the binaries are always built from the object files that are > packed into the library even if I tell it to link in the library via a > plugin. > > I have attached an interactive script (lightly edited for clarity). The > thing to notice is that when it links main.byte it still includes > hello.cmo and world.cmo even though they are in hw.cma. This works for > the bytecode linking, but its a disaster for native code. > > Is there some way to remove the object files from the link line in the > plugin? or am I missing some trick? It doesn't matter if the library > sources are in a different directory, if its included (and it has to be > included or ocamlbuild won't build the lib) then ocamlbuild will find > the object files and use them. (Sorry for the late reply) Can you try to declare the library using the ocaml_lib function. Something like <> in your myocamlbuild.ml, otherwise the use_hw tag is not used. HTH, -- Nicolas Pouillard aka Ertai