3 - Coccinelle no longer needs ocaml-sexplib nor ocaml-extlib.
4 - Parallel building is possible when you do not build the bytecode
5 and native version of spatch simultaneously.
10 You must first install a recent version of
11 - OCaml (at least 3.10),
12 see http://caml.inria.fr/download.en.html
13 At least, OCaml 3.12 is required to use the OCaml scripting
14 feature in the SmPL code.
15 - The Menhir parser generator (at least 20080912),
16 see http://cristal.inria.fr/~fpottier/menhir/
17 (unless you got a version of the coccinelle source with
18 the SmPL parser pre-generated)
19 - Python and its development files (python-dev)
20 (unless you run configure with the --without-python option)
22 On Debian/Ubuntu, install the following packages
23 - pkg-config (optional, but strongly recommended)
24 - ocaml-native-compilers (or alternatively ocaml)
27 - menhir and libmenhir-ocaml-dev
29 On Fedora, install the following packages
30 - pkgconfig (optional, but strongly recommended)
39 Note that on Fedora, there is currently not a
40 package for menhir and pycaml. However, coccinelle
41 bundles the sources of these packages and will use them
42 when needed. The bundled pycaml package has support for
46 ./configure --enable-release
51 Other configuration flags of interest:
52 --prefix default: /usr/local
53 --disable-opt build the bytecode version
54 --with-python=PATH choose a specific python executable
55 --without-python no python scripting
56 --disable-ocaml no ocaml scripting
57 --disable-pycaml uses the bundled pycaml package instead of
58 a installed pycaml package.
59 --disable-pcre-syntax no pcre regexp syntax
60 --enable-release=world builds the optimized and unoptimized
62 See ./configure --help for more options
67 When the --enable-release flag was given to ./configure, 'make' will
68 build in release configuration (no debugging symbols, etc.). It
69 defaults to the optimized version, unless --disable-opt is given
70 to configure. You could use 'make opt-only' to compile the
71 optimized version only. Similarly, you can use 'make byte-only' for
72 the unoptimized version. 'make install' installs whichever version
73 was compiled, and installs a script 'spatch' (the frontend) that invokes
74 the 'best' one with proper environment variables.
75 You can also use 'make world' to compile the bytecode
76 and the optimized code version.
78 Make targets of interest:
79 opt-only, opt compiles just the optimized version
80 byt-only, byte compiles just the bytecode version
81 world compiles both + frontends + docs
82 all-release compiles the optimized version + frontends + docs
83 all-dev compiles the bytecode version + frontends
84 all default target: alias for either all-dev or all-release
85 all.opt compiles the optimized version + frontends
86 check run tests (note: not all tests are expected to succeed)
87 As these make targets may change in the future, it is preferred to set the
88 appropriate default using the --enable-release flag.
90 We provide the files generated by menhir in the tarball. However,
91 'make distclean' will remove them. You could either restore them from
92 the tarball or install menhir. Using 'make clean' should be safe with
93 regards to these files.
95 Note: The test target is intended for developers. In particular, you
96 should not expect that every test will pass.
98 In order to use the OCaml scripting feature in SmPL, you must compile
99 Coccinelle with at least OCaml version 3.11. An extra file, coccilib.cmi,
100 is produced and installed in /usr/share/cocci/ocaml, which is needed for
101 the compilation of ocaml scripts.
104 ** Bash integration **
106 To have completion under Bash, you can execute the following command:
110 It will install the shell script 'scripts/spatch.bash_completion'
111 in /etc/bash_completion.d/spatch
113 You can manually copy that file elsewhere if you have a different
114 bash_completion directory.
118 ** Runtime dependencies **
120 - Basic shell commands:
121 - ls, cat, cp, mv, rm, grep, mkdir, find
122 - Developper tool: diff
125 ** Optional runtime dependencies **
127 - To quickly apply the semantic patches
130 - To use OCaml scripting feature in SmPL
131 - ocaml-native-compilers or ocaml-nox
134 - To generate a PDF of the control flow graph with '-graphical_trace'
135 - pdftk and graphviz (with PDF support)
137 If runtime tools are not in $PATH, paths to some
138 of them can be specified with 'configure' or via
139 commandline parameters to spatch.
143 ** Dependencies for additional tools **
145 git, pushd, popd, sed, diffstat, cpp
149 To uninstall Coccinelle, you should use the following command
154 To also remove the bash completion script, run