Release coccinelle-0.1.7
[bpt/coccinelle.git] / commons / readme.txt
1
2 This directory builds a common.cma library and also optionally
3 multiple commons_xxx.cma small libraries. The reason not to just build
4 a single one is that some functionnalities require external libraries
5 (like Berkeley DB, MPI, etc) or special version of OCaml (like for the
6 backtrace support) and I don't want to penalize the user by forcing
7 him to install all those libs before being able to use some of my
8 common helper functions. So, common.ml and other files offer
9 convenient helpers that do not require to install anything. In some
10 case I have directly included the code of those external libs when
11 there are simple such as for ANSITerminal in ocamlextra/, and for
12 dumper.ml I have even be further by inlining its code in common.ml so
13 one can just do a open Common and have everything. Then if the user
14 wants to, he can also leverage the other commons_xxx libraries by
15 explicitely building them after he has installed the necessary
16 external files.
17
18 For many configurable things we can use some flags in ml files,
19 and have some -xxx command line argument to set them or not,
20 but for other things flags are not enough as they will not remove
21 the header and linker dependencies in Makefiles. A solution is
22 to use cpp and pre-process many files that have such configuration
23 issue. Another solution is to centralize all the cpp issue in one
24 file, features.ml.cpp, that acts as a generic wrapper for other
25 librairies and depending on the configuration actually call
26 the external library or provide a fake empty services indicating
27 that the service is not present.
28 So you should have a ../configure that call cpp on features.ml.cpp
29 to set those linking-related configuration settings.
30