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