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]),,
47 AS_HELP_STRING([--disable-zarith], [use Nums instead of Zarith for computations]),,
52 AC_ARG_ENABLE(ocamlfind,
53 AS_HELP_STRING([--disable-ocamlfind], [do not use Ocamlfind]),,
54 enable_ocamlfind=check)
59 AS_HELP_STRING([--disable-zip], [do not use LZ compression to store session files]),,
65 AS_HELP_STRING([--enable-infer], [use apron and fixpoint to infer loop invariants]),,
70 AC_ARG_ENABLE(bddinfer,
71 AS_HELP_STRING([--enable-bddinfer], [use apron and BDDs to infer loop invariants]),,
76 AC_ARG_ENABLE(js_of_ocaml,
77 AS_HELP_STRING([--disable-js-of-ocaml], [do not use js-of-ocaml]),,
78 enable_js_of_ocaml=check)
83 AS_HELP_STRING([--disable-re], [use Str instead of Re for regular expressions]),,
89 AS_HELP_STRING([--disable-sexp], [disable S-expression support for `Ptree` and `why3 pp`]),,
95 AS_HELP_STRING([--disable-ide], [do not build Why3 IDE]),,
98 AC_ARG_ENABLE(web_ide,
99 AS_HELP_STRING([--disable-web-ide], [do not build Why3 Web IDE]),,
100 enable_web_ide=check)
104 AC_ARG_ENABLE(coq-libs,
105 AS_HELP_STRING([--disable-coq-libs], [do not build Coq realizations]),,
106 enable_coq_libs=check)
110 AC_ARG_ENABLE(pvs-libs,
111 AS_HELP_STRING([--disable-pvs-libs], [do not build PVS realizations]),,
116 AC_ARG_ENABLE(isabelle-libs,
117 AS_HELP_STRING([--disable-isabelle-libs], [do not build Isabelle realizations]),,
118 enable_isabelle_libs=yes)
123 AS_HELP_STRING([--disable-mpfr], [disable support for MPFR]),,
126 # hypothesis selection
128 AC_ARG_ENABLE(hypothesis-selection,
129 AS_HELP_STRING([--disable-hypothesis-selection], [do not support hypothesis selection]),,
130 enable_hypothesis_selection=check)
134 AC_ARG_ENABLE(stackify,
135 AS_HELP_STRING([--disable-stackify], [disable structure reconstruction algorithm for MLCFG]),,
136 enable_stackify=check)
141 AS_HELP_STRING([--disable-doc], [do not build documentation]),,
144 AC_ARG_ENABLE(html-pdf,
145 AS_HELP_STRING([--disable-pdf-doc], [do not build PDF documentation]),,
148 # Experimental Jessie3 Frama-C plugin, disabled by default
150 AC_ARG_ENABLE(frama-c,
151 AS_HELP_STRING([--enable-frama-c], [enable Frama-C plugin]),,
153 reason_frama_c=" (disabled by default)"])
155 # profiling with statememprof
157 AC_ARG_ENABLE(statmemprof,
158 AS_HELP_STRING([--enable-statmemprof], [enable statistical memory profiling]),,
159 [enable_statmemprof=no
160 reason_statmemprof=" (disabled by default)"])
164 AC_ARG_ENABLE(emacs-compilation,
165 AS_HELP_STRING([--disable-emacs-compilation], [do not compile why3.elc]),,
166 enable_emacs_compilation=yes)
170 AC_ARG_VAR(EDITOR, [default editor])
172 # either relocation or local, not both
173 if test "$enable_relocation" = yes -a "$enable_local" = yes ; then
174 AC_MSG_ERROR([cannot use --enable-relocation and --enable-local at the same time.])
179 AC_MSG_CHECKING([executable suffix])
180 if uname -s | grep -q CYGWIN ; then
182 STRIP='echo "no strip "'
183 AC_MSG_RESULT([.exe <Cygwin>])
184 elif uname -s | grep -q MINGW ; then
187 AC_MSG_RESULT([.exe <MinGW>])
191 AC_MSG_RESULT([<none>])
198 AC_DEFUN([AX_VERSION_GE], [AS_VERSION_COMPARE([$1],[$2],[$4],[$3],[$3])])
200 # Check for Ocaml compilers
202 # we first look for ocamlc in the path; if not present, we fail
203 AC_CHECK_PROG(OCAMLC,ocamlc,ocamlc,no)
204 if test "$OCAMLC" = no ; then
205 AC_MSG_ERROR([cannot find ocamlc.])
208 # we extract Ocaml version number
209 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
210 AC_MSG_NOTICE([ocaml version is $OCAMLVERSION])
212 AX_VERSION_GE([$OCAMLVERSION], 4.08.0, [],
213 [AC_MSG_ERROR([You need Objective Caml 4.08.0 or higher.])])
216 # old way: OCAMLLIB=`$OCAMLC -v | tail -1 | cut -f 4 -d ' ' | tr -d '\\r'`
217 OCAMLLIB=`$OCAMLC -where | tr -d '\\r'`
218 AC_MSG_NOTICE([ocaml library path is $OCAMLLIB])
220 # then we look for ocamlopt; if not present, we issue a warning
221 # if the version is not the same, we also discard it
222 # we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not
223 AC_CHECK_PROG(OCAMLOPT,ocamlopt,ocamlopt,no)
225 if test "$OCAMLOPT" = no ; then
226 AC_MSG_WARN([cannot find ocamlopt; bytecode compilation only.])
228 AC_MSG_CHECKING([ocamlopt version])
229 TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
230 if test "$TMPVERSION" != "$OCAMLVERSION" ; then
231 AC_MSG_RESULT([differs from ocamlc; ocamlopt discarded.])
239 # checking for native-code
240 if test "$enable_native_code" != yes || test "$OCAMLBEST" = byte ; then
241 enable_native_code=no
246 # checking for ocamlc.opt
247 AC_CHECK_PROG(OCAMLCDOTOPT,ocamlc.opt,ocamlc.opt,no)
248 if test "$OCAMLCDOTOPT" != no ; then
249 AC_MSG_CHECKING([ocamlc.opt version])
250 TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
251 if test "$TMPVERSION" != "$OCAMLVERSION" ; then
252 AC_MSG_RESULT([differs from ocamlc; ocamlc.opt discarded.])
259 # checking for ocamlopt.opt
260 if test "$OCAMLOPT" != no ; then
261 AC_CHECK_PROG(OCAMLOPTDOTOPT,ocamlopt.opt,ocamlopt.opt,no)
262 if test "$OCAMLOPTDOTOPT" != no ; then
263 AC_MSG_CHECKING([ocamlc.opt version])
264 TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
265 if test "$TMPVER" != "$OCAMLVERSION" ; then
266 AC_MSG_RESULT([differs from ocamlc; ocamlopt.opt discarded.])
269 OCAMLOPT=$OCAMLOPTDOTOPT
274 # ocamldep, ocamllex and ocamlyacc should also be present in the path
275 AC_CHECK_PROG(OCAMLDEP,ocamldep,ocamldep,no)
276 if test "$OCAMLDEP" = no ; then
277 AC_MSG_ERROR([cannot find ocamldep.])
279 AC_CHECK_PROG(OCAMLDEPDOTOPT,ocamldep.opt,ocamldep.opt,no)
280 if test "$OCAMLDEPDOTOPT" != no ; then
281 OCAMLDEP=$OCAMLDEPDOTOPT
285 AC_CHECK_PROG(OCAMLLEX,ocamllex,ocamllex,no)
286 if test "$OCAMLLEX" = no ; then
287 AC_MSG_ERROR([cannot find ocamllex.])
289 AC_CHECK_PROG(OCAMLLEXDOTOPT,ocamllex.opt,ocamllex.opt,no)
290 if test "$OCAMLLEXDOTOPT" != no ; then
291 OCAMLLEX=$OCAMLLEXDOTOPT
295 AC_CHECK_PROG(OCAMLYACC,ocamlyacc,ocamlyacc,no)
296 if test "$OCAMLYACC" = no ; then
297 AC_MSG_ERROR([cannot find ocamlyacc.])
300 AC_CHECK_PROG(OCAMLDOC,ocamldoc,ocamldoc,true)
301 if test "$OCAMLDOC" != true ; then
302 AC_CHECK_PROG(OCAMLDOCOPT,ocamldoc.opt,ocamldoc.opt,no)
303 if test "$OCAMLDOCOPT" != no ; then
304 OCAMLDOC=$OCAMLDOCOPT
308 AC_CHECK_PROG(MENHIR,menhir,menhir,no)
309 if test "$MENHIR" = no ; then
310 AC_MSG_ERROR([cannot find menhir.])
313 MENHIRVERSION=`$MENHIR --version | sed -n -e 's,.*version *\(.*\)$,\1,p'`
314 AX_VERSION_GE([$MENHIRVERSION], 20170418, [],
315 [AC_MSG_ERROR([You need Menhir 20170418 or higher.])])
318 if test "$enable_ocamlfind" != no; then
319 AC_CHECK_PROG(OCAMLFIND,ocamlfind,ocamlfind,no)
320 if test "$OCAMLFIND" = no; then
321 reason_ocamlfind=" (not found)"
323 OCAMLFINDLIB=$(ocamlfind printconf stdlib | tr -d '\r')
324 if test "$OCAMLFINDLIB" != "$OCAMLLIB"; then
326 reason_ocamlfind=" (incompatible with OCaml)"
327 echo "but your ocamlfind is not compatible with your ocamlc:"
328 echo "ocamlfind: $OCAMLFINDLIB, ocamlc: $OCAMLLIB"
335 if test "$found_ocamlfind" = no; then
336 if test "$enable_ocamlfind" = yes; then
337 AC_MSG_ERROR([cannot use ocamlfind.])
342 if test "$enable_ocamlfind" != no; then
343 #if ocamlfind is used it gives the install path for ocaml library
344 OCAMLINSTALLLIB=$($OCAMLFIND printconf destdir | tr -d '\r')
347 OCAMLINSTALLLIB=$OCAMLLIB
351 if test "$enable_why3_lib" = yes ; then
354 if test "$enable_ocamlfind" = no; then
355 AC_MSG_ERROR([cannot use --disable-why3-lib without ocamlfind.])
358 AC_MSG_CHECKING([for Why3 using ocamlfind])
359 DIR=$($OCAMLFIND query why3 2> /dev/null | tr -d '\r')
360 if test -n "$DIR"; then
362 WHY3INCLUDE="-I $DIR"
365 AC_MSG_ERROR([cannot use --disable-why3-lib without an installed Why3.])
369 if test "$enable_local" = no; then
376 if test "$enable_ocamlfind" = yes; then
377 AC_MSG_CHECKING([for compiler-libs using ocamlfind])
378 COMPILERLIBS=$($OCAMLFIND query compiler-libs 2> /dev/null | tr -d '\r')
379 if test -n "$COMPILERLIBS"; then
385 reason_ppx=" (compiler-libs not found)"
391 # checking for sphinx
392 if test "$enable_doc" = yes; then
393 AC_CHECK_PROG(SPHINX,sphinx-build,sphinx-build,no)
394 if test "$SPHINX" = no; then
397 reason_doc=" (sphinx-build not found)"
398 AC_MSG_WARN([cannot find sphinx-build, documentation disabled.])
404 # checking for rubber or latexmk or pdflatex
405 if test "$enable_pdf_doc" = yes; then
406 AC_CHECK_PROGS(LATEX,latexmk rubber pdflatex,no)
407 if test "$LATEX" = no; then
409 reason_pdf_doc=" ((rubber|latexmk|pdflatex) not found)"
410 AC_MSG_WARN([cannot find any latex compiler, PDF documentation disabled.])
415 if test "$enable_emacs_compilation" = yes ; then
416 AC_CHECK_PROG(EMACS,emacs,emacs,no)
417 if test "$EMACS" = no ; then
418 enable_emacs_compilation=no
419 AC_MSG_WARN([cannot find emacs, compilation of why3.elc disabled.])
424 # (ocamlfind cannot be trusted here, since the default installation path is $OCAMLLIB)
426 if test "$enable_ocamlfind" = yes; then
427 AC_MSG_CHECKING([for num using ocamlfind])
428 DIR=$($OCAMLFIND query num 2> /dev/null | tr -d '\r')
429 if test -z "$DIR"; then
431 AC_MSG_ERROR([cannot find library Num using ocamlfind.])
437 AC_CHECK_FILE($DIR/nums.cma,,found_num=no)
438 AC_CHECK_FILE($DIR/num.cmi,,found_num=no)
440 if test "$found_num" = no; then
444 AC_CHECK_FILE($DIR/nums.cma,,found_num=no)
445 AC_CHECK_FILE($DIR/num.cmi,,found_num=no)
447 if test "$found_num" = no; then
448 AC_MSG_ERROR([cannot find library Num.])
451 # checking for Zarith
452 if test "$enable_zarith" = no; then
453 reason_zarith=" (disabled by user)"
457 if test "$enable_ocamlfind" = yes; then
458 AC_MSG_CHECKING([for zarith using ocamlfind])
459 DIR=$($OCAMLFIND query zarith 2> /dev/null | tr -d '\r')
460 if test -n "$DIR"; then
462 BIGINTINCLUDE="-I $DIR"
468 BIGINTINCLUDE="-I +zarith"
469 DIR="$OCAMLLIB/zarith"
470 AC_CHECK_FILE($DIR/zarith.cma,,found_zarith=no)
472 if test -n "$DIR"; then
473 AC_CHECK_FILE($DIR/z.cmi,,found_zarith=no)
475 if test "$found_zarith" = no; then
476 if test "$enable_zarith" = yes; then
477 AC_MSG_ERROR([cannot find library zarith.])
479 AC_MSG_WARN([cannot find library zarith, using Nums instead.])
481 reason_zarith=" (zarith not found)"
485 if test "$enable_zarith" != no; then
492 BIGINTINCLUDE="$NUMINCLUDE"
495 # checking for apron for bddinfer
496 if test "$enable_bddinfer" = yes; then
497 if test "$enable_ocamlfind" = yes; then
498 # gmp is a dependency of apron
499 INFERINCLUDE=$($OCAMLFIND query -separator ' ' -i-format apron 2> /dev/null | tr -d '\r')
501 if test -n "$INFERINCLUDE"; then
502 echo "ocamlfind found apron in $INFERINCLUDE"
504 INFERPKG="zarith apron apron.polkaMPQ"
507 reason_bddinfer=" (apron not found)"
508 AC_MSG_WARN([Lib apron not found, bddinfer will not be built.])
511 reason_bddinfer=" (disabled by default)"
514 # checking for apron and fixpoint
515 if test "$enable_infer" = yes; then
516 if test "$enable_ocamlfind" = yes; then
517 # gmp is a dependency of apron
518 INFERINCLUDE=$($OCAMLFIND query apron camllib 2> /dev/null | tr -d '\r')
520 if test -n "$INFERINCLUDE"; then
521 echo "ocamlfind found apron, camllib in $INFERINCLUDE"
522 INFERINCLUDE=$($OCAMLFIND query fixpoint 2> /dev/null | tr -d '\r')
523 if test -n "$INFERINCLUDE"; then
524 echo "ocamlfind found fixpoint in $INFERINCLUDE"
525 INFERINCLUDE="$($OCAMLFIND query -separator ' ' -i-format apron fixpoint camllib gmp 2> /dev/null | tr -d '\r')"
526 INFERLIB="apron fixpoint"
527 INFERPKG="apron fixpoint apron.boxMPQ apron.octMPQ apron.polkaMPQ"
530 AC_MSG_WARN([Lib fixpoint not found, infer will not be built.])
531 reason_infer=" (fixpoint not found)"
535 reason_infer=" (apron or camllib not found)"
536 AC_MSG_WARN([Lib apron or camllib not found, infer will not be built.])
539 reason_infer=" (disabled by default)"
542 # checking for camlzip
543 if test "$enable_zip" = no; then
544 reason_zip=" (disabled by user)"
548 if test "$enable_ocamlfind" = yes; then
549 AC_MSG_CHECKING([for camlzip using ocamlfind])
550 DIR=$($OCAMLFIND query zip 2> /dev/null | tr -d '\r')
551 if test -n "$DIR"; then
561 AC_CHECK_FILE($DIR/zip.cma,,found_zip=no)
563 if test -n "$DIR"; then
564 AC_CHECK_FILE($DIR/zip.cmi,,found_zip=no)
566 if test "$found_zip" = no; then
567 if test "$enable_zip" = yes; then
568 AC_MSG_ERROR([cannot find library camlzip.])
570 AC_MSG_WARN([cannot find library camlzip; sessions files will not be compressed.])
572 reason_zip=" (camlzip not found)"
576 if test "$enable_zip" != no; then
584 # checking for menhirlib
587 if test "$enable_ocamlfind" = yes; then
588 AC_MSG_CHECKING([for menhirLib using ocamlfind])
589 DIR=$($OCAMLFIND query menhirLib 2> /dev/null | tr -d '\r')
590 if test -n "$DIR"; then
592 MENHIRINCLUDE="-I $DIR"
598 MENHIRINCLUDE="-I +menhirLib"
599 DIR="$OCAMLLIB/menhirLib"
601 AC_CHECK_FILE($DIR/menhirLib.cmo,menhirlib_cmo=yes,)
602 AC_CHECK_FILE($DIR/menhirLib.cma,menhirlib_cmo=no,)
603 if test -z "$menhirlib_cmo"; then found_menhirlib=no; fi
605 if test -n "$DIR"; then
606 AC_CHECK_FILE($DIR/menhirLib.cmi,,found_menhirlib=no)
608 if test "$found_menhirlib" = no; then
609 AC_MSG_ERROR([cannot find library menhirLib.])
611 AC_SUBST(menhirlib_cmo)
614 if test "$enable_re" = no; then
615 reason_re=" (disabled by user)"
619 if test "$enable_ocamlfind" = yes; then
620 AC_MSG_CHECKING([for re using ocamlfind])
621 DIR=$($OCAMLFIND query re 2> /dev/null | tr -d '\r')
622 if test -n "$DIR"; then
632 AC_CHECK_FILE($DIR/re.cmx,,found_re=no)
634 if test -n "$DIR"; then
635 AC_CHECK_FILE($DIR/re.cmi,,found_re=no)
637 if test "$found_re" = no; then
638 if test "$enable_re" = yes; then
639 AC_MSG_ERROR([cannot find library re.])
641 AC_MSG_WARN([cannot find library re, using Str instead.])
643 reason_re=" (re not found)"
647 if test "$enable_re" != no; then
655 # checking for lablgtk3
656 if test "$enable_ide" = no ; then
657 reason_ide=" (disabled by user)"
659 if test "$enable_ide" != no -a "$enable_ocamlfind" = no; then
660 if test "$enable_ide" = yes; then
661 AC_MSG_ERROR([cannot build IDE without ocamlfind.])
664 reason_ide=" (ocamlfind not available)"
668 if test "$enable_ide" != no; then
669 AC_MSG_CHECKING([for lablgtk3 using ocamlfind])
670 DIR=$($OCAMLFIND query lablgtk3 2> /dev/null | tr -d '\r')
671 if test -n "$DIR"; then
674 AC_CHECK_FILE($DIR/gtkButton.cmi,,found_lablgtk=no)
679 if test "$found_lablgtk" = yes; then
681 PKGS_SOURCEVIEW="lablgtk3-sourceview3 lablgtk3.sourceview3 lablgtksourceview3"
685 # checking for lablgtksourceview
686 found_lablgtksourceview=no
687 if test "$found_lablgtk" = yes; then
688 for p in $PKGS_SOURCEVIEW; do
689 AC_MSG_CHECKING([for $p using ocamlfind])
690 DIR=$($OCAMLFIND query $p 2> /dev/null | tr -d '\r')
691 if test -n "$DIR"; then
693 AC_CHECK_FILE($DIR/gSourceView$GTKVERSION.cmi,,p=)
694 if test -n "$p"; then
702 if test -n "$PKG_SOURCEVIEW"; then
703 found_lablgtksourceview=yes
707 if test "$enable_ide" != no -a "$found_lablgtk" = no; then
708 if test "$enable_ide" = yes; then
709 AC_MSG_ERROR([cannot build IDE without lablgtk3.])
711 AC_MSG_WARN([cannot find library lablgtk3, IDE disabled.])
713 reason_ide=" (lablgtk3 not found)"
716 if test "$enable_ide" != no -a "$found_lablgtksourceview" = no; then
717 if test "$enable_ide" = yes; then
718 AC_MSG_ERROR([cannot build IDE without lablgtksourceview.])
720 AC_MSG_WARN([cannot find library lablgtksourceview, IDE disabled.])
722 reason_ide=" (lablgtksourceview not found)"
725 if test "$enable_ide" != no; then
727 LABLGTKPKG="lablgtk$GTKVERSION $PKG_SOURCEVIEW"
730 if test "$enable_hypothesis_selection" != no -o "$enable_stackify" != no; then
733 if test "$enable_ocamlfind" = yes; then
734 AC_MSG_CHECKING([for ocamlgraph using ocamlfind])
735 DIR=$($OCAMLFIND query ocamlgraph 2> /dev/null | tr -d '\r')
736 if test -n "$DIR"; then
744 OCAMLGRAPHLIB="+ocamlgraph"
745 DIR="$OCAMLLIB/ocamlgraph"
746 AC_CHECK_FILE($DIR/graph.cma,,found_ocamlgraph=no)
748 if test -n "$DIR"; then
749 AC_CHECK_FILE($DIR/graph.cmi,,found_ocamlgraph=no)
753 if test "$enable_hypothesis_selection" = no; then
754 reason_hypothesis_selection=" (disabled by user)"
755 elif test "$found_ocamlgraph" = no; then
756 if test "$enable_hypothesis_selection" = yes; then
757 AC_MSG_ERROR([cannot enable hypothesis selection without ocamlgraph.])
759 enable_hypothesis_selection=no
760 reason_hypothesis_selection=" (ocamlgraph not found)"
761 AC_MSG_WARN([cannot find library ocamlgraph, hypothesis selection disabled.])
764 if test "$enable_hypothesis_selection" != no; then
765 META_OCAMLGRAPH="ocamlgraph"
766 enable_hypothesis_selection=yes
772 if test "$enable_stackify" = no; then
773 reason_stackify=" (disabled by user)"
774 elif test "$found_ocamlgraph" = no; then
775 if test "$enable_stackify" = yes; then
776 AC_MSG_ERROR([cannot enable stackify without ocamlgraph.])
779 reason_stackify=" (ocamlgraph not found)"
780 AC_MSG_WARN([cannot find library ocamlgraph, stackify disabled.])
783 if test "$enable_stackify" != no; then
784 META_OCAMLGRAPH="ocamlgraph"
793 if test "$enable_mpfr" = no; then
794 reason_mpfr=" (disabled by user)"
795 elif test "$enable_ocamlfind" != yes; then
796 reason_mpfr=" (ocamlfind not available)"
797 elif test "$enable_js_of_ocaml" = yes -o "$enable_web_ide" = yes; then
798 if test "$enable_mpfr" = yes; then
799 AC_MSG_ERROR([cannot enable support for both MPFR and Javascript.])
801 reason_mpfr=" (incompatible with js_of_ocaml) "
804 AC_MSG_CHECKING([for mlmpfr])
805 DIR=$($OCAMLFIND query mlmpfr 2> /dev/null | tr -d '\r')
806 if test -n "$DIR"; then
809 echo "ocamlfind found mlmpfr in $DIR"
810 # Test that MPFR version is higher than 4.0.0 (because of
811 # Faithful constructor incompatibility).
812 MPFRVERSION=$($OCAMLFIND query -format "%v" mlmpfr 2> /dev/null | tr -d '\r')
813 AX_VERSION_GE([$MPFRVERSION], 4.0.0, [], [
815 reason_mpfr=" (mlmpfr >= 4.0.0 not found)"])
816 AC_CHECK_FILE($DIR/mpfr.cmi, [old_mpfr=yes], )
817 AC_CHECK_FILE($DIR/mlmpfr.cma,, [
819 reason_mpfr=" (mlmpfr not found)"])
822 reason_mpfr=" (mlmpfr not found)"
827 if test "$enable_mpfr" != no -a "$found_mlmpfr" = no; then
828 if test "$enable_mpfr" = yes; then
829 AC_MSG_ERROR([cannot enable MPFR support without mlmpfr.])
834 if test "$enable_mpfr" != no; then
839 # checking for js_of_ocaml
841 if test "$enable_js_of_ocaml" = no; then
842 reason_js_of_ocaml=" (disabled by user)"
843 elif test "$enable_mpfr" = yes; then
844 reason_js_of_ocaml=" (incompatible with MPFR support)"
845 elif test "$enable_ocamlfind" != yes; then
846 reason_js_of_ocaml=" (ocamlfind not available)"
848 found_js_of_ocaml=yes
849 for p in js_of_ocaml js_of_ocaml-ppx; do
850 AC_MSG_CHECKING([for $p])
851 DIR=$($OCAMLFIND query $p 2> /dev/null | tr -d '\r')
852 if test -z "$DIR"; then
855 reason_js_of_ocaml=" ($p not found)"
863 if test "$enable_js_of_ocaml" != no -a "$found_js_of_ocaml" = no; then
864 if test "$enable_js_of_ocaml" = yes; then
865 AC_MSG_ERROR([cannot enable Javascript support without ocamlfind.])
867 enable_js_of_ocaml=no
870 if test "$enable_js_of_ocaml" != no; then
871 enable_js_of_ocaml=yes
872 JSOFOCAMLPKG="js_of_ocaml js_of_ocaml-ppx"
876 if test "$enable_web_ide" = no; then
877 reason_web_ide=" (disabled by user)"
878 elif test "$enable_js_of_ocaml" != yes; then
879 if test "$enable_web_ide" = yes; then
880 AC_MSG_ERROR([cannot enable web IDE without Javascript support.])
883 reason_web_ide=" (Javascript support not available)"
888 # checking for statmemprof
889 if test "$enable_statmemprof" = yes; then
890 if test "$enable_ocamlfind" != yes; then
891 enable_statmemprof=no
892 reason_statmemprof=" (ocamlfind not available)"
894 DIR=$($OCAMLFIND query statmemprof-emacs 2> /dev/null | tr -d '\r')
895 if test -z "$DIR"; then
896 enable_statmemprof=no
897 reason_statmemprof=" (statmemprof-emacs not found)"
899 STATMEMPROFPKG=statmemprof-emacs
903 # ppx_sexp_conv (only with ocamlfind)
906 if test "$enable_sexp" = no; then
907 reason_sexp=" (disabled by user)"
909 if test "$enable_ocamlfind" != yes; then
911 reason_sexp=" (ocamlfind not available)"
912 elif test "$enable_ppx" != yes; then
914 reason_sexp=" (requires ppx)"
916 for p in ppx_sexp_conv sexplib ppx_deriving; do
917 AC_MSG_CHECKING([for $p using ocamlfind])
918 DIR=$($OCAMLFIND query $p 2> /dev/null | tr -d '\r')
919 if test -z "$DIR"; then
922 reason_sexp=" ($p not found)"
929 if test "$enable_sexp" = yes; then
930 SEXPLIBPPX="ppx_sexp_conv"
931 SEXPLIB="sexplib sexplib.num"
937 enable_coq_support=yes
938 enable_coq_fp_libs=yes
942 if test "$enable_coq_libs" = no; then
943 enable_coq_support=no
944 reason_coq_support=" (disabled by user)"
947 if test "$enable_coq_support" = yes; then
948 AC_CHECK_PROG(COQC,coqc,coqc,no)
949 if test "$COQC" = no ; then
950 enable_coq_support=no
951 reason_coq_support=" (coqc not found)"
955 if test "$enable_coq_support" = yes; then
956 COQLIB=`$COQC -where | sed -e 's|\\\|/|g' -e 's| |\\ |g'`
957 AC_MSG_CHECKING(Coq version)
958 COQVERSION=[`$COQC -v | sed -n -e 's|.*version *\([^ ]*\).*|\1|p'`]
959 AC_MSG_RESULT($COQVERSION)
960 COQNUMVERSION=[`echo $COQVERSION | awk -F. '{ printf("%d%02d\n", $1,$2); }'`]
961 if test "$COQNUMVERSION" -lt 811; then
962 if test "$enable_coq_libs" = yes; then
963 AC_MSG_ERROR([cannot build Coq libraries without Coq >= 8.11.])
965 enable_coq_support=no
966 AC_MSG_WARN([cannot build Coq libraries without Coq >= 8.11.])
967 reason_coq_support=" (need version >= 8.11)"
969 if test "$COQNUMVERSION" -ge 817; then
970 COQFLAGS="-w deprecated-instance-without-locality,deprecated-hint-without-locality"
972 if test "$COQNUMVERSION" -gt 818; then
973 AC_MSG_WARN([unrecognized Coq version, assuming Coq 8.18])
976 coq_compat_version="COQ$COQNUMVERSION"
978 if test "$enable_coq_fp_libs" = no; then
979 reason_coq_fp_libs= " (Coq < 8.11)"
983 if test "$enable_coq_support" = yes; then
984 AC_CHECK_PROG(COQDEP,coqdep,coqdep,no)
985 if test "$COQDEP" = no; then
986 if test "$enable_coq_libs" = yes; then
987 AC_MSG_ERROR([cannot build Coq libraries without Coqdep.])
989 enable_coq_support=no
990 reason_coq_support=" (coqdep not found)"
994 if test "$enable_coq_support" = no; then
996 enable_coq_fp_libs=no
1002 if test "$enable_coq_fp_libs" = yes; then
1003 AC_MSG_CHECKING([for Flocq])
1005 [ echo "Require Import Flocq.Version BinNat." \
1006 "Goal (30400 <= Flocq_version)%N. easy. Qed." > conftest.v
1007 "$COQC" conftest.v > conftest.err ],
1008 [ AC_MSG_RESULT(yes) ],
1010 enable_coq_fp_libs=no
1011 reason_coq_fp_libs=" (Flocq >= 3.4 not found)" ])
1012 rm -f conftest.v conftest.vo conftest.err
1017 if test "$enable_pvs_libs" = no; then
1018 enable_pvs_support=no
1019 reason_pvs_support=" (disabled by user)"
1021 AC_CHECK_PROG(PVS,pvs,pvs,no)
1022 if test "$PVS" = no ; then
1023 enable_pvs_support=no
1024 reason_pvs_support=" (pvs not found)"
1025 elif $PVS --help 2> /dev/null | grep -q "physical volume"; then
1026 AC_MSG_NOTICE([pvs does not seem to be the theorem prover])
1027 enable_pvs_support=no
1028 reason_pvs_support=" (pvs not found)"
1030 PVSLIB=`$PVS -where`
1031 AC_MSG_CHECKING(PVS version)
1032 PVSVERSION=[`$PVS -version | sed -n -e 's|.*Version *\([^ ]*\)$|\1|p'`]
1033 AC_MSG_RESULT($PVSVERSION)
1036 enable_pvs_support=yes
1039 enable_pvs_support=no
1040 AC_MSG_WARN([You need PVS 6.0 or higher; PVS discarded.])
1041 reason_pvs_support=" (need version 6.0 or higher)"
1047 if test "$enable_pvs_support" = no; then
1054 # Default version used for generation of realization in the case Isabelle is not
1055 # detected or Why3 is compiled with disable-isabelle.
1056 ISABELLEVERSION=2021-1
1058 if test "$enable_isabelle_libs" = no; then
1059 enable_isabelle_support=no
1060 reason_isabelle_support=" (disabled by user)"
1062 AC_CHECK_PROG(ISABELLE,isabelle,isabelle,no)
1063 if test "$ISABELLE" = no ; then
1064 enable_isabelle_support=no
1065 reason_isabelle_support=" (isabelle not found)"
1067 AC_MSG_CHECKING(Isabelle version)
1068 ISABELLEDETECTEDVERSION=[`$ISABELLE version | sed -n -e 's|Isabelle\([^:]*\).*$|\1|p'`]
1069 AC_MSG_RESULT($ISABELLEDETECTEDVERSION)
1070 case $ISABELLEDETECTEDVERSION in
1072 enable_isabelle_support=yes
1073 ISABELLEVERSION=2019
1076 enable_isabelle_support=yes
1077 ISABELLEVERSION=2021-1
1080 enable_isabelle_support=yes
1081 ISABELLEVERSION=2021-1
1084 enable_isabelle_support=no
1085 AC_MSG_WARN([You need Isabelle 2019 or later; Isabelle discarded.])
1086 reason_isabelle_support=" (need version >= 2019)"
1092 if test "$enable_isabelle_support" = no; then
1093 enable_isabelle_libs=no
1096 if test "$enable_pvs_libs" = yes; then
1097 AC_MSG_CHECKING([for NASA PVS library])
1099 reason_pvs_libs=" (no NASA PVS library in PVS_LIBRARY_PATH)"
1100 for dir in `echo $PVS_LIBRARY_PATH | tr ':' ' '`; do
1101 if test -f $dir/nasalib-version; then
1106 AC_MSG_RESULT($enable_pvs_libs)
1110 FRAMAC_SUPPORTED=Sulfur
1111 if test "$enable_frama_c" = yes ; then
1112 AC_CHECK_PROG(FRAMAC,frama-c,frama-c,no)
1113 if test "$FRAMAC" = no ; then
1115 reason_frama_c=" (frama-c not found)"
1117 AC_MSG_CHECKING(Frama-C version)
1118 FRAMAC_VERSION=`$FRAMAC -version | sed -n -e 's|\(Version: \)\?\(.*\)$|\2|p'`
1119 AC_MSG_RESULT($FRAMAC_VERSION)
1120 case $FRAMAC_VERSION in
1121 $FRAMAC_SUPPORTED-*) ;;
1122 *) AC_MSG_WARN(Version $FRAMAC_SUPPORTED required.)
1124 reason_frama_c=" (version $FRAMAC_SUPPORTED required)"
1130 if test "$enable_frama_c" = yes; then
1131 FRAMAC_SHARE=`$FRAMAC -print-path`
1132 FRAMAC_LIBDIR=`$FRAMAC -print-libpath`
1133 FRAMAC_INCLUDE="-I $FRAMAC_LIBDIR"
1136 VERSION=$PACKAGE_VERSION
1140 if test -z "$EDITOR"; then
1146 EDITOR="cmd.exe -c start"
1154 # substitutions to perform
1157 AC_SUBST(enable_verbose_make)
1169 AC_SUBST(OCAMLVERSION)
1171 AC_SUBST(OCAMLINSTALLLIB)
1172 AC_SUBST(OCAMLGRAPHLIB)
1175 AC_SUBST(enable_ocamlfind)
1178 AC_SUBST(enable_statmemprof)
1179 AC_SUBST(STATMEMPROFPKG)
1181 AC_SUBST(enable_ide)
1182 AC_SUBST(LABLGTKPKG)
1183 AC_SUBST(GTKVERSION)
1185 AC_SUBST(enable_web_ide)
1186 AC_SUBST(enable_js_of_ocaml)
1187 AC_SUBST(JSOFOCAMLPKG)
1189 AC_SUBST(META_OCAMLGRAPH)
1191 AC_SUBST(enable_ppx)
1192 AC_SUBST(enable_sexp)
1194 AC_SUBST(SEXPLIBPPX)
1196 AC_SUBST(NUMINCLUDE)
1198 AC_SUBST(enable_mpfr)
1201 AC_SUBST(enable_zarith)
1202 AC_SUBST(BIGINTINCLUDE)
1206 AC_SUBST(enable_infer)
1207 AC_SUBST(enable_bddinfer)
1208 AC_SUBST(INFERINCLUDE)
1212 AC_SUBST(enable_zip)
1213 AC_SUBST(ZIPINCLUDE)
1216 AC_SUBST(MENHIRINCLUDE)
1222 AC_SUBST(enable_coq_libs)
1223 AC_SUBST(enable_coq_fp_libs)
1224 AC_SUBST(coq_compat_version)
1229 AC_SUBST(COQVERSION)
1232 AC_SUBST(enable_pvs_libs)
1234 AC_SUBST(PVSVERSION)
1236 AC_SUBST(enable_isabelle_libs)
1238 AC_SUBST(ISABELLEVERSION)
1240 AC_SUBST(enable_hypothesis_selection)
1241 AC_SUBST(enable_stackify)
1243 AC_SUBST(enable_doc)
1244 AC_SUBST(enable_pdf_doc)
1249 AC_SUBST(enable_emacs_compilation)
1252 AC_SUBST(enable_frama_c)
1255 AC_SUBST(FRAMAC_VERSION)
1256 AC_SUBST(FRAMAC_SHARE)
1257 AC_SUBST(FRAMAC_LIBDIR)
1258 AC_SUBST(FRAMAC_INCLUDE)
1260 AC_SUBST(enable_local)
1263 AC_SUBST(enable_why3_lib)
1265 AC_SUBST(WHY3INCLUDE)
1267 AC_SUBST(enable_relocation)
1269 # Finally create the Makefile from Makefile.in
1270 AC_CONFIG_FILES(Makefile)
1271 AC_CONFIG_FILES(src/config.sh)
1272 AC_CONFIG_FILES(lib/why3/META)
1273 AC_CONFIG_FILES(.merlin)
1274 AC_CONFIG_FILES(src/jessie/Makefile)
1275 AC_CONFIG_FILES(src/jessie/.merlin)
1276 AC_CONFIG_FILES(lib/coq/version lib/pvs/version)
1277 AC_CONFIG_COMMANDS([chmod],
1278 chmod a-w Makefile src/jessie/Makefile;
1279 chmod a-w src/config.sh;
1280 chmod a-w lib/why3/META;
1282 chmod a-w src/jessie/Makefile;
1283 chmod a-w src/jessie/.merlin;
1284 chmod a-w lib/coq/version lib/pvs/version;
1285 chmod u+x src/config.sh)
1294 echo "-----------------------------------------"
1295 echo "Verbose make : $enable_verbose_make"
1296 echo "OCaml compiler : yes"
1297 echo " Version : $OCAMLVERSION"
1298 echo " Library path : $OCAMLLIB"
1299 echo " Ocamlfind : $enable_ocamlfind$reason_ocamlfind"
1300 echo " Native compilation : $enable_native_code"
1301 echo " Memory profiling : $enable_statmemprof$reason_statmemprof"
1302 echo " PPX : $enable_ppx$reason_ppx"
1303 echo " S-expressions support : $enable_sexp$reason_sexp"
1304 echo " Javascript support : $enable_js_of_ocaml$reason_js_of_ocaml"
1305 echo " MPFR support : $enable_mpfr$reason_mpfr"
1306 echo " Re support : $enable_re$reason_re"
1308 echo " Why3 library : $enable_why3_lib"
1309 echo " GTK IDE : $enable_ide$reason_ide"
1310 echo " Web IDE : $enable_web_ide$reason_web_ide"
1311 echo " GMP arithmetic : $enable_zarith$reason_zarith"
1312 echo " Compressed sessions : $enable_zip$reason_zip"
1313 echo " Hypothesis selection : $enable_hypothesis_selection$reason_hypothesis_selection"
1314 echo " Stackify : $enable_stackify$reason_stackify"
1315 echo " Invariant inference(exp): $enable_infer$reason_infer"
1316 echo " Inference with BDDs(exp): $enable_bddinfer$reason_bddinfer"
1317 echo " Frama-C support : $enable_frama_c$reason_frama_c"
1318 if test "$enable_frama_c" = yes ; then
1319 echo " Version : $FRAMAC_VERSION"
1320 echo " Share path : $FRAMAC_SHARE"
1321 echo " Library path : $FRAMAC_LIBDIR"
1323 echo "Documentation : $enable_doc$reason_doc"
1324 if test "$enable_doc" = yes ; then
1326 echo " PDF : $enable_pdf_doc$reason_pdf_doc"
1328 echo "Support for interactive proof assistants"
1329 echo " Coq : $enable_coq_support$reason_coq_support"
1330 if test "$enable_coq_support" = yes ; then
1331 echo " Version : $COQVERSION"
1332 echo " Library path : $COQLIB"
1333 echo " Realization support : $enable_coq_libs$reason_coq_libs"
1334 if test "$enable_coq_libs" = yes ; then
1335 echo " FP arithmetic : $enable_coq_fp_libs$reason_coq_fp_libs"
1338 echo " PVS : $enable_pvs_support$reason_pvs_support"
1339 if test "$enable_pvs_support" = yes ; then
1340 echo " Version : $PVSVERSION"
1341 echo " Library path : $PVSLIB"
1342 echo " Realization support : $enable_pvs_libs$reason_pvs_libs"
1344 echo " Isabelle : $enable_isabelle_support$reason_isabelle_support"
1345 if test "$enable_isabelle_support" = yes ; then
1346 echo " Version : $ISABELLEVERSION ($ISABELLEDETECTEDVERSION)"
1347 echo " Realization support : $enable_isabelle_libs$reason_isabelle_libs"
1349 if test "$enable_local" = yes ; then
1350 echo "Installable : no"
1351 echo " OCaml library path : $OCAMLINSTALLLIB/why3"
1353 echo "Installable : yes"
1354 echo " Binary path : $bindir"
1355 echo " Library path : $libdir/why3"
1356 echo " Data path : $datarootdir/why3"
1357 echo " OCaml library path : $OCAMLINSTALLLIB/why3"
1358 echo " Relocatable : $enable_relocation"