caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* generating .cma-files with ocamlbuild
@ 2007-03-24 15:11 Christian Sternagel
  2007-03-24 15:26 ` [Caml-list] " Alain Frisch
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Sternagel @ 2007-03-24 15:11 UTC (permalink / raw)
  To: caml-list

Is there an easy way to tell ocamlbuild that it should
take some *.ml and *.mli files and build an archive
<name>.cma out of them?

Btw: I have another question concerning *.cma files.
Maybe an example is the easiest way to express this
question.

There are files:
set.mli set.ml setInternal.ml a.mli a.ml

I want to create the file util.cma which contains
set.cmo, setInternal.cmo, and a.cmo.

set.cmo uses setInternal.cmo but the user should
only be able to access modules Set and A but not
SetInternal. As far as I understud, this is done by
just providing set.cmi and a.cmi together with
util.cma.

Questions:
1) Is my understandung correct?
2) Can there be a problem if somebody using util.cma
(who does not know, that setInternal.cmo is part of
it) uses a self-made module by the name SetInternal
in his application?

cheers

christian


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

* Re: [Caml-list] generating .cma-files with ocamlbuild
  2007-03-24 15:11 generating .cma-files with ocamlbuild Christian Sternagel
@ 2007-03-24 15:26 ` Alain Frisch
  0 siblings, 0 replies; 2+ messages in thread
From: Alain Frisch @ 2007-03-24 15:26 UTC (permalink / raw)
  To: Christian Sternagel; +Cc: caml-list

Christian Sternagel wrote:
> Is there an easy way to tell ocamlbuild that it should
> take some *.ml and *.mli files and build an archive
> <name>.cma out of them?

Yes, just create a .mllib file that lists all the modules you want to
include in the .cma.

> 1) Is my understandung correct?

Yes, it is.

> 2) Can there be a problem if somebody using util.cma
> (who does not know, that setInternal.cmo is part of
> it) uses a self-made module by the name SetInternal
> in his application?

Indeed, the linker will complain about incompatible interfaces for the
same module name.


-- Alain


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

end of thread, other threads:[~2007-03-24 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-24 15:11 generating .cma-files with ocamlbuild Christian Sternagel
2007-03-24 15:26 ` [Caml-list] " Alain Frisch

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