Okay, thanks, that does make sense. I'm curious now as to what the use case is for a .mllib file that just defines an internal library. It doesn't seem to be buying me anything if I don't want to compile the library separately and use it in a different project.

martin

On Tue, Sep 22, 2015 at 12:45 AM, Gabriel Scherer <gabriel.scherer@gmail.com> wrote:
The compiler allows to store C compilation flags in library archives,
but not OCaml-level flags, and in any case that would be a dubious
idea as hardcoding the path to the ocamlfind packages on your system
would make the (bytecode) archive libraries less portable.

You can easily define the packages of the final executable in several
steps, one per plugin:

  <plugin1/**> or <main.*>: package(foo)
  ...
  <plugin2/**> or <main.*>: package(bar)

Finally, you could also distribute each of your plugin as a separate
ocamlfind package (allowing to combine both the link to the archive(s)
and information about ocamlfind dependencies in a single place, the
package's META file), but that requires re-installing a package for
its changes to be visible from the main program -- so it is probably
more useful for libraries that are less tightly coupled.

On Tue, Sep 22, 2015 at 9:09 AM, Martin DeMello <martindemello@gmail.com> wrote:
> On Mon, Sep 21, 2015 at 11:58 PM, Gabriel Scherer
> <gabriel.scherer@gmail.com> wrote:
>>
>> > I don't (yet) need dynamic linking; my current main aim with the .mllib
>> > setup is to specify the package dependencies for each plugin in its > own
>> > section of the _tags file, and not have a long list of every plugin's
>> > dependencies in the main module.
>>
>> Well, that doesn't quite work: you need to have the ocamlfind packages
>> passed to the command linking the final executable.
>>
>> I suppose changing
>>   <**/puz.*>: ...
>> to
>>   <**/puz.*> or <file.*>: ...
>> could work, as this line seems to pass all the libraries flags.
>
>
> Isn't there any way with a .cmxa to compile the dependencies into a library
> and then just have the library as a link-time dependency for the main
> project? I can imagine things getting pretty messy once I have several
> plugins and have to concatenate all their package deps into the file.* tags
> line.
>
> martin