Version française
Home     About     Download     Resources     Contact us    
Browse thread
ocamlbuild -> toplevel
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Matthieu Dubuget <matthieu.dubuget@g...>
Subject: Re: ocamlbuild -> toplevel
I replied off-list to Nicolas (by mistake) in order to insist, because
my question was not clear enough.

After some more readings, I would say that my goal was to generate a
custom toplevel by linking an
"internal" library ("internal" is the term used on ocamlbuild wiki for
libraries built by ocamlbuild).

> Yes names in .mltop, .mlpack, .mllib are all module names only.
>
> However you can try to add:
>
>   use_lib "my" "pilot"
>
> To your myocamlbuild.ml.

This solution did not the job. From the documentation, it is not clear
to me what "use_lib" does exactly.
But I think it adds pilot.cm(x)a when linking my.cmo?

In my case, there are simply no my.cmo... I could have use the standard
toplevel and loaded pilot.cma.
Anyway, I found a solution:

I added: ocaml_lib "pilot" in my ocamlbuild.ml and I tagged my.top with
use_pilot in the _tags file.

And since I have no module to include in my toplevel, I generated a void
my.mltop file.

Salutations

P.S. During the process, I also used a copy of the myocamlbuild I found
on the wiki to use ocamlfind.
       I had to add one line for the ocamlmktop command :
Options.ocamlmktop := ocamlfind & A"ocamlmktop"