English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Howto link cmas with Ocamlbuild
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-10-28 (11:41)
From: Vincent Balat <vincent.balat@u...>
Subject: Re: [Caml-list] Howto link cmas with Ocamlbuild

It is not a good idea to include batteries and sexplib in your cma.

If your cma is a findlib package (i.e. has a META file with the right 
dependencies inside), Ocsigen server will automatically load the dependencies 
if you write
<library findlib-package="yourpackage"/>
<eliom findlib-package="yourpackage" />
in Ocsigen server's configuration file.

If your package does not have a META file, you need to load batteries and 
sexplib manually:
<library findlib-package="batteries"/>
<library findlib-package="sexplib"/>


> Hi,
> I am working on a small project that is going to include a dynamic
> webserver using Ocsigen and Eliom. I am using Ocamlbuild for the
> compilation. The project is also going to use Batteries and Sexplib. This
> means I need to include Sexplib and Batteries within the .cma file for
> Ocsigen to find the libraries. However when I use the Myocamlbuild plugin
> for Batteries the rules for linking cmas wont use linkpkg flag. Right now
> I compile the full project using ocamlbuild and then I have to repeat the
> last step manually. Is there a better way, to get ocamlbuild to include
> the necessary libraries in the .cma?
> Thank you,
>    Till