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