permit multiline comments and strings in macros
[bpt/coccinelle.git] / configure.ac
1 dnl run 'autoreconf' to obtain aclocal.m4, and update configure and setup/pkg.m4
2 dnl run 'automake -acf' to update setup/{install-sh,missing}
3
4 dnl standard initialization (we only use autoconf not automake)
5 AC_PREREQ([2.68])
6 AC_INIT([coccinelle], m4_esyscmd([cat ./version | tr -d '\n']), [cocci@diku.dk], [], [http://coccinelle.lip6.fr/])
7 AC_CONFIG_MACRO_DIR([setup])
8 AC_CONFIG_AUX_DIR([setup])
9 AC_SUBST([CONFIGURE_FLAGS], ["$*"])
10 AC_SUBST([COCCI_VERSION], ["$PACKAGE_VERSION"])
11 AC_SUBST([COCCI_SRCDIR], ["$(pwd)"])
12 AC_MSG_NOTICE([configuring coccinelle $COCCI_VERSION in $COCCI_SRCDIR])
13 AM_INIT_AUTOMAKE
14
15 AC_CONFIG_SRCDIR([cocci.ml]) dnl this file must be present in our src directory
16 AC_COCCI_CONFVERSION
17
18 dnl reminder that this configure depends on macros generated by aclocal
19 AC_MSG_NOTICE([this configure program uses pkg-config m4 macros])
20 AC_MSG_NOTICE([this configure program uses ocaml m4 macros (see setup/ocaml.m4)])
21 AC_MSG_NOTICE([this configure program uses custom m4 macros (see setup/cocci.m4)])
22 AC_MSG_NOTICE([some fake substitutions for required but unavailable programs may be used (see setup/fake*)])
23
24
25 dnl
26 dnl Note: the conditionals in this configure script are tricky.
27 dnl The approach taken here is that many tools can be enabled/disabled
28 dnl and paths can be given explicitly via commandline parameters or
29 dnl environment variables.
30 dnl
31
32
33 dnl
34 dnl Basic tools
35 dnl
36
37 AC_MSG_NOTICE([verifying basic tools])
38
39 AC_PROG_INSTALL
40 AC_PROG_MKDIR_P
41 AC_PROG_CPP
42 AC_PATH_PROG([TAR],[tar])
43 AC_PATH_PROG([PATCH],[patch])
44
45 dnl ensures that INSTALL points to an absolute install-sh when that one is configured.
46 AS_IF([test "$INSTALL" = "setup/install-sh -c" -o "$INSTALL" = "./setup-install-sh -c"],
47 [dnl
48 AC_SUBST([INSTALL], ["$COCCI_SRCDIR/$INSTALL"])
49 ])
50
51 dnl the same for MKDIR_P
52 AS_IF([test "$MKDIR_P" = "setup/install-sh -c -d" -o "$INSTALL" = "./setup-install-sh -c -d"],
53 [dnl
54 AC_SUBST([MKDIR_P], ["$COCCI_SRCDIR/$MKDIR_P"])
55 ])
56
57 dnl patchelf is an optional dependency and in principle not used for building coccinelle
58 AC_PATH_PROG([PATCHELF],[patchelf])
59
60 dnl pkg config is required, but we have an alternative script for it
61 AC_COCCI_TOOL([PKG_CONFIG],[pkg-config])
62 AS_IF([test "x$PKG_CONFIG" = xno],
63 [dnl no specific pkg-config configured
64 AC_SUBST([PKG_CONFIG_ORIG],[pkg-config])
65 ],
66 [dnl a specific pkg-config configured
67 AC_SUBST([PKG_CONFIG_ORIG],[$PKG_CONFIG])
68 ])
69
70 dnl always use the wrapper around pkg-config
71 AC_SUBST([PKG_CONFIG],["$COCCI_SRCDIR/setup/fake-subst.sh $PKG_CONFIG_ORIG"])
72
73
74 dnl ocaml compiler configuration
75 AC_PROG_OCAML
76 AC_CHECK_OCAMLVERSION([OCAMLATLEAST310],[3.10])
77 AC_CHECK_OCAMLVERSION([OCAMLATLEAST311],[3.11])
78 AC_SUBST([OCAMLCORIG],["$OCAMLC"])
79
80 AS_IF([test "x$OCAMLC" = xno -o "x$OCAMLDEP" = xno -o "x$OCAMLDOC" = xno -o "x$OCAMLMKLIB" = xno],
81 [dnl
82 AC_MSG_ERROR([You must install the OCaml compiler])
83 ])
84 AS_IF([test "x$OCAMLATLEAST310" = xno],[AC_MSG_NOTICE([a more recent OCaml installation may be required])])
85
86 dnl ocaml tools
87 AC_PROG_CAMLP4
88 AC_COCCI_TOOL([OCAMLLEX],[ocamllex],[])
89 AC_COCCI_TOOL([OCAMLYACC],[ocamlyacc],[])
90 AC_COCCI_TOOL([OCAMLFIND],[ocamlfind],[$COCCI_SRCDIR/setup/fake-subst.sh ocamlfind])
91 AC_COCCI_TOOL([OCAMLPROF],[ocamlprof],[])
92
93 dnl enforce ocaml tool requirements
94 AS_IF([test "x$OCAMLLEX" = xno],
95 [dnl
96 AC_MSG_ERROR([the OCaml Lexer needs to be installed (the ocamllex command). It should be part of your OCaml distribution.])
97 ])
98
99 AS_IF([test "x$OCAMLYACC" = xno],
100 [dnl
101 AC_MSG_ERROR([The OCaml parser generated needs to be installed (the ocamlyacc command). It should be part of your OCaml distribution.])
102 ])
103
104 AS_IF([test "x$OCAMLFIND" = xno],
105 [dnl
106 AC_MSG_ERROR([A suitable OCaml findlib (the ocamlfind command) could not be found.])
107 ])
108
109 dnl these runtime commands can also be passed as runtime flags to spatch.
110 AC_COCCI_RUNTIME_CMD([OCAMLFIND],[ocamlfind])
111 AC_COCCI_RUNTIME_CMD([OCAMLC],[ocamlc])
112 AC_COCCI_RUNTIME_CMD([OCAMLOPT],[ocamlopt])
113 AC_COCCI_RUNTIME_CMD([OCAMLDEP],[ocamldep])
114 AC_COCCI_RUNTIME_CMD([CAMLP4],[camlp4])
115 AC_COCCI_RUNTIME_CMD([CAMLP4O],[camlp4o])
116
117 dnl AC_CACHE_SAVE
118
119
120 dnl
121 dnl Basic ocaml modules
122 dnl
123
124 AC_MSG_NOTICE([verifying basic ocaml modules])
125
126 dnl default dir with the bundled ocaml packages
127 AC_COCCI_SET_EXTERNAL_DIR([$COCCI_SRCDIR/bundles])
128
129 dnl set some defaults
130 dnl add a line for each package that is
131 dnl configured via AC_CHECK_COCCI_EXTPKG
132 dnl or AC_REQ_COCCI_EXTPKG
133 AC_COCCI_INIT_PKG_EMPTY([menhirLib])
134 AC_COCCI_INIT_PKG_EMPTY([dynlink])
135 AC_COCCI_INIT_PKG_EMPTY([pcre])
136 AC_COCCI_INIT_PKG_EMPTY([pycaml])
137 AC_COCCI_INIT_PKG_EMPTY([camlp4])
138
139 dnl required ocaml packages
140 AC_MSG_NOTICE([the following OCaml packages should be provided by your ocaml installation])
141 AC_REQ_COCCI_STDPKG([unix])
142 AC_REQ_COCCI_STDPKG([bigarray])
143 AC_REQ_COCCI_STDPKG([num])
144 AC_REQ_COCCI_STDPKG([str])
145
146 dnl required modules (Some are available locally too)
147 AC_REQ_COCCI_EXTPKG([dynlink])
148 AC_REQ_COCCI_EXTPKG([camlp4])
149 AC_REQ_COCCI_EXTPKG([menhirLib])
150
151
152 dnl AC_CACHE_SAVE
153
154
155 dnl
156 dnl Handling of optional features
157 dnl
158
159 AC_MSG_NOTICE([verifying optional features])
160
161 dnl test if the optimized version of dynlink is available
162 AS_IF([test "x$OCAML_PKG_dynlink" != xno -a -f "$PATH_dynlink/dynlink.cmxa"],
163 [dnl yes
164 AC_SUBST([OPTIMIZED_dynlink], [yes])
165 ],
166 [dnl no
167 AC_SUBST([OPTIMIZED_dynlink], [no])
168 ])
169
170
171 dnl menhir handling
172 dnl variables:
173 dnl with_menhir: whether or not menhir must be used
174 AC_COCCI_TOOL([MENHIR],[menhir],[$COCCI_SRCDIR/setup/fake-menhir.sh menhir])
175 AS_IF([test "x$SUBSTITUTED_MENHIR" = xyes],
176 [dnl
177 AC_MSG_NOTICE([pregenerated parsers will be required as substitute for Menhir])
178 ])
179
180
181 dnl ocaml script handling
182 dnl variables:
183 dnl enable_ocaml: whether to enable ocaml scripts
184 AC_ARG_ENABLE([ocaml], AS_HELP_STRING([--enable-ocaml], [enable ocaml scripting (default: auto)]))
185 AS_IF([test "x$OCAML_PKG_dynlink" = xno],
186 [dnl
187 AS_IF([test -z "$enable_ocaml"],
188 [dnl
189 AC_SUBST([enable_ocaml], [no])
190 AC_MSG_NOTICE([ocaml scripting is disabled because the 'dynlink' package is not installed])
191 ], [test "x$enable_ocaml" != xno],
192 [dnl
193 AC_MSG_ERROR([the OCaml package dynlink is required for ocaml scripting])
194 ])
195 ])
196
197 dnl too old ocaml version, disable dynlink by default
198 AS_IF([test "x$OCAMLATLEAST311" = xno],
199 [dnl
200 AS_IF([test -z "$enable_ocaml"],
201 [dnl
202 AC_SUBST([enable_ocaml], [no])
203 AC_MSG_NOTICE([ocaml scripting has been disabled by default because your OCaml version may not support dynamic linking properly])
204 ], [test "x$enable_ocaml" = xyes],
205 [dnl
206 AC_MSG_NOTICE([warning: your ocaml version may be too old for dynamic linking, thus ocaml scripting may not work])
207 ])
208 ])
209
210 dnl no optimized version, disable dynlink by default
211 AS_IF([test "x$OPTIMIZED_dynlink" = xno],
212 [dnl
213 AS_IF([test -z "$enable_ocaml"],
214 [dnl
215 AC_SUBST([enable_ocaml], [no])
216 AC_MSG_NOTICE([ocaml scripting has been disabled by default because the optimized version of dynlink is not available])
217 ], [test "x$enable_ocaml" = xyes],
218 [dnl
219 AC_MSG_NOTICE([warning: the optimized version of dynlink is not available, thus ocaml scripting may not work])
220 ])
221 ])
222
223 dnl scripting requirement on ocamlfind
224 AS_IF([test -n "$SUBSTITUTED_OCAMLFIND"],
225 [dnl
226 AS_IF([test -z "$enable_ocaml"],
227 [dnl this is perhaps a bit too strict
228 AC_SUBST([enable_ocaml],[no])
229 AC_MSG_NOTICE([ocaml scripting is disabled because it depends on ocamlfind])
230 ], [test "x$enable_ocaml" != xno],
231 [dnl
232 AC_MSG_NOTICE([warning: ocamlfind is not found but may be required when ocaml scripts are used])
233 ])
234 ])
235
236 dnl scripting requirement on camlp4
237 AS_IF([test "x$CAMLP4" = xno],
238 [dnl
239 AS_IF([test -z "$enable_ocaml"],
240 [dnl this is perhaps a bit too strict
241 AC_SUBST([enable_ocaml],no)
242 AC_MSG_NOTICE([ocaml scripting is disabled because it requires camlp4 which is not available])
243 ], [test "x$enable_ocaml" != xno],
244 [dnl
245 AC_MSG_NOTICE([warning: camlp4 is not found but may be required when ocaml scripts are used])
246 ])
247 ])
248
249 AS_IF([test "x$enable_ocaml" = xno],
250 [dnl
251 AC_COCCI_INIT_PKG_EMPTY([dynlink]) dnl prevent linking with it
252 AC_SUBST(OCAMLCOCCI_MODULE, [No_prepare_ocamlcocci])
253 AC_SUBST(OCAMLCOCCI_FILE, [no_prepare_ocamlcocci.ml])
254 ],
255 [dnl
256 AC_SUBST([enable_ocaml], [yes])
257 AC_SUBST(OCAMLCOCCI_MODULE, [Yes_prepare_ocamlcocci])
258 AC_SUBST(OCAMLCOCCI_FILE, [yes_prepare_ocamlcocci.ml])
259 ])
260
261
262 dnl python handling
263 dnl variables:
264 dnl with_python: whether to enable the python feature (and what version)
265 dnl OCAML_PKG_pycaml: if "local" use local pycaml package
266 AC_ARG_VAR([PYTHON], [path to python when the version is determined automatically])
267 AC_ARG_ENABLE([python], [AS_HELP_STRING([--enable-python], [enable python scripting (yes/no) (default: auto)])])
268 AS_IF([test "x$enable_python" != xno],
269 [dnl
270 dnl an explicitly set --with-python disables the global pycaml by default
271 dnl set --enable-pycaml if it is clear that the installed pycaml library
272 dnl is consistent with the chosen python version
273 AS_IF([test -n "$enable_python" -a -z "$enable_pycaml"],
274 [dnl if explicit python given:
275 AC_MSG_NOTICE([skipped the selection of a global pycaml module because --enable-python is given explicitly but --enable-pycaml is not.])
276 AC_SUBST([enable_pycaml], [no])
277 ])
278
279 dnl sets "$PYVER" if python is available
280 AC_COCCI_PYVER
281
282 AS_IF([test -z "$PYVER"],
283 [dnl PYVER undetermined
284 AS_IF([test "x$enable_python" = xyes],
285 [dnl
286 AC_MSG_ERROR([python scripting is enabled explicitly but the version of python could not be determined])
287 ])
288 ],
289 [dnl
290 AC_MSG_NOTICE([looking for the corresponding python library])
291 PKG_CHECK_MODULES([PYTHON], [python-$PYVER],[AC_SUBST(HAVE_PYTHON,[yes])],[AC_SUBST(HAVE_PYTHON,[no])])
292
293 AS_IF([test "x$HAVE_PYTHON" != xyes -a "x$enable_python" != xyes],
294 [dnl fallback if the above failed
295 AC_MSG_NOTICE([trying the default python library as fallback])
296 PKG_CHECK_MODULES([PYTHON], [python],[AC_SUBST(HAVE_PYTHON,[yes])],[AC_SUBST(HAVE_PYTHON,[no])])
297 ])
298 ])
299 ])
300
301 AS_IF([test -z "$enable_python"],
302 [dnl
303 AS_IF([test "x$HAVE_PYTHON" = xyes],
304 [dnl
305 AC_SUBST([enable_python], [yes])
306 ],
307 [dnl
308 AC_SUBST([enable_python], [no])
309 ])
310 ])
311
312 AS_IF([test "x$enable_python" != xno],
313 [dnl
314 AS_IF([test "x$HAVE_PYTHON" = xyes],
315 [dnl
316 AC_MSG_NOTICE([support for python scripts is enabled])
317 ],
318 [dnl
319 AC_MSG_ERROR([the python scripts feature is enabled but the pkg-config python library is not found])
320 ])
321
322 AC_REQ_COCCI_EXTPKG([pycaml])
323 AC_SUBST([PYCOCCI_MODULE], [Yes_pycocci])
324 AC_SUBST([PYCOCCI_FILE],[yes_pycocci.ml])
325 ],
326 [dnl
327 AC_COCCI_INIT_PKG_EMPTY([pycaml])
328 AC_SUBST([PYCOCCI_MODULE], [No_pycocci])
329 AC_SUBST([PYCOCCI_FILE],[no_pycocci.ml])
330 ])
331
332
333 dnl pcre handling
334 dnl variables:
335 dnl enable_pcre: whether to enable the pcre feature
336 dnl OCAML_PKG_pcre: if "local" use str package
337 AC_ARG_ENABLE([pcre-syntax], AS_HELP_STRING([--enable-pcre-syntax], [enable pcre regular expression syntax (default: auto)]))
338 AS_IF([test "x$enable_pcre_syntax" != "xno"],
339 [dnl
340 PKG_CHECK_MODULES([PCRE], [libpcre],[AC_SUBST([HAVE_PCRE],[yes])],[AC_SUBST([HAVE_PCRE],[no])])
341 AS_IF([test -z "$enable_pcre_syntax" -a "x$HAVE_PCRE" != xyes],
342 [dnl
343 AC_SUBST([enable_pcre_syntax], [no])
344 ],
345 [dnl
346 AC_CHECK_COCCI_EXTPKG([pcre]) dnl will set $enable_pcre to 'yes', 'no', or 'local'
347 enable_pcre_syntax=$enable_pcre
348 ])
349 ])
350
351 AS_IF([test "x$enable_pcre_syntax" != xno],
352 [dnl
353 AS_IF([test "x$HAVE_PCRE" = xyes],
354 [dnl
355 AC_MSG_NOTICE([support for pcre syntax is enabled])
356 ],
357 [dnl
358 AC_MSG_ERROR([the pcre feature is enabled but the pkg-config libpcre library is not found])
359 ])
360
361 AC_SUBST([REGEXP_MODULE], [Regexp_pcre])
362 AC_SUBST([REGEXP_FILE], [regexp_pcre.ml])
363 ],
364 [dnl
365 AC_COCCI_INIT_PKG_EMPTY([pcre])
366 AC_SUBST([REGEXP_MODULE], [Regexp_str])
367 AC_SUBST([REGEXP_FILE], [regexp_str.ml])
368 ])
369
370
371 dnl AC_CACHE_SAVE
372
373
374 dnl obtain the value of $prefix
375 AS_IF([test "$prefix" = "NONE"],[prefix=$ac_default_prefix])
376
377
378 dnl
379 dnl backwards compatibility
380 dnl
381
382 dnl defines some variables needed by the Make infrastructure
383 AC_SUBST(SHAREDIR,["${prefix}/share/coccinelle"])
384
385 AS_IF([test "x$enable_python" != xno],
386 [dnl
387 AC_SUBST(FEATURE_PYTHON, [1])
388 ],
389 [dnl
390 AC_SUBST(FEATURE_PYTHON, [0])
391 ])
392
393 AS_IF([test "x$enable_ocaml" != xno],
394 [dnl
395 AC_SUBST(FEATURE_OCAML, [1])
396 ],
397 [dnl
398 AC_SUBST(FEATURE_OCAML, [0])
399 ])
400
401 dnl dynlink stuff depending on the OCaml version and whether it is enabled
402 AS_IF([test "x$OCAMLATLEAST311" = xyes -a "x$enable_ocaml" = xyes -a "x$OCAMLOPT" != xno],
403 [dnl
404 AC_SUBST([DYNLINK_IS_NATIVE], [Dynlink.is_native])
405 ],
406 [dnl
407 AC_SUBST([DYNLINK_IS_NATIVE], [false])
408 ])
409
410 dnl in case of the compilation of the manual
411 AC_COCCI_TOOL([PDFLATEX],[pdflatex],[$COCCI_SRCDIR/setup/fake-pdflatex.sh pdflatex])
412
413
414 dnl determine release configuration
415 AC_ARG_ENABLE([release], [AS_HELP_STRING([--enable-release], [build with a release configuration (yes,no,profile default: no)])])
416 AS_IF([test -z "$enable_release"],
417 [dnl
418 AC_MSG_NOTICE([choosing the development Makefile configuration because the release configuration is not explicitly requested.])
419 AC_SUBST([enable_release], [no])
420 ])
421
422 AC_SUBST([MODULES_profiling],[])
423 AS_IF([test "x$enable_release" = xyes],
424 [dnl set the default target to 'release' when enable_release is given
425 AC_SUBST([MAKETARGET_ALL], [all-release])
426 ], [test "x$enable_release" = xno],
427 [dnl otherwise, set the default target to 'dev'
428 AC_SUBST([MAKETARGET_ALL], [all-dev])
429 ], [test "x$enable_release" = xprofile],
430 [dnl selected profiling
431 AS_IF([test -z "$OCAMLPROF" -o "x$OCAMLPROF" = xno],
432 [dnl
433 AC_MSG_ERROR([ocamlprof is required for profiling, but is absent.])
434 ])
435
436 dnl configuration-time overrides for profiling
437 AC_SUBST([MAKETARGET_ALL], [all-dev])
438 AC_SUBST([OCAMLC], ["$COCCI_SRCDIR/setup/wrapper-ocamlcp.sh $OCAMLCORIG $OCAMLPROF"])
439 AC_SUBST([MODULES_profiling], [profiling.cmo])
440 AC_MSG_NOTICE([configured coccinelle for profiling])
441 ],
442 [dnl custom target given
443 AC_SUBST([MAKETARGET_ALL], ["$enable_release"])
444 ])
445
446 dnl determine whether to build the optimizing version
447 AC_ARG_ENABLE([opt], [AS_HELP_STRING([--enable-opt], [build an optimized spatch (yes,no, default: auto)])])
448 AS_IF([test "x$OCAMLOPT" = xno -a "x$enable_opt" != xno],
449 [dnl
450 AS_IF([test -n "$enable_release" -a "x$enable_release" != xyes -a "x$enable_release" != xno],
451 [dnl
452 AC_MSG_NOTICE([warning: ensure that make target $enable_release does not depend on the unavailable ocamlopt])
453 ], [test "x$enable_opt" = xyes],
454 [dnl
455 AC_MSG_ERROR([the optimized version of coccinelle is requested explicitly, but ocamlopt is absent])
456 ],
457 [dnl
458 AC_MSG_NOTICE([the optimized version of coccinelle will not be build because ocamlopt is not present])
459 AC_SUBST([enable_opt], [no])
460 ])
461 ])
462
463 AS_IF([test "x$OCAMLVERSION" = x3.11.2 -a -z "$enable_opt"],
464 [dnl the optimized version may not be buildable with ocaml 3.11.2 (know bug), hence disable it by default
465 AC_MSG_NOTICE([the optimized version of coccinelle will not be build by default due to OCaml version $OCAMLVERSION])
466 AC_SUBST([enable_opt], [no])
467 ])
468
469 dnl disable the optimized target when dynlinking is enabled but the optimized version of dynlink is not available
470 AS_IF([test "x$OPTIMIZED_dynlink" = xno -a "x$enable_ocaml" = xyes],
471 [dnl
472 AS_IF([test -z "$enable_opt"],
473 [dnl
474 AC_MSG_NOTICE([the optimized version of coccinelle will not be build by default because ocaml scripting is enabled but the required optimized dynlink package is not present])
475 AC_SUBST([enable_opt], [no])
476 ], [test "x$enable_opt" = xyes],
477 [dnl
478 AC_MSG_ERROR([the optimized version of coccinelle in combination with ocaml scripting requires the optimized version of the dynlik package, which is not present])
479 ])
480 ])
481
482 dnl set the default enable-opt setting
483 AS_IF([test -z "$enable_opt"],
484 [dnl
485 AS_IF([test "x$enable_release" = xyes -o "x$enable_release" = xno],
486 [dnl
487 AC_SUBST([enable_opt], ["$enable_release"])
488 ])
489 ])
490
491 dnl variables depending on whether we build the optimized spatch
492 AS_IF([test "x$enable_opt" = xyes],
493 [dnl default target for the optimized version
494 AC_SUBST([SPATCHNAME], [spatch.opt])
495 AC_SUBST([MAKETARGET_SPATCH], [opt-only])
496 ],
497 [dnl default target for the bytecode version
498 AC_SUBST([SPATCHNAME], [spatch])
499 AC_SUBST([MAKETARGET_SPATCH], [byte-only])
500 ])
501
502
503 dnl ocamlbuild handling
504 AC_ARG_ENABLE([ocamlbuild], AS_HELP_STRING([--enable-ocamlbuild], [enable ocamlbuild support (default: no)]))
505 AS_IF([test "x$enable_ocamlbuild" = xyes],
506 [dnl ocamlbuild support requested
507 AS_IF([test -z "$OCAMLBUILD" -o "x$OCAMLBUILD" = xno],
508 [dnl
509 AC_MSG_ERROR([Ocamlbuild is required but is not installed.])
510 ])
511
512 AC_SUBST([FEATURE_OCAMLBUILD], [yes])
513 ],
514 [dnl default: disable ocamlbuild support
515 AC_SUBST([FEATURE_OCAMLBUILD], [ ])
516 ])
517
518
519 dnl
520 dnl generating configuration
521 dnl
522
523 AC_CONFIG_FILES([
524 Makefile.config
525 version.ml
526 commons/commands.ml
527 globals/config.ml globals/regexp.ml python/pycocci.ml
528 ocaml/prepare_ocamlcocci.ml
529 scripts/spatch.sh
530 docs/spatch.1
531 myocamlbuild.ml
532
533 setup/Makefile
534 ])
535
536 AC_OUTPUT
537
538 AC_MSG_NOTICE([configuration completed])
539
540 cat << EOF
541 ------------------------------------------------------------------------------
542 Summary
543
544 configure flags: $CONFIGURE_FLAGS
545 findlib: $OCAMLFIND (an actual version is strongly recommended)
546 menhir: $MENHIR (should be an optional tool)
547 menhirLib module: $enable_menhirLib (for local package use --disable-menhirLib)
548
549 ocaml scripting: $enable_ocaml (overridable with --enable-ocaml)
550 python scripting: $enable_python (overridable with --enable-python)
551 pycaml module: $enable_pycaml (for local package use --disable-pycaml)
552
553 pcre regexes: $enable_pcre_syntax (overridable with --enable-pcre-syntax)
554 pcre module: $enable_pcre (for local package use --disable-pcre)
555 pcre library: $HAVE_PCRE (requires the dev version of libpcre)
556
557 release config: $enable_release (strongly recommended to be 'yes', overridable with --enable-release)
558 optimized spatch: $enable_opt (overridable with --disable-opt)
559
560 ------------------------------------------------------------------------------
561 Coccinelle can now be compiled and installed.
562
563
564 If you compile coccinelle again after source code changes or
565 configuration changes, you may need to run first:
566 \$ make clean
567
568 To compile coccinelle, run:
569 \$ make all
570
571 To install coccinelle, run:
572 \$ make install
573
574 Then, to test coccinelle, run for example:
575 \$ spatch -sp_file demos/simple.cocci demos/simple.c -o /tmp/new_simple.c
576
577 Or when coccinelle is not installed yet:
578 \$ COCCINELLE_HOME=$(pwd) ./scripts/spatch -sp_file demos/simple.cocci demos/simple.c -o /tmp/new_simple.c
579 EOF
580
581 if test "x$enable_python" != "xno"; then
582 cat << EOF
583 ------------------------------------------------------------------------------
584 You may need to set some environment variables so that the python
585 libraries are found. The frontend 'spatch' sets the following variables:
586
587 \$ export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$prefix/lib
588 \$ export PYTHONPATH=\$PYTHONPATH:$prefix/share/coccinelle/python
589
590 EOF
591 fi
592
593 cat << EOF
594 ------------------------------------------------------------------------------
595 EOF