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
--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs