4 You must first install a recent version of
5 - OCaml (at least 3.10),
6 see http://caml.inria.fr/download.en.html
7 At least, OCaml 3.12 is required to use the OCaml scripting
8 feature in the SmPL code.
9 - The Menhir parser generator (at least 20080912),
10 see http://cristal.inria.fr/~fpottier/menhir/
11 (unless you got a version of the coccinelle source with
12 the SmPL parser pre-generated)
13 - Python and its development files (python-dev)
14 (unless you run configure with the --without-python option)
16 On Debian/Ubuntu, install the following packages
17 - pkg-config (optional, but strongly recommended)
18 - ocaml-native-compilers (or alternatively ocaml)
21 - libsexplib-camlp4-dev
22 - menhir and libmenhir-ocaml-dev
24 On Fedora, install the following packages
25 - pkgconfig (optional, but strongly recommended)
30 Note that on Fedora, there is currently not a
31 package for menhir and pycaml. However, coccinelle
32 bundles the sources of these packages and will use them
33 when needed. The bundled pycaml package has support for
37 ./configure --enable-release
42 Other configuration flags of interest:
43 --prefix default: /usr/local
44 --disable-opt build the bytecode version
45 --with-python=PATH choose a specific python executable
46 --without-python no python scripting
47 --disable-ocaml no ocaml scripting
48 --disable-pycaml uses the bundled pycaml package instead of
49 a installed pycaml package.
50 --disable-pcre-syntax no pcre regexp syntax
51 --enable-release=world builds the optimized and unoptimized
53 See ./configure --help for more options
58 When the --enable-release flag was given to ./configure, 'make' will
59 build in release configuration (no debugging symbols, etc.). It
60 defaults to the optimized version, unless --disable-opt is given
61 to configure. You could use 'make opt-only' to compile the
62 optimized version only. Similarly, you can use 'make byte-only' for
63 the unoptimized version. 'make install' installs whichever version
64 was compiled, and installs a script 'spatch' (the frontend) that invokes
65 the 'best' one with proper environment variables.
66 You can also use 'make world' to compile the bytecode
67 and the optimized code version.
69 Make targets of interest:
70 opt-only, opt compiles just the optimized version
71 byt-only, byte compiles just the bytecode version
72 world compiles both + frontends + docs
73 all-release compiles the optimized version + frontends + docs
74 all-dev compiles the bytecode version + frontends
75 all default target: alias for either all-dev or all-release
76 all.opt compiles the optimized version + frontends
77 check run tests (note: not all tests are expected to succeed)
78 As these make targets may change in the future, it is preferred to set the
79 appropriate default using the --enable-release flag.
81 We provide the files generated by menhir in the tarball. However,
82 'make distclean' will remove them. You could either restore them from
83 the tarball or install menhir. Using 'make clean' should be safe with
84 regards to these files.
86 Note: The test target is intended for developers. In particular, you
87 should not expect that every test will pass.
89 In order to use the OCaml scripting feature in SmPL, you must compile
90 Coccinelle with at least OCaml version 3.11.
94 ** Bash integration **
96 To have completion under Bash, you can execute the following command:
100 It will install the shell script 'scripts/spatch.bash_completion'
101 in /etc/bash_completion.d/spatch
103 You can manually copy that file elsewhere if you have a different
104 bash_completion directory.
108 ** Runtime dependencies **
110 - Basic shell commands:
111 - ls, cat, cp, mv, rm, grep, mkdir, find
112 - Developper tool: diff
115 ** Optional runtime dependencies **
117 - To quickly apply the semantic patches
120 - To use OCaml scripting feature in SmPL
121 - ocaml-native-compilers or ocaml-nox
124 - To generate a PDF of the control flow graph with '-graphical_trace'
125 - pdftk and graphviz (with PDF support)
127 If runtime tools are not in $PATH, paths to some
128 of them can be specified with 'configure' or via
129 commandline parameters to spatch.
133 ** Dependencies for additional tools **
135 git, pushd, popd, sed, diffstat, cpp
139 To uninstall Coccinelle, you should use the following command
144 To also remove the bash completion script, run