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