caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Linking order with Ocamlbuild
@ 2009-07-07 16:11 Dario Teixeira
  2009-07-11  7:46 ` [Caml-list] " ygrek
  0 siblings, 1 reply; 2+ messages in thread
From: Dario Teixeira @ 2009-07-07 16:11 UTC (permalink / raw)
  To: caml-list


Hi,

I am using the custom myocamlbuild.ml for ocamlfind support that is listed
in the Ocamlbuild wiki [1].  I would like to separate the list of packages
used for compilation and for linking; and in the latter case I would like
to provide an explicit linking order.  This is what I'm currently listing
in _tags:

<**/main.native>: pkg_a, pkg_b, pkg_c
<**/*.ml>: pkg_b, pkg_c

Which is neither particularly pretty nor actually working.  Namely, during
the linking stage, ocamlbuild is invoking "-package b -package a".  This is
in the wrong order, and different from the one I specified.  Is there any
straightforward way to fix it?

Thanks for your thoughts!
Cheers,
Dario

[1] http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild






^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] Linking order with Ocamlbuild
  2009-07-07 16:11 Linking order with Ocamlbuild Dario Teixeira
@ 2009-07-11  7:46 ` ygrek
  0 siblings, 0 replies; 2+ messages in thread
From: ygrek @ 2009-07-11  7:46 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 691 bytes --]

On Tue, 7 Jul 2009 09:11:23 -0700 (PDT)
Dario Teixeira <darioteixeira@yahoo.com> wrote:

> <**/main.native>: pkg_a, pkg_b, pkg_c
> <**/*.ml>: pkg_b, pkg_c
> 
> Which is neither particularly pretty nor actually working.  Namely, during
> the linking stage, ocamlbuild is invoking "-package b -package a".  This is
> in the wrong order, and different from the one I specified.  Is there any
> straightforward way to fix it?
 
As far as I observed ocamlbuild preserves the same order of libraries at the linking stage
that was used when introducing those libraries in myocamlbuild.ml (namely with ocaml_lib).
So try to sort the output of find_packages as you need.

-- 
 ygrek

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-11  7:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-07 16:11 Linking order with Ocamlbuild Dario Teixeira
2009-07-11  7:46 ` [Caml-list] " ygrek

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).