1 ####################################################################
3 # The Why3 Verification Platform / The Why3 Development Team #
4 # Copyright 2010-2020 -- Inria - CNRS - Paris-Sud 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 ####################################################################
13 # autoconf input for Objective Caml programs
14 # Copyright (C) 2001 Jean-Christophe FilliĆ¢tre
15 # from a first script by Georges Mariano
17 # This library is free software; you can redistribute it and/or
18 # modify it under the terms of the GNU Library General Public
19 # License version 2, as published by the Free Software Foundation.
21 # This library is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
25 # See the GNU Library General Public License version 2 for more details
26 # (enclosed in the file LGPL).
28 AC_INIT([Why3], [1.3.3])
32 AC_ARG_ENABLE(verbose-make,
33 AS_HELP_STRING([--enable-verbose-make], [verbose makefile recipes]),,
34 enable_verbose_make=no)
39 AS_HELP_STRING([--enable-local], [use Why3 in the build directory (no installation)]),,
42 # RELOCATABLE INSTALLATION
44 AC_ARG_ENABLE(relocation,
45 AS_HELP_STRING([--enable-relocation], [allow for later relocation of Why3 installation]),,
50 AC_ARG_ENABLE(native-code,
51 AS_HELP_STRING([--disable-native-code], [use only the byte-code compiler]),,
52 enable_native_code=yes)
56 AC_ARG_ENABLE(why3-lib,
57 AS_HELP_STRING([--disable-why3-lib], [use an already installed Why3]),,
63 AS_HELP_STRING([--disable-zarith], [use Nums instead of Zarith for computations]),,
68 AC_ARG_ENABLE(ocamlfind,
69 AS_HELP_STRING([--disable-ocamlfind], [do not use Ocamlfind]),,
75 AS_HELP_STRING([--disable-zip], [do not use LZ compression to store session files]),,
80 AC_ARG_ENABLE(js_of_ocaml,
81 AS_HELP_STRING([--disable-js-of-ocaml], [do not use js-of-ocaml]),,
82 enable_js_of_ocaml=yes)
87 AS_HELP_STRING([--disable-re], [use Str instead of Re for regular expressions]),,
93 AS_HELP_STRING([--disable-ide], [do not build Why3 IDE]),,
96 AC_ARG_ENABLE(web_ide,
97 AS_HELP_STRING([--disable-web-ide], [do not build Why3 Web IDE]),,
102 AC_ARG_ENABLE(coq-libs,
103 AS_HELP_STRING([--disable-coq-libs], [do not build Coq realizations]),,
108 AC_ARG_ENABLE(pvs-libs,
109 AS_HELP_STRING([--disable-pvs-libs], [do not build PVS realizations]),,
114 AC_ARG_ENABLE(isabelle-libs,
115 AS_HELP_STRING([--disable-isabelle-libs], [do not build Isabelle realizations]),,
116 enable_isabelle_libs=yes)
118 # hypothesis selection
120 AC_ARG_ENABLE(hypothesis-selection,
121 AS_HELP_STRING([--disable-hypothesis-selection], [do not support hypothesis selection]),,
122 enable_hypothesis_selection=yes)
127 AS_HELP_STRING([--disable-doc], [do not build documentation]),,
130 AC_ARG_ENABLE(html-pdf,
131 AS_HELP_STRING([--disable-pdf-doc], [do not build PDF documentation]),,
134 # Experimental Jessie3 Frama-C plugin, disabled by default
136 AC_ARG_ENABLE(frama-c,
137 AS_HELP_STRING([--enable-frama-c], [enable Frama-C plugin]),,
139 reason_frama_c=" (disabled by default)"])
143 AC_ARG_ENABLE(profiling,
144 AS_HELP_STRING([--enable-profiling], [enable profiling]),,
147 AC_ARG_ENABLE(statmemprof,
148 AS_HELP_STRING([--enable-statmemprof], [enable statistical memory profiling]),,
149 [enable_statmemprof=no
150 reason_statmemprof=" (disabled by default)"])
154 AC_ARG_ENABLE(emacs-compilation,
155 AS_HELP_STRING([--disable-emacs-compilation], [do not compile why3.elc]),,
156 enable_emacs_compilation=yes)
158 # either relocation or local, not both
159 if test "$enable_relocation" = yes ; then
160 if test "$enable_local" = yes ; then
161 AC_MSG_ERROR(cannot use --enable-relocation and --enable-local at the same time.)
167 AC_MSG_CHECKING(executable suffix)
168 if uname -s | grep -q CYGWIN ; then
170 STRIP='echo "no strip "'
171 AC_MSG_RESULT(.exe <Cygwin>)
173 if uname -s | grep -q MINGW ; then
176 AC_MSG_RESULT(.exe <MinGW>)
180 AC_MSG_RESULT(<none>)
185 # Add compatibility for C99
190 AC_DEFUN([AX_VERSION_GE], [AS_VERSION_COMPARE([$1],[$2],[$4],[$3],[$3])])
192 # Check for Ocaml compilers
194 # we first look for ocamlc in the path; if not present, we fail
195 AC_CHECK_PROG(OCAMLC,ocamlc,ocamlc,no)
196 if test "$OCAMLC" = no ; then
197 AC_MSG_ERROR(Cannot find ocamlc.)
200 # we extract Ocaml version number
201 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
202 echo "ocaml version is $OCAMLVERSION"
204 AX_VERSION_GE([$OCAMLVERSION], 4.05.0, [],
205 [AC_MSG_ERROR(You need Objective Caml 4.05.0 or higher.)])
208 # old way: OCAMLLIB=`$OCAMLC -v | tail -1 | cut -f 4 -d ' ' | tr -d '\\r'`
209 OCAMLLIB=`$OCAMLC -where | tr -d '\\r'`
210 echo "ocaml library path is $OCAMLLIB"
212 # then we look for ocamlopt; if not present, we issue a warning
213 # if the version is not the same, we also discard it
214 # we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not
215 AC_CHECK_PROG(OCAMLOPT,ocamlopt,ocamlopt,no)
217 if test "$OCAMLOPT" = no ; then
218 AC_MSG_WARN(Cannot find ocamlopt; bytecode compilation only.)
220 AC_MSG_CHECKING(ocamlopt version)
221 TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
222 if test "$TMPVERSION" != "$OCAMLVERSION" ; then
223 AC_MSG_RESULT(differs from ocamlc; ocamlopt discarded.)
231 # checking for native-code
232 if test "$enable_native_code" != yes || test "$OCAMLBEST" = byte ; then
233 enable_native_code=no
238 # checking for ocamlc.opt
239 AC_CHECK_PROG(OCAMLCDOTOPT,ocamlc.opt,ocamlc.opt,no)
240 if test "$OCAMLCDOTOPT" != no ; then
241 AC_MSG_CHECKING(ocamlc.opt version)
242 TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
243 if test "$TMPVERSION" != "$OCAMLVERSION" ; then
244 AC_MSG_RESULT(differs from ocamlc; ocamlc.opt discarded.)
251 # checking for ocamlopt.opt
252 if test "$OCAMLOPT" != no ; then
253 AC_CHECK_PROG(OCAMLOPTDOTOPT,ocamlopt.opt,ocamlopt.opt,no)
254 if test "$OCAMLOPTDOTOPT" != no ; then
255 AC_MSG_CHECKING(ocamlc.opt version)
256 TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p'`
257 if test "$TMPVER" != "$OCAMLVERSION" ; then
258 AC_MSG_RESULT(differs from ocamlc; ocamlopt.opt discarded.)
261 OCAMLOPT=$OCAMLOPTDOTOPT
266 # ocamldep, ocamllex and ocamlyacc should also be present in the path
267 AC_CHECK_PROG(OCAMLDEP,ocamldep,ocamldep,no)
268 if test "$OCAMLDEP" = no ; then
269 AC_MSG_ERROR(Cannot find ocamldep.)
271 AC_CHECK_PROG(OCAMLDEPDOTOPT,ocamldep.opt,ocamldep.opt,no)
272 if test "$OCAMLDEPDOTOPT" != no ; then
273 OCAMLDEP=$OCAMLDEPDOTOPT
277 AC_CHECK_PROG(OCAMLLEX,ocamllex,ocamllex,no)
278 if test "$OCAMLLEX" = no ; then
279 AC_MSG_ERROR(Cannot find ocamllex.)
281 AC_CHECK_PROG(OCAMLLEXDOTOPT,ocamllex.opt,ocamllex.opt,no)
282 if test "$OCAMLLEXDOTOPT" != no ; then
283 OCAMLLEX=$OCAMLLEXDOTOPT
287 AC_CHECK_PROG(OCAMLYACC,ocamlyacc,ocamlyacc,no)
288 if test "$OCAMLYACC" = no ; then
289 AC_MSG_ERROR(Cannot find ocamlyacc.)
292 AC_CHECK_PROG(OCAMLDOC,ocamldoc,ocamldoc,true)
293 if test "$OCAMLDOC" = true ; then
294 AC_MSG_WARN(Cannot find ocamldoc)
296 AC_CHECK_PROG(OCAMLDOCOPT,ocamldoc.opt,ocamldoc.opt,no)
297 if test "$OCAMLDOCOPT" != no ; then
298 OCAMLDOC=$OCAMLDOCOPT
302 AC_CHECK_PROG(MENHIR,menhir,menhir,no)
303 if test "$MENHIR" = no ; then
304 AC_MSG_ERROR(Cannot find menhir.)
307 MENHIRVERSION=`$MENHIR --version | sed -n -e 's,.*version *\(.*\)$,\1,p'`
308 AX_VERSION_GE([$MENHIRVERSION], 20151112, [],
309 [AC_MSG_ERROR(You need Menhir 20151112 or higher.)])
311 if test "$enable_ocamlfind" != yes; then
314 AC_CHECK_PROG(OCAMLFIND,ocamlfind,ocamlfind,no)
315 if test "$OCAMLFIND" = no; then
317 reason_ocamlfind=" (not found)"
319 OCAMLFINDLIB=$(ocamlfind printconf stdlib)
320 if test "$OCAMLFINDLIB" != "$OCAMLLIB"; then
323 reason_ocamlfind=" (incompatible with OCaml)"
324 echo "but your ocamlfind is not compatible with your ocamlc:"
325 echo "ocamlfind: $OCAMLFINDLIB, ocamlc: $OCAMLLIB"
330 #if ocamlfind is used it gives the install path for ocaml library
331 if test "$enable_ocamlfind" = yes; then
332 OCAMLINSTALLLIB=$($OCAMLFIND printconf destdir)
334 OCAMLINSTALLLIB=$OCAMLLIB
337 if test "$enable_why3_lib" = yes ; then
340 AC_MSG_CHECKING([For Why3])
341 if test "$enable_ocamlfind" = no; then
343 AC_MSG_ERROR([Cannot use --disable-why3-lib without ocamlfind.])
346 DIR=$($OCAMLFIND query why3)
347 if test -n "$DIR"; then
348 AC_MSG_RESULT([$DIR])
349 WHY3INCLUDE="-I $DIR"
352 AC_MSG_ERROR([Cannot use --disable-why3-lib without an installed Why3.])
356 if test "$enable_local" = no; then
363 if test "$enable_ocamlfind" = yes; then
364 COMPILERLIBS=$($OCAMLFIND query compiler-libs)
365 if test -n "$COMPILERLIBS"; then
366 echo "ocamlfind found compiler-libs in $COMPILERLIBS"
370 reason_ppx=" (compiler-libs not found)"
376 # checking for sphinx
377 if test "$enable_doc" = yes; then
378 AC_CHECK_PROG(SPHINX,sphinx-build,sphinx-build,no)
379 if test "$SPHINX" = no; then
382 reason_doc=" (sphinx-build not found)"
383 AC_MSG_WARN([Cannot find sphinx-build, Documentation disabled.])
389 # checking for rubber or latexmk or pdflatex
390 if test "$enable_pdf_doc" = yes; then
391 AC_CHECK_PROGS(LATEX,latexmk rubber pdflatex,no)
392 if test "$LATEX" = no; then
394 reason_pdf_doc=" ((rubber|latexmk|pdflatex) not found)"
395 AC_MSG_WARN([Cannot find any latex compiler, PDF documentation disabled.])
400 if test "$enable_emacs_compilation" = yes ; then
401 AC_CHECK_PROG(EMACS,emacs,emacs,no)
402 if test "$EMACS" = no ; then
403 enable_emacs_compilation=no
404 AC_MSG_WARN([Cannot find emacs, compilation of why3.elc disabled.])
409 # (ocamlfind cannot be trusted here, since the default installation path is $OCAMLLIB)
411 if test "$enable_ocamlfind" = yes; then
412 DIR=$($OCAMLFIND query num)
413 if test -n "$DIR"; then
414 echo "ocamlfind found num in $DIR"
418 AC_CHECK_FILE($DIR/nums.cma,,found_num=no)
419 AC_CHECK_FILE($DIR/num.cmi,,found_num=no)
422 reason_ocamlfind=" (unable to find num)"
425 if test "$found_num" = no; then
429 AC_CHECK_FILE($DIR/nums.cma,,found_num=no)
430 AC_CHECK_FILE($DIR/num.cmi,,found_num=no)
432 if test "$found_num" = no; then
433 AC_MSG_ERROR([Library Num not found.])
436 # checking for Zarith
437 if test "$enable_zarith" = yes; then
439 if test "$enable_ocamlfind" = yes; then
440 DIR=$(ocamlfind query zarith)
441 if test -n "$DIR"; then
442 echo "ocamlfind found zarith in $DIR"
443 BIGINTINCLUDE="-I $DIR"
448 if test -z "$DIR"; then
449 BIGINTINCLUDE="-I +zarith"
450 DIR="$OCAMLLIB/zarith"
451 AC_CHECK_FILE($DIR/zarith.cma,,enable_zarith=no)
453 AC_CHECK_FILE($DIR/z.cmi,,enable_zarith=no)
454 if test "$enable_zarith" = no; then
455 AC_MSG_WARN([Lib Zarith not found, using Nums instead.])
456 reason_zarith=" (zarith not found)"
457 elif test "$ocamlfind_zarith" = no; then
459 reason_ocamlfind=" (unable to find zarith)"
463 if test "$enable_zarith" = yes; then
469 BIGINTINCLUDE="$NUMINCLUDE"
472 # checking for camlzip
473 if test "$enable_zip" = yes; then
475 if test "$enable_ocamlfind" = yes; then
476 DIR=$(ocamlfind query zip)
477 if test -n "DIR"; then
478 echo "ocamlfind found camlzip in $DIR"
484 if test -z "$DIR"; then
487 AC_CHECK_FILE($DIR/zip.cma,,enable_zip=no)
489 AC_CHECK_FILE($DIR/zip.cmi,,enable_zip=no)
490 if test "$enable_zip" = no; then
491 AC_MSG_WARN([Lib camlzip not found, sessions files will not be compressed.])
492 reason_zip=" (camlzip not found)"
493 elif test "$ocamlfind_zip" = no; then
495 reason_ocamlfind=" (unable to find camlzip)"
499 if test "$enable_zip" = yes; then
506 # checking for menhirlib
509 if test "$enable_ocamlfind" = yes; then
510 DIR=$($OCAMLFIND query menhirLib)
511 if test -n "$DIR"; then
512 echo "ocamlfind found menhirLib in $DIR"
513 MENHIRINCLUDE="-I $DIR"
516 reason_ocamlfind=" (unable to find menhirLib)"
519 if test -z "$DIR"; then
520 MENHIRINCLUDE="-I +menhirLib"
521 DIR="$OCAMLLIB/menhirLib"
522 AC_CHECK_FILE($DIR/menhirLib.cmx,,found_menhirlib=no)
524 AC_CHECK_FILE($DIR/menhirLib.cmi,,found_menhirlib=no)
525 if test "$found_menhirlib" = no; then
526 AC_MSG_ERROR([Library menhirLib not found.])
530 # (ocamlfind cannot be trusted here, since the default installation path is $OCAMLLIB)
532 if test "$enable_ocamlfind" = yes; then
533 DIR=$($OCAMLFIND query seq)
534 if test -n "$DIR"; then
535 echo "ocamlfind found seq in $DIR"
539 AC_CHECK_FILE($DIR/seq.cma,,found_seq=no)
540 AC_CHECK_FILE($DIR/seq.cmi,,found_seq=no)
543 if test "$found_seq" = no; then
548 AC_CHECK_FILE($DIR/stdlib__seq.cmi,,found_seq=no)
550 if test "$found_seq" = no; then
551 AC_MSG_WARN([Library seq not found.])
552 if test "$enable_re" = yes; then
554 reason_re=" (seq not found)"
559 if test "$enable_re" = yes; then
562 if test "$enable_ocamlfind" = yes; then
563 DIR=$(ocamlfind query re)
564 if test -n "$DIR"; then
565 echo "ocamlfind found re in $DIR"
571 if test -z "$DIR"; then
574 AC_CHECK_FILE($DIR/re.cmx,,found_re=no)
576 AC_CHECK_FILE($DIR/re.cmi,,found_re=no)
577 if test "$found_re" = no; then
578 AC_MSG_WARN([Library re not found.])
580 elif test "$ocamlfind_re" = no; then
582 reason_ocamlfind=" (unable to find re)"
586 if test "$enable_re" = no; then
593 # checking for lablgtk3
594 if test "$enable_ide" != yes ; then
595 reason_ide=" (disabled by user)"
598 if test "$enable_ocamlfind" = yes; then
599 DIR=$($OCAMLFIND query lablgtk3)
600 if test -n "$DIR"; then
601 echo "ocamlfind found lablgtk3 in $DIR"
602 LABLGTKINCLUDE="-I $DIR -I +threads"
605 if test -z "$DIR"; then
606 LABLGTKINCLUDE="-I +lablgtk3 -I +threads"
607 DIR="$OCAMLLIB/lablgtk3"
609 AC_CHECK_FILE($DIR/lablgtk.cma,LABLGTKLIB="threads lablgtk",)
610 AC_CHECK_FILE($DIR/lablgtk3.cma,LABLGTKLIB="threads lablgtk3",)
611 AC_CHECK_FILE($DIR/gtkButton.cmi,,LABLGTKLIB="")
612 if test -n "$LABLGTKLIB"; then
614 LIB_SOURCEVIEW=lablgtk3_sourceview3
615 PKG_SOURCEVIEW=lablgtk3-sourceview3
618 AC_MSG_WARN([Lib lablgtk3 not found, trying lablgtk2.])
623 # checking for lablgtk2
624 if test "$enable_ide" = retry; then
627 if test "$enable_ocamlfind" = yes; then
628 DIR=$($OCAMLFIND query lablgtk2)
629 if test -n "$DIR"; then
630 echo "ocamlfind found lablgtk2 in $DIR"
631 LABLGTKINCLUDE="-I $DIR"
634 if test -z "$DIR"; then
635 LABLGTKINCLUDE="-I +lablgtk2"
636 DIR="$OCAMLLIB/lablgtk2"
637 AC_CHECK_FILE($DIR/lablgtk.cma,,enable_ide=no)
639 AC_CHECK_FILE($DIR/gtkButton.cmi,,enable_ide=no)
640 if test "$enable_ide" = yes; then
643 LIB_SOURCEVIEW=lablgtksourceview2
644 PKG_SOURCEVIEW=lablgtk2.sourceview2
647 AC_MSG_WARN([Lib lablgtk2 not found, IDE disabled.])
648 reason_ide=" (lablgtk2/3 not found)"
652 # checking for lablgtksourceview
653 if test "$enable_ide" = yes ; then
655 if test "$enable_ocamlfind" = yes; then
656 DIR=$($OCAMLFIND query $PKG_SOURCEVIEW)
657 if test -z "$DIR"; then
660 PKG_SOURCEVIEW=lablgtksourceview2
661 DIR=$(ocamlfind query $PKG_SOURCEVIEW)
664 PKG_SOURCEVIEW=lablgtksourceview3
665 DIR=$(ocamlfind query $PKG_SOURCEVIEW)
669 if test -n "$DIR";then
670 echo "ocamlfind found $PKG_SOURCEVIEW in $DIR"
673 if test -z "$DIR"; then
674 DIR="$OCAMLLIB/lablgtk$GTKVERSION"
675 LIB_SOURCEVIEW="lablgtksourceview$GTKVERSION"
676 AC_CHECK_FILE($DIR/$LIB_SOURCEVIEW.cma,,DIR="")
678 if test -z "$DIR"; then
679 DIR="$OCAMLLIB/lablgtk$GTKVERSION-sourceview$GTKVERSION"
680 LIB_SOURCEVIEW="lablgtk${GTKVERSION}_sourceview$GTKVERSION"
681 AC_CHECK_FILE($DIR/$LIB_SOURCEVIEW.cma,,enable_ide=no)
683 AC_CHECK_FILE($DIR/gSourceView$GTKVERSION.cmi,,enable_ide=no)
684 if test "$enable_ide" = no; then
685 AC_MSG_WARN([Lib lablgtksourceview not found, IDE disabled.])
686 reason_ide=" (lablgtksourceview not found)"
688 LABLGTKINCLUDE="$LABLGTKINCLUDE -I $DIR"
692 if test "$enable_ide" = yes ; then
693 LABLGTKLIB="$LABLGTKLIB $LIB_SOURCEVIEW"
694 LABLGTKPKG="lablgtk$GTKVERSION $PKG_SOURCEVIEW"
701 # checking for ocamlgraph
702 # temporarily disabled until #453 is fixed
703 if test "$enable_hypothesis_selection" = yes; then
704 enable_hypothesis_selection=no
705 reason_hypothesis_selection=" (broken)"
708 if test "$enable_hypothesis_selection" = yes; then
710 if test "$enable_ocamlfind" = yes; then
711 DIR=$($OCAMLFIND query ocamlgraph)
712 if test -n "$DIR"; then
713 echo "ocamlfind found ocamlgraph in $DIR"
716 ocamlfind_ocamlgraph=no
719 if test -z "$DIR"; then
720 OCAMLGRAPHLIB="+ocamlgraph"
721 DIR="$OCAMLLIB/ocamlgraph"
722 AC_CHECK_FILE($DIR/graph.cma,,enable_hypothesis_selection=no)
724 AC_CHECK_FILE($DIR/graph.cmi,,enable_hypothesis_selection=no)
725 if test "$enable_hypothesis_selection" = no; then
726 reason_hypothesis_selection=" (ocamlgraph not found)"
727 AC_MSG_WARN([Lib ocamlgraph not found, hypothesis selection disabled.])
728 elif test "$ocamlfind_ocamlgraph" = no; then
730 reason_ocamlfind=" (unable to find ocamlgraph)"
734 if test "$enable_hypothesis_selection" = yes; then
735 META_OCAMLGRAPH="ocamlgraph"
741 # checking for js_of_ocaml
742 if test "$enable_js_of_ocaml" != yes; then
743 reason_js_of_ocaml=" (disabled by user)"
744 elif test "$enable_ocamlfind" != yes; then
745 enable_js_of_ocaml=no
746 reason_js_of_ocaml=" (ocamlfind not available)"
748 JSOFOCAML=$($OCAMLFIND query js_of_ocaml)
749 if test -z "$JSOFOCAML"; then
750 enable_js_of_ocaml=no
751 reason_js_of_ocaml=" (js_of_ocaml not found)"
753 JSOFOCAMLPPX=$($OCAMLFIND query js_of_ocaml-ppx)
754 if test -z "$JSOFOCAMLPPX"; then
755 enable_js_of_ocaml=no
756 reason_js_of_ocaml=" (js_of_ocaml-ppx not found)"
758 JSOFOCAMLPKG="js_of_ocaml js_of_ocaml.ppx"
763 if test "$enable_web_ide" != yes; then
764 reason_web_ide=" (disabled by user)"
765 elif test "$enable_js_of_ocaml" != yes; then
767 reason_web_ide=" (Javascript support not available)"
772 if test "$enable_js_of_ocaml" != no; then
774 reason_mlmpfr=" (Cannot allow mlmpfr with js_of_ocaml) "
776 if test "$enable_ocamlfind" = yes; then
777 DIR=$($OCAMLFIND query mlmpfr)
778 if test -n "$DIR"; then
779 echo "ocamlfind found mlmpfr in $DIR"
780 # Test that mpfr version is higher than 4.0.0 (because of
781 # Faithful constructor incompatibility).
782 MPFR_VER=$(grep -q "4.0.0" $DIR/META 2> /dev/null)
784 if test $EXIT_CODE = 0; then
785 MLMPFRINCLUDE="-I $DIR"
788 MLMPFR_LINK="-cclib -lmpfr"
789 AC_CHECK_FILE($DIR/mlmpfr.cma,,found_mlmpfr=yes)
791 reason_mlmpfr=" (Version of mlmpfr is not 4.0.0) "
795 reason_mlmpfr=" (mlmpfr not found)"
799 reason_mlmpfr=" (ocamlfind not available) "
803 if test "$found_mlmpfr" = no; then
808 # checking for statmemprof
809 if test "$enable_statmemprof" = yes; then
810 if test "$enable_ocamlfind" != yes; then
811 enable_statmemprof=no
812 reason_statmemprof=" (ocamlfind not available)"
814 DIR=$($OCAMLFIND query statmemprof-emacs)
815 if test -z "$DIR"; then
816 enable_statmemprof=no
817 reason_statmemprof=" (statmemprof-emacs not found)"
819 STATMEMPROFPKG=statmemprof-emacs
825 enable_coq_support=yes
826 enable_coq_fp_libs=yes
830 if test "$enable_coq_libs" = no; then
831 enable_coq_support=no
832 reason_coq_support=" (disabled by user)"
835 if test "$enable_coq_support" = yes; then
836 AC_CHECK_PROG(COQC,coqc,coqc,no)
837 if test "$COQC" = no ; then
838 enable_coq_support=no
839 AC_MSG_WARN(Cannot find coqc.)
840 reason_coq_support=" (coqc not found)"
844 if test "$enable_coq_support" = yes; then
845 COQLIB=`$COQC -where | sed -e 's|\\\|/|g' -e 's| |\\ |g'`
846 AC_MSG_CHECKING(Coq version)
847 COQVERSION=[`$COQC -v | sed -n -e 's|.*version *\([^ ]*\) .*$|\1|p'`]
848 AC_MSG_RESULT($COQVERSION)
852 coq_compat_version="COQ86"
855 coq_compat_version="COQ87"
858 coq_compat_version="COQ88"
861 coq_compat_version="COQ89"
864 coq_compat_version="COQ810"
867 coq_compat_version="COQ811"
870 coq_compat_version="COQ812"
873 enable_coq_support=no
874 AC_MSG_WARN(You need Coq 8.6 or later; Coq discarded)
875 reason_coq_support=" (need version >= 8.6)"
880 if test "$enable_coq_support" = yes; then
881 AC_CHECK_PROG(COQDEP,coqdep,coqdep,no)
882 if test "$COQDEP" = no; then
883 enable_coq_support=no
884 AC_MSG_WARN(Cannot find coqdep.)
885 reason_coq_support=" (coqdep not found)"
889 if test "$enable_coq_support" = no; then
894 if test "$enable_coq_libs" = yes; then
895 AC_MSG_CHECKING([for Flocq])
897 [ echo "Require Import Flocq.Version BinNat." \
898 "Goal (30100 <= Flocq_version)%N. easy. Qed." > conftest.v
899 "$COQC" conftest.v > conftest.err ],
900 [ AC_MSG_RESULT(yes) ],
902 enable_coq_fp_libs=no
903 AC_MSG_WARN(Cannot find Flocq.)
904 reason_coq_fp_libs=" (Flocq >= 3.1 not found)" ])
905 rm -f conftest.v conftest.vo conftest.err
910 if test "$enable_pvs_libs" = no; then
911 enable_pvs_support=no
912 reason_pvs_support=" (disabled by user)"
914 AC_CHECK_PROG(PVS,pvs,pvs,no)
915 if test "$PVS" = no ; then
916 enable_pvs_support=no
917 AC_MSG_WARN(Cannot find pvs.)
918 reason_pvs_support=" (pvs not found)"
921 AC_MSG_CHECKING(PVS version)
922 PVSVERSION=[`$PVS -version | sed -n -e 's|.*Version *\([^ ]*\)$|\1|p'`]
926 enable_pvs_support=yes
927 AC_MSG_RESULT($PVSVERSION)
930 AC_MSG_RESULT($PVSVERSION)
931 enable_pvs_support=no
932 AC_MSG_WARN(You need PVS 6.0 or higher; PVS discarded)
933 reason_pvs_support=" (need version 6.0 or higher)"
939 if test "$enable_pvs_support" = no; then
946 # Default version used for generation of realization in the case Isabelle is not
947 # detected or Why3 is compiled with disable-isabelle.
950 if test "$enable_isabelle_libs" = no; then
951 enable_isabelle_support=no
952 reason_isabelle_support=" (disabled by user)"
954 AC_CHECK_PROG(ISABELLE,isabelle,isabelle,no)
955 if test "$ISABELLE" = no ; then
956 enable_isabelle_support=no
957 AC_MSG_WARN(Cannot find isabelle.)
958 reason_isabelle_support=" (isabelle not found)"
960 AC_MSG_CHECKING(Isabelle version)
961 ISABELLEDETECTEDVERSION=[`$ISABELLE version | sed -n -e 's|Isabelle\([^:]*\).*$|\1|p'`]
963 case $ISABELLEDETECTEDVERSION in
965 enable_isabelle_support=yes
967 AC_MSG_RESULT($ISABELLEDETECTEDVERSION)
970 enable_isabelle_support=yes
972 AC_MSG_RESULT($ISABELLEDETECTEDVERSION)
975 AC_MSG_RESULT($ISABELLEDETECTEDVERSION)
976 enable_isabelle_support=no
977 AC_MSG_WARN(You need Isabelle 2018 or later; Isabelle discarded)
978 reason_isabelle_support=" (need version >= 2018)"
984 if test "$enable_isabelle_support" = no; then
985 enable_isabelle_libs=no
988 if test "$enable_pvs_libs" = yes; then
989 AC_MSG_CHECKING([for NASA PVS library])
991 reason_pvs_libs=" (no NASA PVS library in PVS_LIBRARY_PATH)"
992 for dir in `echo $PVS_LIBRARY_PATH | tr ':' ' '`; do
993 if test -f $dir/nasalib-version; then
998 AC_MSG_RESULT($enable_pvs_libs)
1002 FRAMAC_SUPPORTED=Sulfur
1003 if test "$enable_frama_c" = yes ; then
1004 AC_CHECK_PROG(FRAMAC,frama-c,frama-c,no)
1005 if test "$FRAMAC" = no ; then
1006 AC_MSG_WARN(Cannot find Frama-C.)
1008 reason_frama_c=" (frama-c not found)"
1010 AC_MSG_CHECKING(Frama-C version)
1011 FRAMAC_VERSION=`$FRAMAC -version | sed -n -e 's|\(Version: \)\?\(.*\)$|\2|p'`
1012 AC_MSG_RESULT($FRAMAC_VERSION)
1013 case $FRAMAC_VERSION in
1014 $FRAMAC_SUPPORTED-*) ;;
1015 *) AC_MSG_WARN(Version $FRAMAC_SUPPORTED required.)
1017 reason_frama_c=" (version $FRAMAC_SUPPORTED required)"
1023 if test "$enable_frama_c" = yes; then
1024 FRAMAC_SHARE=`$FRAMAC -print-path`
1025 FRAMAC_LIBDIR=`$FRAMAC -print-libpath`
1026 FRAMAC_INCLUDE="-I $FRAMAC_LIBDIR"
1029 VERSION=$PACKAGE_VERSION
1031 # substitutions to perform
1034 AC_SUBST(enable_verbose_make)
1046 AC_SUBST(OCAMLVERSION)
1048 AC_SUBST(OCAMLINSTALLLIB)
1049 AC_SUBST(OCAMLGRAPHLIB)
1052 AC_SUBST(enable_ocamlfind)
1055 AC_SUBST(enable_profiling)
1057 AC_SUBST(enable_statmemprof)
1058 AC_SUBST(STATMEMPROFPKG)
1060 AC_SUBST(enable_ide)
1061 AC_SUBST(LABLGTKLIB)
1062 AC_SUBST(LABLGTKPKG)
1063 AC_SUBST(LABLGTKINCLUDE)
1064 AC_SUBST(GTKVERSION)
1066 AC_SUBST(enable_web_ide)
1067 AC_SUBST(enable_js_of_ocaml)
1068 AC_SUBST(JSOFOCAMLPKG)
1070 AC_SUBST(META_OCAMLGRAPH)
1072 AC_SUBST(enable_ppx)
1074 AC_SUBST(NUMINCLUDE)
1075 AC_SUBST(MLMPFRINCLUDE)
1077 AC_SUBST(MLMPFR_LINK)
1078 AC_SUBST(found_mlmpfr)
1080 AC_SUBST(enable_zarith)
1081 AC_SUBST(BIGINTINCLUDE)
1085 AC_SUBST(enable_zip)
1086 AC_SUBST(ZIPINCLUDE)
1089 AC_SUBST(MENHIRINCLUDE)
1091 AC_SUBST(SEQINCLUDE)
1098 AC_SUBST(enable_coq_libs)
1099 AC_SUBST(enable_coq_fp_libs)
1100 AC_SUBST(coq_compat_version)
1105 AC_SUBST(COQVERSION)
1107 AC_SUBST(enable_pvs_libs)
1109 AC_SUBST(PVSVERSION)
1111 AC_SUBST(enable_isabelle_libs)
1113 AC_SUBST(ISABELLEVERSION)
1115 AC_SUBST(enable_hypothesis_selection)
1117 AC_SUBST(enable_doc)
1118 AC_SUBST(enable_pdf_doc)
1123 AC_SUBST(enable_emacs_compilation)
1126 AC_SUBST(enable_frama_c)
1129 AC_SUBST(FRAMAC_VERSION)
1130 AC_SUBST(FRAMAC_SHARE)
1131 AC_SUBST(FRAMAC_LIBDIR)
1132 AC_SUBST(FRAMAC_INCLUDE)
1134 AC_SUBST(enable_local)
1137 AC_SUBST(enable_why3_lib)
1139 AC_SUBST(WHY3INCLUDE)
1141 AC_SUBST(enable_relocation)
1143 # Finally create the Makefile from Makefile.in
1144 AC_CONFIG_FILES(Makefile)
1145 AC_CONFIG_FILES(src/config.sh)
1146 AC_CONFIG_FILES(lib/why3/META)
1147 AC_CONFIG_FILES(.merlin)
1148 AC_CONFIG_FILES(src/jessie/Makefile)
1149 AC_CONFIG_FILES(src/jessie/.merlin)
1150 AC_CONFIG_FILES(lib/coq/version lib/pvs/version)
1151 AC_CONFIG_COMMANDS([chmod],
1152 chmod a-w Makefile src/jessie/Makefile;
1153 chmod a-w src/config.sh;
1154 chmod a-w lib/why3/META;
1156 chmod a-w src/jessie/Makefile;
1157 chmod a-w src/jessie/.merlin;
1158 chmod a-w lib/coq/version lib/pvs/version;
1159 chmod u+x src/config.sh)
1168 echo "-----------------------------------------"
1169 echo "Verbose make : $enable_verbose_make"
1170 echo "OCaml compiler : yes"
1171 echo " Version : $OCAMLVERSION"
1172 echo " Library path : $OCAMLLIB"
1173 echo " Ocamlfind : $enable_ocamlfind$reason_ocamlfind"
1174 echo " Native compilation : $enable_native_code"
1175 echo " Profiling : $enable_profiling"
1176 echo " Memory profiling : $enable_statmemprof$reason_statmemprof"
1177 echo " PPX : $enable_ppx$reason_ppx"
1178 echo " Javascript support : $enable_js_of_ocaml$reason_js_of_ocaml"
1179 echo " Mpfr support : $found_mlmpfr$reason_mlmpfr"
1180 echo " Re support : $enable_re$reason_re"
1182 echo " Why3 library : $enable_why3_lib"
1183 echo " GTK IDE : $enable_ide$reason_ide"
1184 echo " Web IDE : $enable_web_ide$reason_web_ide"
1185 echo " GMP arithmetic : $enable_zarith$reason_zarith"
1186 echo " Compressed sessions : $enable_zip$reason_zip"
1187 echo " Hypothesis selection : $enable_hypothesis_selection$reason_hypothesis_selection"
1188 echo " Frama-C support : $enable_frama_c$reason_frama_c"
1189 if test "$enable_frama_c" = yes ; then
1190 echo " Version : $FRAMAC_VERSION"
1191 echo " Share path : $FRAMAC_SHARE"
1192 echo " Library path : $FRAMAC_LIBDIR"
1194 echo "Documentation : $enable_doc$reason_doc"
1195 if test "$enable_doc" = yes ; then
1197 echo " PDF : $enable_pdf_doc$reason_pdf_doc"
1199 echo "Support for interactive proof assistants"
1200 echo " Coq : $enable_coq_support$reason_coq_support"
1201 if test "$enable_coq_support" = yes ; then
1202 echo " Version : $COQVERSION"
1203 echo " Library path : $COQLIB"
1204 echo " Realization support : $enable_coq_libs$reason_coq_libs"
1205 if test "$enable_coq_libs" = yes ; then
1206 echo " FP arithmetic : $enable_coq_fp_libs$reason_coq_fp_libs"
1209 echo " PVS : $enable_pvs_support$reason_pvs_support"
1210 if test "$enable_pvs_support" = yes ; then
1211 echo " Version : $PVSVERSION"
1212 echo " Library path : $PVSLIB"
1213 echo " Realization support : $enable_pvs_libs$reason_pvs_libs"
1215 echo " Isabelle : $enable_isabelle_support$reason_isabelle_support"
1216 if test "$enable_isabelle_support" = yes ; then
1217 echo " Version : $ISABELLEVERSION ($ISABELLEDETECTEDVERSION)"
1218 echo " Realization support : $enable_isabelle_libs$reason_isabelle_libs"
1220 if test "$enable_local" = yes ; then
1221 echo "Installable : no"
1222 echo " OCaml library path : $OCAMLINSTALLLIB/why3"
1224 echo "Installable : yes"
1225 echo " Binary path : $bindir"
1226 echo " Library path : $libdir/why3"
1227 echo " Data path : $datarootdir/why3"
1228 echo " OCaml library path : $OCAMLINSTALLLIB/why3"
1229 echo " Relocatable : $enable_relocation"