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