]> 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 lablgtk2.init \
33 lablgtkmathview \
34 pcre \
35 helm-cic_omdoc \
36 helm-cic_transformations \
37 helm-registry \
38 helm-tactics \
39 helm-xml \
40 helm-xmldiff \
41 helm-disambiguator \
42 helm-mathql_interpreter \
43 "
44 for r in $FINDLIB_REQUIRES
45 do
46   AC_MSG_CHECKING(for $r ocaml library)
47   if $OCAMLFIND query $r &> /dev/null; then
48     AC_MSG_RESULT(yes)
49   else
50     AC_MSG_ERROR(could not find $r ocaml library)
51   fi
52 done
53
54 OCAMLFIND_COMMANDS=""
55 AC_CHECK_PROG(HAVE_OCAMLC_OPT, ocamlc.opt, yes, no)
56 if test $HAVE_OCAMLC_OPT = "yes"; then
57   if test "$OCAMLFIND_COMMANDS" = ""; then
58     OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt"
59   else
60     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlc=ocamlc.opt"
61   fi
62 fi
63 AC_CHECK_PROG(HAVE_OCAMLOPT_OPT, ocamlopt.opt, yes, no)
64 if test $HAVE_OCAMLOPT_OPT = "yes"; then
65   if test "$OCAMLFIND_COMMANDS" = ""; then
66     OCAMLFIND_COMMANDS="ocamlopt=ocamlopt.opt"
67   else
68     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlopt=ocamlopt.opt"
69   fi
70 fi
71 if test "$OCAMLFIND_COMMANDS" != ""; then
72   OCAMLFIND="OCAMLFIND_COMMANDS='$OCAMLFIND_COMMANDS' $OCAMLFIND"
73 fi
74 AC_ARG_ENABLE(debug,
75   [  --enable-debug    Turn on debugging],
76   [case "${enableval}" in
77    yes) DEBUG=true ;;
78    no)  DEBUG=false ;;
79    *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
80   esac],
81   [DEBUG=true])
82 if test "$DEBUG" = "true"; then
83   echo "debugging enabled"
84 fi
85
86 AC_SUBST(CAMLP4O)
87 AC_SUBST(DEBUG)
88 AC_SUBST(TRANSFORMER_MODULE)
89 AC_SUBST(FINDLIB_REQUIRES)
90 AC_SUBST(HAVE_OCAMLOPT)
91 AC_SUBST(LABLGLADECC)
92 AC_SUBST(OCAMLFIND)
93
94 AC_OUTPUT([
95   buildTimeConf.ml
96   Makefile
97 ])