caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dario Teixeira <darioteixeira@yahoo.com>
To: Romain Bardou <Romain.Bardou@lri.fr>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Ocamlbuild with findlib + camlp4
Date: Fri, 7 Mar 2008 14:46:56 +0000 (GMT)	[thread overview]
Message-ID: <904598.33624.qm@web54607.mail.re2.yahoo.com> (raw)
In-Reply-To: <47D10A4B.7000904@lri.fr>

Hi,

Thanks for your help.  I think we're getting closer to creating a generic
Ocamlbuild plugin that adds support for Findlib.  However, I'm also beginning
to suspect that actually getting there -- creating a true generic solution --
might not be at all possible with the current Ocamlbuild.


> * The "pkg_nums", "pkg_str", and "pkg_unix" tags (simply add packages to 
> the "packages" list if you need other packages) which add the "-package 
> nums", "-package str" and "-package unix" options respectively. Tag your 
> source files with the -package options they should use when compiling, 
> and your output files with the -package options they should use when 
> linking.

Your idea can be extended to create a plugin that supports any of the
packages available through Findlib.  Just query Findlib for a list of
packages:

let packages =
        Findlib.init ();
        Fl_package_base.list_packages ()


While in theory this should work, it's still a brute force approach.
Mind you, my initial idea was that when finding a tag of the form
"pkg_foobar" (the actual syntax could be "pkg(foobar)" or something
like that), Ocamlbuild would dynamically add a new rule for that
package.  Your solution statically adds all possible rules at the
time the plugin is compiled  (and the patch I suggest above is even
more extreme in this regard).

Now, if you ask what's so bad about explicitly listing all packages in
myocamlbuild.ml, the answer is that it forces users to write a plugin
if they want to use findlib.  Personally, I think that findlib support
is so essential that one shouldn't be forced to write plugins in order
to use it.


> * It does nothing to handle camlp4, but you should be able to add the 
> correct options yourself.
> 
> Please tell me if it is what you needed or not :)

I'm finding that adding camlp4 support is where things get messy:
Ocamlbuild's default rules conflict with findlib's.  I am yet to
find a solution that manages to integrate the three successfully.

Kind regards,
Dario Teixeira



      __________________________________________________________
Sent from Yahoo! Mail.
The World's Favourite Email http://uk.docs.yahoo.com/nowyoucan.html


  reply	other threads:[~2008-03-07 14:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 13:41 Dario Teixeira
2008-03-05 15:08 ` [Caml-list] " Romain Bardou
2008-03-06 15:31   ` Dario Teixeira
2008-03-06 15:46     ` Pietro Abate
2008-03-06 19:45       ` Dario Teixeira
2008-03-06 22:14         ` Pietro Abate
2008-03-07  9:26     ` Romain Bardou
2008-03-07 14:46       ` Dario Teixeira [this message]
2008-03-07 15:01         ` Nicolas Pouillard
2008-03-07 16:12           ` Dario Teixeira
2008-03-08 11:36             ` Nicolas Pouillard
2008-03-10 15:33               ` Dario Teixeira
2008-03-10 16:15                 ` Romain Bardou
2008-03-10 21:13                   ` Dario Teixeira
2008-03-10 19:56                 ` Arnaud Spiwack
2008-03-10 21:15                   ` Dario Teixeira
2008-03-11 10:37                 ` Nicolas Pouillard
2008-03-11 13:49                   ` Romain Bardou
2008-03-11 15:03                     ` Romain Bardou
2008-03-11 17:32                   ` Dario Teixeira
2008-03-11 20:17                     ` Richard Jones
2008-03-11 10:41       ` Nicolas Pouillard

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=904598.33624.qm@web54607.mail.re2.yahoo.com \
    --to=darioteixeira@yahoo.com \
    --cc=Romain.Bardou@lri.fr \
    --cc=caml-list@yquem.inria.fr \
    /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).