1 ####################################################################
3 # The Why3 Verification Platform / The Why3 Development Team #
4 # Copyright 2010-2023 -- Inria - CNRS - Paris-Saclay University #
6 # This software is distributed under the terms of the GNU Lesser #
7 # General Public License version 2.1, with the special exception #
8 # on linking described in file LICENSE. #
10 ####################################################################
12 AC_INIT([Why3], [1.7.2+git])
16 AC_ARG_ENABLE(verbose-make,
17 AS_HELP_STRING([--enable-verbose-make], [verbose makefile recipes]),,
18 enable_verbose_make=no)
23 AS_HELP_STRING([--enable-local], [use Why3 in the build directory (no installation)]),,
26 # RELOCATABLE INSTALLATION
28 AC_ARG_ENABLE(relocation,
29 AS_HELP_STRING([--enable-relocation], [allow for later relocation of Why3 installation]),,
34 AC_ARG_ENABLE(native-code,
35 AS_HELP_STRING([--disable-native-code], [use only the byte-code compiler]),,
36 enable_native_code=yes)
40 AC_ARG_ENABLE(why3-lib,
41 AS_HELP_STRING([--disable-why3-lib], [use an already installed Why3]),,
46 AC_ARG_ENABLE(ocamlfind,
47 AS_HELP_STRING([--disable-ocamlfind], [do not use Ocamlfind]),,
48 enable_ocamlfind=check)
53 AS_HELP_STRING([--disable-zip], [do not use LZ compression to store session files]),,
59 AS_HELP_STRING([--enable-infer], [use apron and fixpoint to infer loop invariants]),,
64 AC_ARG_ENABLE(bddinfer,
65 AS_HELP_STRING([--enable-bddinfer], [use apron and BDDs to infer loop invariants]),,
70 AC_ARG_ENABLE(js_of_ocaml,
71 AS_HELP_STRING([--disable-js-of-ocaml], [do not use js-of-ocaml]),,
72 enable_js_of_ocaml=check)
77 AS_HELP_STRING([--disable-re], [use Str instead of Re for regular expressions]),,
83 AS_HELP_STRING([--disable-sexp], [disable S-expression support for `Ptree` and `why3 pp`]),,
89 AS_HELP_STRING([--disable-ide], [do not build Why3 IDE]),,
92 AC_ARG_ENABLE(web_ide,
93 AS_HELP_STRING([--disable-web-ide], [do not build Why3 Web IDE]),,
98 AC_ARG_ENABLE(coq-libs,
99 AS_HELP_STRING([--disable-coq-libs], [do not build Coq realizations]),,
100 enable_coq_libs=check)
104 AC_ARG_ENABLE(pvs-libs,
105 AS_HELP_STRING([--disable-pvs-libs], [do not build PVS realizations]),,
110 AC_ARG_ENABLE(isabelle-libs,
111 AS_HELP_STRING([--disable-isabelle-libs], [do not build Isabelle realizations]),,
112 enable_isabelle_libs=yes)
117 AS_HELP_STRING([--disable-mpfr], [disable support for MPFR]),,
120 # hypothesis selection
122 AC_ARG_ENABLE(hypothesis-selection,
123 AS_HELP_STRING([--disable-hypothesis-selection], [do not support hypothesis selection]),,
124 enable_hypothesis_selection=check)
128 AC_ARG_ENABLE(stackify,
129 AS_HELP_STRING([--disable-stackify], [disable structure reconstruction algorithm for MLCFG]),,
130 enable_stackify=check)
135 AS_HELP_STRING([--disable-doc], [do not build documentation]),,
138 AC_ARG_ENABLE(html-pdf,
139 AS_HELP_STRING([--disable-pdf-doc], [do not build PDF documentation]),,
142 # Experimental Jessie3 Frama-C plugin, disabled by default
144 AC_ARG_ENABLE(frama-c,
145 AS_HELP_STRING([--enable-frama-c], [enable Frama-C plugin]),,
147 reason_frama_c=" (disabled by default)"])
149 # profiling with statememprof
151 AC_ARG_ENABLE(statmemprof,
152 AS_HELP_STRING([--enable-statmemprof], [enable statistical memory profiling]),,
153 [enable_statmemprof=no
154 reason_statmemprof=" (disabled by default)"])
158 AC_ARG_ENABLE(emacs-compilation,
159 AS_HELP_STRING([--disable-emacs-compilation], [do not compile why3.elc]),,
160 enable_emacs_compilation=yes)
164 AC_ARG_VAR(EDITOR, [default editor])
168 AS_HELP_STRING([--disable-java], [do not use java in bench]),
169 [enable_java=${enableval}],
173 # either relocation or local, not both
174 if test "$enable_relocation" = yes -a "$enable_local" = yes ; then
175 AC_MSG_ERROR([cannot use --enable-relocation and --enable-local at the same time.])
180 AC_MSG_CHECKING([executable suffix])
181 if uname -s | grep -q CYGWIN ; then
183 STRIP='echo "no strip "'
184 AC_MSG_RESULT([.exe <Cygwin>])
185 elif uname -s | grep -q MINGW ; then
188 AC_MSG_RESULT([.exe <MinGW>])
192 AC_MSG_RESULT([<none>])
199 AC_DEFUN([AX_VERSION_GE], [AS_VERSION_COMPARE([$1],[$2],[$4],[$3],[$3])])
201 # Check for Ocaml compilers
203 # we first look for ocamlc in the path; if not present, we fail
204 AC_CHECK_PROG(OCAMLC,ocamlc,ocamlc,no)
205 if test "$OCAMLC" = no ; then
206 AC_MSG_ERROR([cannot find ocamlc.])
209 # we extract Ocaml version number
210 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
211 AC_MSG_NOTICE([ocaml version is $OCAMLVERSION])
213 AX_VERSION_GE([$OCAMLVERSION], 4.08.0, [],
214 [AC_MSG_ERROR([You need Objective Caml 4.08.0 or higher.])])
217 # old way: OCAMLLIB=`$OCAMLC -v | tail -1 | cut -f 4 -d ' ' | tr -d '\\r'`
218 OCAMLLIB=`$OCAMLC -where | tr -d '\\r'`
219 AC_MSG_NOTICE([ocaml library path is $OCAMLLIB])
221 # then we look for ocamlopt; if not present, we issue a warning
222 # if the version is not the same, we also discard it
223 # we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not
224 AC_CHECK_PROG(OCAMLOPT,ocamlopt,ocamlopt,no)
226 if test "$OCAMLOPT" = no ; then
227 AC_MSG_WARN([cannot find ocamlopt; bytecode compilation only.])
229 AC_MSG_CHECKING([ocamlopt version])
230 TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
231 if test "$TMPVERSION" != "$OCAMLVERSION" ; then
232 AC_MSG_RESULT([differs from ocamlc; ocamlopt discarded.])
240 # checking for native-code
241 if test "$enable_native_code" != yes || test "$OCAMLBEST" = byte ; then
242 enable_native_code=no
247 # checking for ocamlc.opt
248 AC_CHECK_PROG(OCAMLCDOTOPT,ocamlc.opt,ocamlc.opt,no)
249 if test "$OCAMLCDOTOPT" != no ; then
250 AC_MSG_CHECKING([ocamlc.opt version])
251 TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
252 if test "$TMPVERSION" != "$OCAMLVERSION" ; then
253 AC_MSG_RESULT([differs from ocamlc; ocamlc.opt discarded.])
260 # checking for ocamlopt.opt
261 if test "$OCAMLOPT" != no ; then
262 AC_CHECK_PROG(OCAMLOPTDOTOPT,ocamlopt.opt,ocamlopt.opt,no)
263 if test "$OCAMLOPTDOTOPT" != no ; then
264 AC_MSG_CHECKING([ocamlc.opt version])
265 TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
266 if test "$TMPVER" != "$OCAMLVERSION" ; then
267 AC_MSG_RESULT([differs from ocamlc; ocamlopt.opt discarded.])
270 OCAMLOPT=$OCAMLOPTDOTOPT
275 # ocamldep, ocamllex and ocamlyacc should also be present in the path
276 AC_CHECK_PROG(OCAMLDEP,ocamldep,ocamldep,no)
277 if test "$OCAMLDEP" = no ; then
278 AC_MSG_ERROR([cannot find ocamldep.])
280 AC_CHECK_PROG(OCAMLDEPDOTOPT,ocamldep.opt,ocamldep.opt,no)
281 if test "$OCAMLDEPDOTOPT" != no ; then
282 OCAMLDEP=$OCAMLDEPDOTOPT
286 AC_CHECK_PROG(OCAMLLEX,ocamllex,ocamllex,no)
287 if test "$OCAMLLEX" = no ; then
288 AC_MSG_ERROR([cannot find ocamllex.])
290 AC_CHECK_PROG(OCAMLLEXDOTOPT,ocamllex.opt,ocamllex.opt,no)
291 if test "$OCAMLLEXDOTOPT" != no ; then
292 OCAMLLEX=$OCAMLLEXDOTOPT
296 AC_CHECK_PROG(OCAMLYACC,ocamlyacc,ocamlyacc,no)
297 if test "$OCAMLYACC" = no ; then
298 AC_MSG_ERROR([cannot find ocamlyacc.])
301 AC_CHECK_PROG(OCAMLDOC,ocamldoc,ocamldoc,true)
302 if test "$OCAMLDOC" != true ; then
303 AC_CHECK_PROG(OCAMLDOCOPT,ocamldoc.opt,ocamldoc.opt,no)
304 if test "$OCAMLDOCOPT" != no ; then
305 OCAMLDOC=$OCAMLDOCOPT
309 AC_CHECK_PROG(MENHIR,menhir,menhir,no)
310 if test "$MENHIR" = no ; then
311 AC_MSG_ERROR([cannot find menhir.])
314 MENHIRVERSION=`$MENHIR --version | sed -n -e 's,.*version *\(.*\)$,\1,p'`
315 AX_VERSION_GE([$MENHIRVERSION], 20170418, [],
316 [AC_MSG_ERROR([You need Menhir 20170418 or higher.])])
319 if test "$enable_ocamlfind" != no; then
320 AC_CHECK_PROG(OCAMLFIND,ocamlfind,ocamlfind,no)
321 if test "$OCAMLFIND" = no; then
322 reason_ocamlfind=" (not found)"
324 OCAMLFINDLIB=$(ocamlfind printconf stdlib | tr -d '\r')
325 if test "$OCAMLFINDLIB" != "$OCAMLLIB"; then
327 reason_ocamlfind=" (incompatible with OCaml)"
328 echo "but your ocamlfind is not compatible with your ocamlc:"
329 echo "ocamlfind: $OCAMLFINDLIB, ocamlc: $OCAMLLIB"
336 if test "$found_ocamlfind" = no; then
337 if test "$enable_ocamlfind" = yes; then
338 AC_MSG_ERROR([cannot use ocamlfind.])
343 if test "$enable_ocamlfind" != no; then
344 #if ocamlfind is used it gives the install path for ocaml library
345 OCAMLINSTALLLIB=$($OCAMLFIND printconf destdir | tr -d '\r')
348 OCAMLINSTALLLIB=$OCAMLLIB
352 if test "$enable_why3_lib" = yes ; then
355 if test "$enable_ocamlfind" = no; then
356 AC_MSG_ERROR([cannot use --disable-why3-lib without ocamlfind.])
359 AC_MSG_CHECKING([for Why3 using ocamlfind])
360 DIR=$($OCAMLFIND query why3 2> /dev/null | tr -d '\r')
361 if test -n "$DIR"; then
363 WHY3INCLUDE="-I $DIR"
366 AC_MSG_ERROR([cannot use --disable-why3-lib without an installed Why3.])
370 if test "$enable_local" = no; then
377 if test "$enable_ocamlfind" = yes; then
378 AC_MSG_CHECKING([for compiler-libs using ocamlfind])
379 COMPILERLIBS=$($OCAMLFIND query compiler-libs 2> /dev/null | tr -d '\r')
380 if test -n "$COMPILERLIBS"; then
386 reason_ppx=" (compiler-libs not found)"
392 # checking for sphinx
393 if test "$enable_doc" = yes; then
394 AC_CHECK_PROG(SPHINX,sphinx-build,sphinx-build,no)
395 if test "$SPHINX" = no; then
398 reason_doc=" (sphinx-build not found)"
399 AC_MSG_WARN([cannot find sphinx-build, documentation disabled.])
405 # checking for rubber or latexmk or pdflatex
406 if test "$enable_pdf_doc" = yes; then
407 AC_CHECK_PROGS(LATEX,latexmk rubber pdflatex,no)
408 if test "$LATEX" = no; then
410 reason_pdf_doc=" ((rubber|latexmk|pdflatex) not found)"
411 AC_MSG_WARN([cannot find any latex compiler, PDF documentation disabled.])
416 if test "$enable_emacs_compilation" = yes ; then
417 AC_CHECK_PROG(EMACS,emacs,emacs,no)
418 if test "$EMACS" = no ; then
419 enable_emacs_compilation=no
420 AC_MSG_WARN([cannot find emacs, compilation of why3.elc disabled.])
424 # checking for Zarith
427 if test "$enable_ocamlfind" = yes; then
428 AC_MSG_CHECKING([for zarith using ocamlfind])
429 DIR=$($OCAMLFIND query zarith 2> /dev/null | tr -d '\r')
430 if test -n "$DIR"; then
432 BIGINTINCLUDE="-I $DIR"
438 BIGINTINCLUDE="-I +zarith"
439 DIR="$OCAMLLIB/zarith"
440 AC_CHECK_FILE($DIR/zarith.cma,,found_zarith=no)
442 if test -n "$DIR"; then
443 AC_CHECK_FILE($DIR/z.cmi,,found_zarith=no)
445 if test "$found_zarith" = no; then
446 AC_MSG_ERROR([cannot find library zarith.])
449 # checking for apron for bddinfer
450 if test "$enable_bddinfer" = yes; then
451 if test "$enable_ocamlfind" = yes; then
452 # gmp is a dependency of apron
453 INFERINCLUDE=$($OCAMLFIND query -separator ' ' -i-format apron 2> /dev/null | tr -d '\r')
455 if test -n "$INFERINCLUDE"; then
456 echo "ocamlfind found apron in $INFERINCLUDE"
458 INFERPKG="zarith apron apron.polkaMPQ"
461 reason_bddinfer=" (apron not found)"
462 AC_MSG_WARN([Lib apron not found, bddinfer will not be built.])
465 reason_bddinfer=" (disabled by default)"
468 # checking for apron and fixpoint
469 if test "$enable_infer" = yes; then
470 if test "$enable_ocamlfind" = yes; then
471 # gmp is a dependency of apron
472 INFERINCLUDE=$($OCAMLFIND query apron camllib 2> /dev/null | tr -d '\r')
474 if test -n "$INFERINCLUDE"; then
475 echo "ocamlfind found apron, camllib in $INFERINCLUDE"
476 INFERINCLUDE=$($OCAMLFIND query fixpoint 2> /dev/null | tr -d '\r')
477 if test -n "$INFERINCLUDE"; then
478 echo "ocamlfind found fixpoint in $INFERINCLUDE"
479 INFERINCLUDE="$($OCAMLFIND query -separator ' ' -i-format apron fixpoint camllib gmp 2> /dev/null | tr -d '\r')"
480 INFERLIB="apron fixpoint"
481 INFERPKG="apron fixpoint apron.boxMPQ apron.octMPQ apron.polkaMPQ"
484 AC_MSG_WARN([Lib fixpoint not found, infer will not be built.])
485 reason_infer=" (fixpoint not found)"
489 reason_infer=" (apron or camllib not found)"
490 AC_MSG_WARN([Lib apron or camllib not found, infer will not be built.])
493 reason_infer=" (disabled by default)"
496 # checking for camlzip
497 if test "$enable_zip" = no; then
498 reason_zip=" (disabled by user)"
502 if test "$enable_ocamlfind" = yes; then
503 AC_MSG_CHECKING([for camlzip using ocamlfind])
504 DIR=$($OCAMLFIND query zip 2> /dev/null | tr -d '\r')
505 if test -n "$DIR"; then
515 AC_CHECK_FILE($DIR/zip.cma,,found_zip=no)
517 if test -n "$DIR"; then
518 AC_CHECK_FILE($DIR/zip.cmi,,found_zip=no)
520 if test "$found_zip" = no; then
521 if test "$enable_zip" = yes; then
522 AC_MSG_ERROR([cannot find library camlzip.])
524 AC_MSG_WARN([cannot find library camlzip; sessions files will not be compressed.])
526 reason_zip=" (camlzip not found)"
530 if test "$enable_zip" != no; then
538 # checking for menhirlib
541 if test "$enable_ocamlfind" = yes; then
542 AC_MSG_CHECKING([for menhirLib using ocamlfind])
543 DIR=$($OCAMLFIND query menhirLib 2> /dev/null | tr -d '\r')
544 if test -n "$DIR"; then
546 MENHIRINCLUDE="-I $DIR"
552 MENHIRINCLUDE="-I +menhirLib"
553 DIR="$OCAMLLIB/menhirLib"
555 AC_CHECK_FILE($DIR/menhirLib.cmo,menhirlib_cmo=yes,)
556 AC_CHECK_FILE($DIR/menhirLib.cma,menhirlib_cmo=no,)
557 if test -z "$menhirlib_cmo"; then found_menhirlib=no; fi
559 if test -n "$DIR"; then
560 AC_CHECK_FILE($DIR/menhirLib.cmi,,found_menhirlib=no)
562 if test "$found_menhirlib" = no; then
563 AC_MSG_ERROR([cannot find library menhirLib.])
565 AC_SUBST(menhirlib_cmo)
568 if test "$enable_re" = no; then
569 reason_re=" (disabled by user)"
573 if test "$enable_ocamlfind" = yes; then
574 AC_MSG_CHECKING([for re using ocamlfind])
575 DIR=$($OCAMLFIND query re 2> /dev/null | tr -d '\r')
576 if test -n "$DIR"; then
586 AC_CHECK_FILE($DIR/re.cmx,,found_re=no)
588 if test -n "$DIR"; then
589 AC_CHECK_FILE($DIR/re.cmi,,found_re=no)
591 if test "$found_re" = no; then
592 if test "$enable_re" = yes; then
593 AC_MSG_ERROR([cannot find library re.])
595 AC_MSG_WARN([cannot find library re, using Str instead.])
597 reason_re=" (re not found)"
601 if test "$enable_re" != no; then
609 # checking for lablgtk3
610 if test "$enable_ide" = no ; then
611 reason_ide=" (disabled by user)"
613 if test "$enable_ide" != no -a "$enable_ocamlfind" = no; then
614 if test "$enable_ide" = yes; then
615 AC_MSG_ERROR([cannot build IDE without ocamlfind.])
618 reason_ide=" (ocamlfind not available)"
622 if test "$enable_ide" != no; then
623 AC_MSG_CHECKING([for lablgtk3 using ocamlfind])
624 DIR=$($OCAMLFIND query lablgtk3 2> /dev/null | tr -d '\r')
625 if test -n "$DIR"; then
628 AC_CHECK_FILE($DIR/gtkButton.cmi,,found_lablgtk=no)
633 if test "$found_lablgtk" = yes; then
635 PKGS_SOURCEVIEW="lablgtk3-sourceview3 lablgtk3.sourceview3 lablgtksourceview3"
639 # checking for lablgtksourceview
640 found_lablgtksourceview=no
641 if test "$found_lablgtk" = yes; then
642 for p in $PKGS_SOURCEVIEW; do
643 AC_MSG_CHECKING([for $p using ocamlfind])
644 DIR=$($OCAMLFIND query $p 2> /dev/null | tr -d '\r')
645 if test -n "$DIR"; then
647 AC_CHECK_FILE($DIR/gSourceView$GTKVERSION.cmi,,p=)
648 if test -n "$p"; then
656 if test -n "$PKG_SOURCEVIEW"; then
657 found_lablgtksourceview=yes
661 if test "$enable_ide" != no -a "$found_lablgtk" = no; then
662 if test "$enable_ide" = yes; then
663 AC_MSG_ERROR([cannot build IDE without lablgtk3.])
665 AC_MSG_WARN([cannot find library lablgtk3, IDE disabled.])
667 reason_ide=" (lablgtk3 not found)"
670 if test "$enable_ide" != no -a "$found_lablgtksourceview" = no; then
671 if test "$enable_ide" = yes; then
672 AC_MSG_ERROR([cannot build IDE without lablgtksourceview.])
674 AC_MSG_WARN([cannot find library lablgtksourceview, IDE disabled.])
676 reason_ide=" (lablgtksourceview not found)"
679 if test "$enable_ide" != no; then
681 LABLGTKPKG="lablgtk$GTKVERSION $PKG_SOURCEVIEW"
684 if test "$enable_hypothesis_selection" != no -o "$enable_stackify" != no; then
687 if test "$enable_ocamlfind" = yes; then
688 AC_MSG_CHECKING([for ocamlgraph using ocamlfind])
689 DIR=$($OCAMLFIND query ocamlgraph 2> /dev/null | tr -d '\r')
690 if test -n "$DIR"; then
698 OCAMLGRAPHLIB="+ocamlgraph"
699 DIR="$OCAMLLIB/ocamlgraph"
700 AC_CHECK_FILE($DIR/graph.cma,,found_ocamlgraph=no)
702 if test -n "$DIR"; then
703 AC_CHECK_FILE($DIR/graph.cmi,,found_ocamlgraph=no)
707 if test "$enable_hypothesis_selection" = no; then
708 reason_hypothesis_selection=" (disabled by user)"
709 elif test "$found_ocamlgraph" = no; then
710 if test "$enable_hypothesis_selection" = yes; then
711 AC_MSG_ERROR([cannot enable hypothesis selection without ocamlgraph.])
713 enable_hypothesis_selection=no
714 reason_hypothesis_selection=" (ocamlgraph not found)"
715 AC_MSG_WARN([cannot find library ocamlgraph, hypothesis selection disabled.])
718 if test "$enable_hypothesis_selection" != no; then
719 META_OCAMLGRAPH="ocamlgraph"
720 enable_hypothesis_selection=yes
726 if test "$enable_stackify" = no; then
727 reason_stackify=" (disabled by user)"
728 elif test "$found_ocamlgraph" = no; then
729 if test "$enable_stackify" = yes; then
730 AC_MSG_ERROR([cannot enable stackify without ocamlgraph.])
733 reason_stackify=" (ocamlgraph not found)"
734 AC_MSG_WARN([cannot find library ocamlgraph, stackify disabled.])
737 if test "$enable_stackify" != no; then
738 META_OCAMLGRAPH="ocamlgraph"
747 if test "$enable_mpfr" = no; then
748 reason_mpfr=" (disabled by user)"
749 elif test "$enable_ocamlfind" != yes; then
750 reason_mpfr=" (ocamlfind not available)"
751 elif test "$enable_js_of_ocaml" = yes -o "$enable_web_ide" = yes; then
752 if test "$enable_mpfr" = yes; then
753 AC_MSG_ERROR([cannot enable support for both MPFR and Javascript.])
755 reason_mpfr=" (incompatible with js_of_ocaml) "
758 AC_MSG_CHECKING([for mlmpfr])
759 DIR=$($OCAMLFIND query mlmpfr 2> /dev/null | tr -d '\r')
760 if test -n "$DIR"; then
763 echo "ocamlfind found mlmpfr in $DIR"
764 # Test that MPFR version is higher than 4.0.0 (because of
765 # Faithful constructor incompatibility).
766 MPFRVERSION=$($OCAMLFIND query -format "%v" mlmpfr 2> /dev/null | tr -d '\r')
767 AX_VERSION_GE([$MPFRVERSION], 4.0.0, [], [
769 reason_mpfr=" (mlmpfr >= 4.0.0 not found)"])
770 AC_CHECK_FILE($DIR/mpfr.cmi, [old_mpfr=yes], )
771 AC_CHECK_FILE($DIR/mlmpfr.cma,, [
773 reason_mpfr=" (mlmpfr not found)"])
776 reason_mpfr=" (mlmpfr not found)"
781 if test "$enable_mpfr" != no -a "$found_mlmpfr" = no; then
782 if test "$enable_mpfr" = yes; then
783 AC_MSG_ERROR([cannot enable MPFR support without mlmpfr.])
788 if test "$enable_mpfr" != no; then
793 # checking for js_of_ocaml
795 if test "$enable_js_of_ocaml" = no; then
796 reason_js_of_ocaml=" (disabled by user)"
797 elif test "$enable_mpfr" = yes; then
798 reason_js_of_ocaml=" (incompatible with MPFR support)"
799 elif test "$enable_ocamlfind" != yes; then
800 reason_js_of_ocaml=" (ocamlfind not available)"
802 found_js_of_ocaml=yes
803 for p in js_of_ocaml js_of_ocaml-ppx zarith_stubs_js; do
804 AC_MSG_CHECKING([for $p])
805 DIR=$($OCAMLFIND query $p 2> /dev/null | tr -d '\r')
806 if test -z "$DIR"; then
809 reason_js_of_ocaml=" ($p not found)"
817 if test "$enable_js_of_ocaml" != no -a "$found_js_of_ocaml" = no; then
818 if test "$enable_js_of_ocaml" = yes; then
819 AC_MSG_ERROR([cannot enable Javascript support without ocamlfind.])
821 enable_js_of_ocaml=no
824 if test "$enable_js_of_ocaml" != no; then
825 JSOFOCAMLVERSION=$($OCAMLFIND query -format "%v" js_of_ocaml 2> /dev/null | tr -d '\r')
826 AX_VERSION_GE([$JSOFOCAMLVERSION], 5.6.0, [], [
828 reason_js_of_ocaml=" (js_of_ocaml >= 5.6.0 not found)"])
831 if test "$enable_js_of_ocaml" != no -a "$found_js_of_ocaml" = no; then
832 if test "$enable_js_of_ocaml" = yes; then
833 AC_MSG_ERROR([cannot enable Javascript support without js_of_ocaml >= 5.6.0 (found $JSOFOCAMLVERSION).])
835 enable_js_of_ocaml=no
838 if test "$enable_js_of_ocaml" != no; then
839 enable_js_of_ocaml=yes
840 JSOFOCAMLPKG="js_of_ocaml js_of_ocaml-ppx"
844 if test "$enable_web_ide" = no; then
845 reason_web_ide=" (disabled by user)"
846 elif test "$enable_js_of_ocaml" != yes; then
847 if test "$enable_web_ide" = yes; then
848 AC_MSG_ERROR([cannot enable web IDE without Javascript support.])
851 reason_web_ide=" (Javascript support not available)"
856 # checking for statmemprof
857 if test "$enable_statmemprof" = yes; then
858 if test "$enable_ocamlfind" != yes; then
859 enable_statmemprof=no
860 reason_statmemprof=" (ocamlfind not available)"
862 DIR=$($OCAMLFIND query statmemprof-emacs 2> /dev/null | tr -d '\r')
863 if test -z "$DIR"; then
864 enable_statmemprof=no
865 reason_statmemprof=" (statmemprof-emacs not found)"
867 STATMEMPROFPKG=statmemprof-emacs
871 # ppx_sexp_conv (only with ocamlfind)
874 if test "$enable_sexp" = no; then
875 reason_sexp=" (disabled by user)"
877 if test "$enable_ocamlfind" != yes; then
879 reason_sexp=" (ocamlfind not available)"
880 elif test "$enable_ppx" != yes; then
882 reason_sexp=" (requires ppx)"
884 for p in ppx_sexp_conv sexplib ppx_deriving; do
885 AC_MSG_CHECKING([for $p using ocamlfind])
886 DIR=$($OCAMLFIND query $p 2> /dev/null | tr -d '\r')
887 if test -z "$DIR"; then
890 reason_sexp=" ($p not found)"
897 if test "$enable_sexp" = yes; then
898 SEXPLIBPPX="ppx_sexp_conv"
905 enable_coq_support=yes
906 enable_coq_fp_libs=yes
910 if test "$enable_coq_libs" = no; then
911 enable_coq_support=no
912 reason_coq_support=" (disabled by user)"
915 if test "$enable_coq_support" = yes; then
916 AC_CHECK_PROG(COQC,coqc,coqc,no)
917 if test "$COQC" = no ; then
918 enable_coq_support=no
919 reason_coq_support=" (coqc not found)"
923 if test "$enable_coq_support" = yes; then
924 COQLIB=`$COQC -where | sed -e 's|\\\|/|g' -e 's| |\\ |g'`
925 AC_MSG_CHECKING(Coq version)
926 COQVERSION=[`$COQC -v | sed -n -e 's|.*version *\([^ ]*\).*|\1|p'`]
927 AC_MSG_RESULT($COQVERSION)
928 COQNUMVERSION=[`echo $COQVERSION | awk -F. '{ printf("%d%02d\n", $1,$2); }'`]
929 if test "$COQNUMVERSION" -lt 816; then
930 if test "$enable_coq_libs" = yes; then
931 AC_MSG_ERROR([cannot build Coq libraries without Coq >= 8.16.])
933 enable_coq_support=no
934 AC_MSG_WARN([cannot build Coq libraries without Coq >= 8.16.])
935 reason_coq_support=" (need version >= 8.16)"
937 if test "$COQNUMVERSION" -ge 817; then
938 COQFLAGS="-w deprecated-instance-without-locality,deprecated-hint-without-locality"
940 if test "$COQNUMVERSION" -gt 820; then
941 AC_MSG_WARN([unrecognized Coq version, assuming Coq 8.20])
944 coq_compat_version="COQ$COQNUMVERSION"
946 if test "$enable_coq_fp_libs" = no; then
947 reason_coq_fp_libs= " (Coq < 8.11)"
951 if test "$enable_coq_support" = yes; then
952 AC_CHECK_PROG(COQDEP,coqdep,coqdep,no)
953 if test "$COQDEP" = no; then
954 if test "$enable_coq_libs" = yes; then
955 AC_MSG_ERROR([cannot build Coq libraries without Coqdep.])
957 enable_coq_support=no
958 reason_coq_support=" (coqdep not found)"
962 if test "$enable_coq_support" = no; then
964 enable_coq_fp_libs=no
970 if test "$enable_coq_fp_libs" = yes; then
971 AC_MSG_CHECKING([for Flocq])
973 [ echo "Require Import Flocq.Version BinNat." \
974 "Goal (30400 <= Flocq_version)%N. easy. Qed." > conftest.v
975 "$COQC" conftest.v > conftest.err ],
976 [ AC_MSG_RESULT(yes) ],
978 enable_coq_fp_libs=no
979 reason_coq_fp_libs=" (Flocq >= 3.4 not found)" ])
980 rm -f conftest.v conftest.vo conftest.err
985 if test "$enable_pvs_libs" = no; then
986 enable_pvs_support=no
987 reason_pvs_support=" (disabled by user)"
989 AC_CHECK_PROG(PVS,pvs,pvs,no)
990 if test "$PVS" = no ; then
991 enable_pvs_support=no
992 reason_pvs_support=" (pvs not found)"
993 elif $PVS --help 2> /dev/null | grep -q "physical volume"; then
994 AC_MSG_NOTICE([pvs does not seem to be the theorem prover])
995 enable_pvs_support=no
996 reason_pvs_support=" (pvs not found)"
999 AC_MSG_CHECKING(PVS version)
1000 PVSVERSION=[`$PVS -version | sed -n -e 's|.*Version *\([^ ]*\)$|\1|p'`]
1001 AC_MSG_RESULT($PVSVERSION)
1004 enable_pvs_support=yes
1007 enable_pvs_support=no
1008 AC_MSG_WARN([You need PVS 6.0 or higher; PVS discarded.])
1009 reason_pvs_support=" (need version 6.0 or higher)"
1015 if test "$enable_pvs_support" = no; then
1022 # Default version used for generation of realization in the case Isabelle is not
1023 # detected or Why3 is compiled with disable-isabelle.
1024 ISABELLEVERSION=2021-1
1026 if test "$enable_isabelle_libs" = no; then
1027 enable_isabelle_support=no
1028 reason_isabelle_support=" (disabled by user)"
1030 AC_CHECK_PROG(ISABELLE,isabelle,isabelle,no)
1031 if test "$ISABELLE" = no ; then
1032 enable_isabelle_support=no
1033 reason_isabelle_support=" (isabelle not found)"
1035 AC_MSG_CHECKING(Isabelle version)
1036 ISABELLEDETECTEDVERSION=[`$ISABELLE version | sed -n -e 's|Isabelle\([^:]*\).*$|\1|p'`]
1037 AC_MSG_RESULT($ISABELLEDETECTEDVERSION)
1038 case $ISABELLEDETECTEDVERSION in
1040 enable_isabelle_support=yes
1041 ISABELLEVERSION=2019
1044 enable_isabelle_support=yes
1045 ISABELLEVERSION=2021-1
1048 enable_isabelle_support=yes
1049 ISABELLEVERSION=2021-1
1052 enable_isabelle_support=no
1053 AC_MSG_WARN([You need Isabelle 2019 or later; Isabelle discarded.])
1054 reason_isabelle_support=" (need version >= 2019)"
1060 if test "$enable_isabelle_support" = no; then
1061 enable_isabelle_libs=no
1064 if test "$enable_pvs_libs" = yes; then
1065 AC_MSG_CHECKING([for NASA PVS library])
1067 reason_pvs_libs=" (no NASA PVS library in PVS_LIBRARY_PATH)"
1068 for dir in `echo $PVS_LIBRARY_PATH | tr ':' ' '`; do
1069 if test -f $dir/nasalib-version; then
1074 AC_MSG_RESULT($enable_pvs_libs)
1078 FRAMAC_SUPPORTED=Sulfur
1079 if test "$enable_frama_c" = yes ; then
1080 AC_CHECK_PROG(FRAMAC,frama-c,frama-c,no)
1081 if test "$FRAMAC" = no ; then
1083 reason_frama_c=" (frama-c not found)"
1085 AC_MSG_CHECKING(Frama-C version)
1086 FRAMAC_VERSION=`$FRAMAC -version | sed -n -e 's|\(Version: \)\?\(.*\)$|\2|p'`
1087 AC_MSG_RESULT($FRAMAC_VERSION)
1088 case $FRAMAC_VERSION in
1089 $FRAMAC_SUPPORTED-*) ;;
1090 *) AC_MSG_WARN(Version $FRAMAC_SUPPORTED required.)
1092 reason_frama_c=" (version $FRAMAC_SUPPORTED required)"
1098 if test "$enable_frama_c" = yes; then
1099 FRAMAC_SHARE=`$FRAMAC -print-path`
1100 FRAMAC_LIBDIR=`$FRAMAC -print-libpath`
1101 FRAMAC_INCLUDE="-I $FRAMAC_LIBDIR"
1104 VERSION=$PACKAGE_VERSION
1108 if test -z "$EDITOR"; then
1114 EDITOR="cmd.exe -c start"
1122 # Check presence of java and javac used by whyml2java bench
1123 if test "$enable_java" = yes; then
1124 AC_CHECK_PROG(JAVAC,javac,javac,no)
1125 AC_CHECK_PROG(JAVA,java,java,no)
1131 # substitutions to perform
1134 AC_SUBST(enable_verbose_make)
1146 AC_SUBST(OCAMLVERSION)
1148 AC_SUBST(OCAMLINSTALLLIB)
1149 AC_SUBST(OCAMLGRAPHLIB)
1152 AC_SUBST(enable_ocamlfind)
1155 AC_SUBST(enable_statmemprof)
1156 AC_SUBST(STATMEMPROFPKG)
1158 AC_SUBST(enable_ide)
1159 AC_SUBST(LABLGTKPKG)
1160 AC_SUBST(GTKVERSION)
1162 AC_SUBST(enable_web_ide)
1163 AC_SUBST(enable_js_of_ocaml)
1164 AC_SUBST(JSOFOCAMLPKG)
1166 AC_SUBST(META_OCAMLGRAPH)
1168 AC_SUBST(enable_ppx)
1169 AC_SUBST(enable_sexp)
1171 AC_SUBST(SEXPLIBPPX)
1174 AC_SUBST(enable_mpfr)
1177 AC_SUBST(BIGINTINCLUDE)
1179 AC_SUBST(enable_infer)
1180 AC_SUBST(enable_bddinfer)
1181 AC_SUBST(INFERINCLUDE)
1185 AC_SUBST(enable_zip)
1186 AC_SUBST(ZIPINCLUDE)
1189 AC_SUBST(MENHIRINCLUDE)
1195 AC_SUBST(enable_coq_libs)
1196 AC_SUBST(enable_coq_fp_libs)
1197 AC_SUBST(coq_compat_version)
1202 AC_SUBST(COQVERSION)
1205 AC_SUBST(enable_pvs_libs)
1207 AC_SUBST(PVSVERSION)
1209 AC_SUBST(enable_isabelle_libs)
1211 AC_SUBST(ISABELLEVERSION)
1213 AC_SUBST(enable_hypothesis_selection)
1214 AC_SUBST(enable_stackify)
1216 AC_SUBST(enable_doc)
1217 AC_SUBST(enable_pdf_doc)
1222 AC_SUBST(enable_emacs_compilation)
1225 AC_SUBST(enable_frama_c)
1228 AC_SUBST(FRAMAC_VERSION)
1229 AC_SUBST(FRAMAC_SHARE)
1230 AC_SUBST(FRAMAC_LIBDIR)
1231 AC_SUBST(FRAMAC_INCLUDE)
1233 AC_SUBST(enable_local)
1236 AC_SUBST(enable_why3_lib)
1238 AC_SUBST(WHY3INCLUDE)
1240 AC_SUBST(enable_relocation)
1245 # Finally create the Makefile from Makefile.in
1246 AC_CONFIG_FILES(Makefile)
1247 AC_CONFIG_FILES(src/config.sh)
1248 AC_CONFIG_FILES(lib/why3/META)
1249 AC_CONFIG_FILES(.merlin)
1250 AC_CONFIG_FILES(src/jessie/Makefile)
1251 AC_CONFIG_FILES(src/jessie/.merlin)
1252 AC_CONFIG_FILES(lib/coq/version lib/pvs/version)
1253 AC_CONFIG_FILES(bench/java/Makefile)
1254 AC_CONFIG_FILES(doc/javaexamples/Makefile)
1255 AC_CONFIG_COMMANDS([chmod],
1256 chmod a-w Makefile src/jessie/Makefile;
1257 chmod a-w src/config.sh;
1258 chmod a-w lib/why3/META;
1260 chmod a-w src/jessie/Makefile;
1261 chmod a-w src/jessie/.merlin;
1262 chmod a-w lib/coq/version lib/pvs/version;
1263 chmod u+x src/config.sh)
1272 echo "-----------------------------------------"
1273 echo "Verbose make : $enable_verbose_make"
1274 echo "OCaml compiler : yes"
1275 echo " Version : $OCAMLVERSION"
1276 echo " Library path : $OCAMLLIB"
1277 echo " Ocamlfind : $enable_ocamlfind$reason_ocamlfind"
1278 echo " Native compilation : $enable_native_code"
1279 echo " Memory profiling : $enable_statmemprof$reason_statmemprof"
1280 echo " PPX : $enable_ppx$reason_ppx"
1281 echo " S-expressions support : $enable_sexp$reason_sexp"
1282 echo " Javascript support : $enable_js_of_ocaml$reason_js_of_ocaml"
1283 echo " MPFR support : $enable_mpfr$reason_mpfr"
1284 echo " Re support : $enable_re$reason_re"
1286 echo " Why3 library : $enable_why3_lib"
1287 echo " GTK IDE : $enable_ide$reason_ide"
1288 echo " Web IDE : $enable_web_ide$reason_web_ide"
1289 echo " Compressed sessions : $enable_zip$reason_zip"
1290 echo " Hypothesis selection : $enable_hypothesis_selection$reason_hypothesis_selection"
1291 echo " Stackify : $enable_stackify$reason_stackify"
1292 echo " Invariant inference(exp): $enable_infer$reason_infer"
1293 echo " Inference with BDDs(exp): $enable_bddinfer$reason_bddinfer"
1294 echo " Frama-C support : $enable_frama_c$reason_frama_c"
1295 if test "$enable_frama_c" = yes ; then
1296 echo " Version : $FRAMAC_VERSION"
1297 echo " Share path : $FRAMAC_SHARE"
1298 echo " Library path : $FRAMAC_LIBDIR"
1300 echo "Documentation : $enable_doc$reason_doc"
1301 if test "$enable_doc" = yes ; then
1303 echo " PDF : $enable_pdf_doc$reason_pdf_doc"
1305 echo "Support for interactive proof assistants"
1306 echo " Coq : $enable_coq_support$reason_coq_support"
1307 if test "$enable_coq_support" = yes ; then
1308 echo " Version : $COQVERSION"
1309 echo " Library path : $COQLIB"
1310 echo " Realization support : $enable_coq_libs$reason_coq_libs"
1311 if test "$enable_coq_libs" = yes ; then
1312 echo " FP arithmetic : $enable_coq_fp_libs$reason_coq_fp_libs"
1315 echo " PVS : $enable_pvs_support$reason_pvs_support"
1316 if test "$enable_pvs_support" = yes ; then
1317 echo " Version : $PVSVERSION"
1318 echo " Library path : $PVSLIB"
1319 echo " Realization support : $enable_pvs_libs$reason_pvs_libs"
1321 echo " Isabelle : $enable_isabelle_support$reason_isabelle_support"
1322 if test "$enable_isabelle_support" = yes ; then
1323 echo " Version : $ISABELLEVERSION ($ISABELLEDETECTEDVERSION)"
1324 echo " Realization support : $enable_isabelle_libs$reason_isabelle_libs"
1326 if test "$enable_local" = yes ; then
1327 echo "Installable : no"
1328 echo " OCaml library path : $OCAMLINSTALLLIB/why3"
1330 echo "Installable : yes"
1331 echo " Binary path : $bindir"
1332 echo " Library path : $libdir/why3"
1333 echo " Data path : $datarootdir/why3"
1334 echo " OCaml library path : $OCAMLINSTALLLIB/why3"
1335 echo " Relocatable : $enable_relocation"