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