]> matita.cs.unibo.it Git - helm.git/blob - helm/matita/configure.ac
1075d605d4d025496621b4bf47e8cee5f61315fb
[helm.git] / helm / matita / configure.ac
1 AC_INIT(matitaTypes.ml)
2
3 # Distribution settings (i.e. settings to be manipulated before a release)
4 DEBUG_DEFAULT="true"
5 RT_BASE_DIR_DEFAULT="`pwd`"
6 MATITA_VERSION="0.0.1"
7 # End of distribution settings
8
9 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
10 if test $HAVE_OCAMLC = "no"; then
11   AC_MSG_ERROR(could not find ocamlc)
12 fi
13 AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no)
14 if test $HAVE_OCAMLOPT = "no"; then
15   AC_MSG_WARN(could not find ocamlopt: native code compilation disabled)
16 fi
17 AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
18 if test $HAVE_OCAMLFIND = "yes"; then
19   OCAMLFIND="ocamlfind"
20 else
21   AC_MSG_ERROR(could not find ocamlfind)
22 fi
23 AC_CHECK_PROG(HAVE_LABLGLADECC, lablgladecc2, yes, no)
24 if test $HAVE_LABLGLADECC = "yes"; then
25   LABLGLADECC="lablgladecc2"
26 else
27   AC_MSG_ERROR(could not find lablgladecc2)
28 fi
29 AC_CHECK_PROG(HAVE_CAMLP4O, camlp4o, yes, no)
30 if test $HAVE_CAMLP4O = "yes"; then
31   CAMLP4O="camlp4o"
32 else
33   AC_MSG_ERROR(could not find camlp4o)
34 fi
35 FINDLIB_COMREQUIRES="\
36 helm-cic_disambiguation \
37 helm-grafite \
38 helm-grafite_engine \
39 helm-grafite_parser \
40 helm-hgdome \
41 helm-tactics \
42 "
43 FINDLIB_CLEANREQUIRES="$FINDLIB_COMREQUIRES"
44 FINDLIB_DEPREQUIRES="$FINDLIB_COMREQUIRES"
45 FINDLIB_MAKEREQUIRES=" \
46 helm-registry \
47 helm-extlib \
48 "
49 FINDLIB_CREQUIRES=" \
50 $FINDLIB_COMREQUIRES \
51 helm-paramodulation \
52 "
53 FINDLIB_REQUIRES="\
54 $FINDLIB_CREQUIRES \
55 lablgtk2.glade \
56 lablgtkmathview \
57 lablgtksourceview \
58 helm-xmldiff \
59 helm-paramodulation \
60 "
61 for r in $FINDLIB_REQUIRES
62 do
63   AC_MSG_CHECKING(for $r ocaml library)
64   if OCAMLPATH=../ocaml/METAS $OCAMLFIND query $r &> /dev/null; then
65     AC_MSG_RESULT(yes)
66   else
67     AC_MSG_ERROR(could not find $r ocaml library)
68   fi
69 done
70
71 OCAMLFIND_COMMANDS=""
72 # AC_CHECK_PROG(HAVE_OCAMLC_OPT, ocamlc.opt, yes, no)
73 # if test $HAVE_OCAMLC_OPT = "yes"; then
74 #   if test "$OCAMLFIND_COMMANDS" = ""; then
75 #     OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt"
76 #   else
77 #     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlc=ocamlc.opt"
78 #   fi
79 # fi
80 # AC_CHECK_PROG(HAVE_OCAMLOPT_OPT, ocamlopt.opt, yes, no)
81 # if test $HAVE_OCAMLOPT_OPT = "yes"; then
82 #   if test "$OCAMLFIND_COMMANDS" = ""; then
83 #     OCAMLFIND_COMMANDS="ocamlopt=ocamlopt.opt"
84 #   else
85 #     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlopt=ocamlopt.opt"
86 #   fi
87 # fi
88 if test "$OCAMLFIND_COMMANDS" != ""; then
89   OCAMLFIND="OCAMLFIND_COMMANDS='$OCAMLFIND_COMMANDS' $OCAMLFIND"
90 fi
91
92 AC_MSG_CHECKING(--enable-debug argument)
93 AC_ARG_ENABLE(debug,
94   [  --enable-debug     Turn on debugging],
95   [GIVEN="yes";
96    case "${enableval}" in
97    yes) DEBUG=true ;;
98    no)  DEBUG=false ;;
99    *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
100   esac],
101   [GIVEN="no"; DEBUG="$DEBUG_DEFAULT"])
102 MSG=$GIVEN
103 if test "$DEBUG" = "true"; then
104   MSG="$MSG, debugging enabled."
105 else
106   MSG="$MSG, debugging disabled."
107 fi
108 AC_MSG_RESULT($MSG)
109
110 AC_MSG_CHECKING(--with-runtime-dir argument)
111 AC_ARG_WITH(runtime-dir,
112   [ --with-runtime-dir  Runtime directory (current working directory if not given)],
113   [ RT_BASE_DIR="${withval}" ],
114   [ RT_BASE_DIR="$RT_BASE_DIR_DEFAULT" ])
115 AC_MSG_RESULT($RT_BASE_DIR)
116
117 AC_SUBST(CAMLP4O)
118 AC_SUBST(DEBUG)
119 AC_SUBST(TRANSFORMER_MODULE)
120 AC_SUBST(FINDLIB_REQUIRES)
121 AC_SUBST(FINDLIB_CREQUIRES)
122 AC_SUBST(FINDLIB_DEPREQUIRES)
123 AC_SUBST(FINDLIB_CLEANREQUIRES)
124 AC_SUBST(FINDLIB_MAKEREQUIRES)
125 AC_SUBST(HAVE_OCAMLOPT)
126 AC_SUBST(LABLGLADECC)
127 AC_SUBST(OCAMLFIND)
128 AC_SUBST(RT_BASE_DIR)
129 AC_SUBST(MATITA_VERSION)
130
131 AC_OUTPUT([
132   matita.conf.xml.sample
133   buildTimeConf.ml
134   Makefile
135   gtkmathview.matita.conf.xml
136 ])