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=2.8 required=5.0 tests=AWL,DNS_FROM_RFC_POST, DNS_FROM_SECURITYSAGE,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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 38C75BBAF for ; Sun, 16 Nov 2008 21:38:00 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgCAIYTIEnAXQImgWdsb2JhbACMQocVAQEWIq5KiiiCeQ X-IronPort-AV: E=Sophos;i="4.33,615,1220220000"; d="scan'208";a="19233728" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 16 Nov 2008 21:37:59 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id mAGKbxGF024458 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sun, 16 Nov 2008 21:37:59 +0100 X-IronPort-AV: E=Sophos;i="4.33,615,1220220000"; d="scan'208";a="20010363" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail1-relais-roc.national.inria.fr with SMTP; 16 Nov 2008 21:37:59 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Sun, _d Nov 2008 21:37:05 +0100 From: "Nicolas Pouillard" Content-Type: text/plain; charset=UTF-8 Cc: caml-list Subject: Re: [Caml-list] ocamlbuild and installed modules and libraries To: "daniel.buenzli" References: <6C9617AA-8360-4857-9BC0-EB13ACBEF8AD@erratique.ch> In-Reply-To: <6C9617AA-8360-4857-9BC0-EB13ACBEF8AD@erratique.ch> Date: Sun, 16 Nov 2008 21:37:05 +0100 Message-Id: <1226867823-sup-903@ausone.local> User-Agent: Sup/git X-Miltered: at discorde with ID 492084A7.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lib:01 lib:01 overkill:01 cmx:01 ocamlc:01 -where:01 caml-list:01 modules:02 simplest:02 native:03 native:03 seems:03 module:03 module:03 dynamic:03 Excerpts from daniel.buenzli's message of Sun Nov 16 19:22:02 +0100 2008: > Hello, > > Is it possible to specify a single installed module (instead of a lib) > for link time ? That is is there something like -lib but for module so > that I can type : > > ocamlbuild -I +xmlm -mod xmlm test.native > > where test.ml uses the xmlm module This would make sense, but I would prefer not to push things in this direction. Options like -lib,-cflag,-lflag... are intended to be used only in a quick hack usage, indeed they are global and tags are much more powerful. > And what about having special tags use_lib_$LIB and use_mod_$MOD that > automatically create rules to use libraries $LIB.cm(x)a and module > $MOD.cm(o|x) so that just the appropriate -I to find the files has to > be specified. In most cases having to use a plugin just for that seems > overkill. Or is there another way ? I'm a bit uncomfortable with this kind of dynamic or special tags. However the simplest solution to your problem is probably one of those: 1/ ocamlbuild -cflags -I,+xmlm,xmlm.cmx test.native 2/ ln -s xmlm ocamlbuild -I xmlm test.native 3/ ln -s $(ocamlc -where)/xmlm . ocamlbuild -tag_line '"xmlm": not_hygienic' -I xmlm test.native Hope that helps, -- Nicolas Pouillard aka Ertai