]> matita.cs.unibo.it Git - helm.git/blob - helm/matita/configure.ac
snapshot
[helm.git] / helm / matita / configure.ac
1 AC_INIT(matita.ml)
2
3 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
4 if test $HAVE_OCAMLC = "no"; then
5   AC_MSG_ERROR(could not find ocamlc)
6 fi
7 AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no)
8 if test $HAVE_OCAMLOPT = "no"; then
9   AC_MSG_WARN(could not find ocamlopt: native code compilation disabled)
10 fi
11 AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
12 if test $HAVE_OCAMLFIND = "yes"; then
13   OCAMLFIND="ocamlfind"
14 else
15   AC_MSG_ERROR(could not find ocamlfind)
16 fi
17 AC_CHECK_PROG(HAVE_LABLGLADECC, lablgladecc2, yes, no)
18 if test $HAVE_LABLGLADECC = "yes"; then
19   LABLGLADECC="lablgladecc2"
20 else
21   AC_MSG_ERROR(could not find lablgladecc2)
22 fi
23 AC_CHECK_PROG(HAVE_CAMLP4O, camlp4o, yes, no)
24 if test $HAVE_CAMLP4O = "yes"; then
25   CAMLP4O="camlp4o"
26 else
27   AC_MSG_ERROR(could not find camlp4o)
28 fi
29
30 FINDLIB_REQUIRES="\
31 lablgtk2.glade \
32 pcre \
33 helm-cic_omdoc \
34 helm-cic_transformations \
35 helm-registry \
36 helm-tactics \
37 helm-xml \
38 helm-disambiguator \
39 helm-mathql_interpreter \
40 "
41 for r in $FINDLIB_REQUIRES
42 do
43   AC_MSG_CHECKING(for $r ocaml library)
44   if $OCAMLFIND query $r &> /dev/null; then
45     AC_MSG_RESULT(yes)
46   else
47     AC_MSG_ERROR(could not find $r ocaml library)
48   fi
49 done
50
51 OCAMLFIND_COMMANDS=""
52 AC_CHECK_PROG(HAVE_OCAMLC_OPT, ocamlc.opt, yes, no)
53 if test $HAVE_OCAMLC_OPT = "yes"; then
54   if test "$OCAMLFIND_COMMANDS" = ""; then
55     OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt"
56   else
57     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlc=ocamlc.opt"
58   fi
59 fi
60 AC_CHECK_PROG(HAVE_OCAMLOPT_OPT, ocamlopt.opt, yes, no)
61 if test $HAVE_OCAMLOPT_OPT = "yes"; then
62   if test "$OCAMLFIND_COMMANDS" = ""; then
63     OCAMLFIND_COMMANDS="ocamlopt=ocamlopt.opt"
64   else
65     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlopt=ocamlopt.opt"
66   fi
67 fi
68 if test "$OCAMLFIND_COMMANDS" != ""; then
69   OCAMLFIND="OCAMLFIND_COMMANDS='$OCAMLFIND_COMMANDS' $OCAMLFIND"
70 fi
71 AC_ARG_ENABLE(debug,
72   [  --enable-debug    Turn on debugging],
73   [case "${enableval}" in
74    yes) DEBUG=true ;;
75    no)  DEBUG=false ;;
76    *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
77   esac],
78   [DEBUG=true])
79 if test "$DEBUG" = "true"; then
80   echo "debugging enabled"
81 fi
82
83 AC_SUBST(CAMLP4O)
84 AC_SUBST(DEBUG)
85 AC_SUBST(FINDLIB_REQUIRES)
86 AC_SUBST(HAVE_OCAMLOPT)
87 AC_SUBST(LABLGLADECC)
88 AC_SUBST(OCAMLFIND)
89
90 AC_OUTPUT([
91   buildTimeConf.ml
92   Makefile
93 ])