Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
ocamlbuild and c libs
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alan Falloon <alan.falloon@m...>
Subject: Re: ocamlbuild and c libs
Daniel Bünzli wrote:
> Is it possible to specify build flags and deps in a compositional way ? 
> That is I have C bindings in a libdip/ dir, I would like to specify the 
> additional flags and dep there, not in the toplevel I 
> tried to make the toplevel plugin refer to external modules but it seems 
> to be compiled in a restricted environement. I also tried to define a 
> in libdip/ but it seems to be ignored. Is there 
> something like a plugin hierarchy as with the _tag files ?

This is something that I am interested in as well. With this change plus 
a couple of other small changes you would be able to make a project that 
compiles on its own in ocamlbuild, or as a subdirectory of another 
project. It would be very useful when working on separate, but 
dependent, projects.

Another useful addition would be to pass the include flags when 
compiling c stubs. Right now, you need to write a plugin even if you 
only want to include the other project directories.

> By the way I couldn't find it in the documentation but ocamlbuild 
> ignores any directory starting with an underscore even if you include it 
> explictly with a tag, is that right ?

I don't know if its intended, but the code is pretty clearly doing 
exactly what you describe:

(String.length name > 0 && name.[0] <> '_' && not (List.mem name