caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: "daniel.buenzli" <daniel.buenzli@erratique.ch>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] ocamlbuild and installed modules and libraries
Date: Sun, 16 Nov 2008 21:37:05 +0100	[thread overview]
Message-ID: <1226867823-sup-903@ausone.local> (raw)
In-Reply-To: <6C9617AA-8360-4857-9BC0-EB13ACBEF8AD@erratique.ch>

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 <sources-of-xmlm> 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


  reply	other threads:[~2008-11-16 20:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-16 18:22 Daniel Bünzli
2008-11-16 20:37 ` Nicolas Pouillard [this message]
2008-11-17  9:20   ` [Caml-list] " Daniel Bünzli
2008-11-17  9:54     ` Romain Bardou
2008-11-17 10:07       ` Daniel Bünzli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226867823-sup-903@ausone.local \
    --to=nicolas.pouillard@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@erratique.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).