caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Michael Ekstrand <michael@elehack.net>
To: caml-list@inria.fr
Subject: [Caml-list] ocamlbuild: build-only dependencies on syntax extensions
Date: Thu, 23 Jun 2011 08:05:17 -0500	[thread overview]
Message-ID: <4E033A0D.5010300@elehack.net> (raw)

In my source tree, I build a few syntax extensions which are then used
to compile other modules.  I do this as follows:

      flag_and_dep ["ocaml"; "ocamldep"; "use_lll"] &
        S[A"-ppopt"; P"pa_lll.cma"];
      flag_and_dep ["ocaml"; "compile"; "use_lll"] &
        S[A"-ppopt"; P"pa_lll.cma"];

Now, when I try to build the bytecode version of the program, it tries
to link the syntax extension into the final program.  When I use the
syntax extensions as '.cma' files, the linker doesn't actually include
anything from them since their modules are not depended on by anything. 
However, if I use them as '.cmo' files, it does fail because the linker
attempts to unconditionally include them.

Ideally, the linker would not even try to include them because they are
only a compile-time dependency, not a runtime dependency.

Is there something I can do in my ocamlbuild plugin to exclude the
syntax extensions from being link-time dependencies, short of building
them out-of-tree and using ocamlfind to bring them back in?  Is this a
bug (or missing feature) in ocamlbuild?

I've played with non_dependency a bit, but if it's what I need I haven't
found the magic incantation it requires to accomplish the purpose.

Thanks,
- Michael

             reply	other threads:[~2011-06-23 13:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-23 13:05 Michael Ekstrand [this message]
2011-06-23 19:50 ` Michael Ekstrand

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=4E033A0D.5010300@elehack.net \
    --to=michael@elehack.net \
    --cc=caml-list@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).