permit multiline comments and strings in macros
[bpt/coccinelle.git] / install.txt
CommitLineData
755320b0
C
1 ** News **
2
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.
6
174d1640
C
7
8 ** Compilation **
9
10You must first install a recent version of
d6ce1786 11 - OCaml (at least 3.10),
34e49164 12 see http://caml.inria.fr/download.en.html
d6ce1786 13 At least, OCaml 3.12 is required to use the OCaml scripting
174d1640
C
14 feature in the SmPL code.
15 - The Menhir parser generator (at least 20080912),
34e49164
C
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)
34e49164 21
c491d8ee 22On Debian/Ubuntu, install the following packages
d6ce1786 23 - pkg-config (optional, but strongly recommended)
c491d8ee 24 - ocaml-native-compilers (or alternatively ocaml)
ca417fcf
C
25 - ocaml-findlib
26 - libpycaml-ocaml-dev
c491d8ee
C
27 - menhir and libmenhir-ocaml-dev
28
f537ebc4 29On Fedora, install the following packages
d6ce1786 30 - pkgconfig (optional, but strongly recommended)
755320b0 31 - chrpath
f537ebc4
C
32 - ocaml
33 - ocaml-findlib
755320b0
C
34 - ocaml-camlp4-devel
35 - ocaml-findlib-devel
36 - ocaml-ocamldoc
37 - ocaml-pcre-devel
f537ebc4 38
d6ce1786
C
39Note that on Fedora, there is currently not a
40package for menhir and pycaml. However, coccinelle
41bundles the sources of these packages and will use them
42when needed. The bundled pycaml package has support for
43python 3.
c491d8ee 44
174d1640 45Then simply type
d6ce1786 46 ./configure --enable-release
34e49164
C
47 make
48 make install
49
b1b2de81 50
d6ce1786
C
51Other 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
61 version of spatch
62See ./configure --help for more options
708f4980
C
63
64
65
d6ce1786
C
66
67When the --enable-release flag was given to ./configure, 'make' will
68build in release configuration (no debugging symbols, etc.). It
69defaults to the optimized version, unless --disable-opt is given
70to configure. You could use 'make opt-only' to compile the
71optimized version only. Similarly, you can use 'make byte-only' for
72the unoptimized version. 'make install' installs whichever version
73was compiled, and installs a script 'spatch' (the frontend) that invokes
74the 'best' one with proper environment variables.
75You can also use 'make world' to compile the bytecode
174d1640
C
76and the optimized code version.
77
d6ce1786
C
78Make targets of interest:
79opt-only, opt compiles just the optimized version
80byt-only, byte compiles just the bytecode version
81world compiles both + frontends + docs
82all-release compiles the optimized version + frontends + docs
83all-dev compiles the bytecode version + frontends
84all default target: alias for either all-dev or all-release
85all.opt compiles the optimized version + frontends
86check run tests (note: not all tests are expected to succeed)
87As these make targets may change in the future, it is preferred to set the
88appropriate default using the --enable-release flag.
89
174d1640
C
90We provide the files generated by menhir in the tarball. However,
91'make distclean' will remove them. You could either restore them from
92the tarball or install menhir. Using 'make clean' should be safe with
93regards to these files.
94
95Note: The test target is intended for developers. In particular, you
96 should not expect that every test will pass.
97
d6ce1786 98In order to use the OCaml scripting feature in SmPL, you must compile
abad11c5
C
99Coccinelle with at least OCaml version 3.11. An extra file, coccilib.cmi,
100is produced and installed in /usr/share/cocci/ocaml, which is needed for
101the compilation of ocaml scripts.
174d1640 102
aba5c457
C
103
104 ** Bash integration **
105
106 To have completion under Bash, you can execute the following command:
107
108 make install-bash
109
110 It will install the shell script 'scripts/spatch.bash_completion'
111 in /etc/bash_completion.d/spatch
112
113 You can manually copy that file elsewhere if you have a different
114 bash_completion directory.
115
116
117
174d1640
C
118 ** Runtime dependencies **
119
120 - Basic shell commands:
121 - ls, cat, cp, mv, rm, grep, mkdir, find
122 - Developper tool: diff
123
124
125 ** Optional runtime dependencies **
126
127 - To quickly apply the semantic patches
128 - glimpse indexer
129
130 - To use OCaml scripting feature in SmPL
131 - ocaml-native-compilers or ocaml-nox
132 - ocaml-findlib
133
134 - To generate a PDF of the control flow graph with '-graphical_trace'
135 - pdftk and graphviz (with PDF support)
136
d6ce1786
C
137If runtime tools are not in $PATH, paths to some
138of them can be specified with 'configure' or via
139commandline parameters to spatch.
140
174d1640 141
708f4980 142
174d1640 143 ** Dependencies for additional tools **
9f8e26f4 144
174d1640 145 git, pushd, popd, sed, diffstat, cpp
aba5c457
C
146
147 ** Uninstall **
148
149 To uninstall Coccinelle, you should use the following command
150
151 make uninstall
152
153
154 To also remove the bash completion script, run
155
156 make uninstall-bash