]> matita.cs.unibo.it Git - helm.git/blob - matita/configure.ac
MathML widget no longer used. Requesciat in pacem
[helm.git] / matita / configure.ac
1 AC_INIT(matita/matitaTypes.ml)
2
3 # Distribution settings
4 # (i.e. settings (automatically) manipulated before a release)
5 DEBUG_DEFAULT="true"
6 DEFAULT_DBHOST="mysql://mowgli.cs.unibo.it"
7 RT_BASE_DIR_DEFAULT="`pwd`/matita"
8 MATITA_VERSION="0.5.8"
9 DISTRIBUTED="no"  # "yes" for distributed tarballs
10 # End of distribution settings
11
12 SRCROOT=`pwd`
13 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
14 if test $HAVE_OCAMLC = "no"; then
15   AC_MSG_ERROR(could not find ocamlc)
16 fi
17 AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no)
18 if test $HAVE_OCAMLOPT = "no"; then
19   AC_MSG_WARN(could not find ocamlopt: native code compilation disabled)
20 fi
21 AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
22 if test $HAVE_OCAMLFIND = "yes"; then
23   OCAMLFIND="ocamlfind"
24 else
25   AC_MSG_ERROR(could not find ocamlfind)
26 fi
27 AC_CHECK_PROG(HAVE_LABLGLADECC, lablgladecc2, yes, no)
28 if test $HAVE_LABLGLADECC = "yes"; then
29   LABLGLADECC="lablgladecc2"
30 else
31   AC_MSG_ERROR(could not find lablgladecc2)
32 fi
33 AC_CHECK_PROG(HAVE_CAMLP5O, camlp5o, yes, no)
34 if test $HAVE_CAMLP5O = "yes"; then
35   CAMLP5O="camlp5o"
36 else
37   AC_MSG_ERROR(could not find camlp5o)
38 fi
39
40 # look for METAS dir
41
42 LIBSPATH="`pwd`/components"
43 OCAMLPATH="$LIBSPATH/METAS"
44
45 # creating META.*
46
47 echo -n "creating METAs ... "
48 for f in $OCAMLPATH/meta.*.src; do
49   basename=`basename $f`
50   metaname=`echo $basename | sed 's/meta\.\(.*\)\.src/\1/'`
51   dirname=`echo $metaname | sed 's/^helm-//'`
52   metafile="$OCAMLPATH/META.$metaname"
53   cp $f $metafile
54   echo "directory=\"$LIBSPATH/$dirname\"" >> $metafile
55 done
56 echo "done"
57
58 # (libs) findlib requisites
59
60 FINDLIB_LIBSREQUIRES="\
61 expat \
62 gdome2 \
63 http \
64 lablgtk2 \
65 lablgtksourceview2.gtksourceview2 \
66 mysql \
67 netstring \
68 ulex08 \
69 zip \
70 "
71
72 # (Matita) findlib requisites
73
74 FINDLIB_COMREQUIRES="\
75 helm-disambiguation \
76 helm-cic_disambiguation \
77 helm-grafite \
78 helm-grafite_engine \
79 helm-tptp_grafite \
80 helm-ng_disambiguation \
81 helm-ng_cic_content \
82 helm-grafite_parser \
83 helm-acic_procedural \
84 helm-content_pres \
85 helm-hgdome \
86 helm-tactics \
87 helm-ng_paramodulation \
88 helm-ng_tactics \
89 helm-cic_exportation \
90 "
91 FINDLIB_CREQUIRES=" \
92 $FINDLIB_COMREQUIRES \
93 "
94 FINDLIB_REQUIRES="\
95 $FINDLIB_CREQUIRES \
96 lablgtk2.glade \
97 lablgtksourceview2.gtksourceview2 \
98 helm-xmldiff \
99 "
100 for r in $FINDLIB_LIBSREQUIRES $FINDLIB_REQUIRES
101 do
102   AC_MSG_CHECKING(for $r ocaml library)
103   if OCAMLPATH=$OCAMLPATH $OCAMLFIND query $r &> /dev/null; then
104     AC_MSG_RESULT(yes)
105   else
106     AC_MSG_ERROR(could not find $r ocaml library)
107   fi
108 done
109
110 OCAMLFIND_COMMANDS=""
111 # AC_CHECK_PROG(HAVE_OCAMLC_OPT, ocamlc.opt, yes, no)
112 # if test $HAVE_OCAMLC_OPT = "yes"; then
113 #   if test "$OCAMLFIND_COMMANDS" = ""; then
114 #     OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt"
115 #   else
116 #     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlc=ocamlc.opt"
117 #   fi
118 # fi
119 # AC_CHECK_PROG(HAVE_OCAMLOPT_OPT, ocamlopt.opt, yes, no)
120 # if test $HAVE_OCAMLOPT_OPT = "yes"; then
121 #   if test "$OCAMLFIND_COMMANDS" = ""; then
122 #     OCAMLFIND_COMMANDS="ocamlopt=ocamlopt.opt"
123 #   else
124 #     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlopt=ocamlopt.opt"
125 #   fi
126 # fi
127 if test "$OCAMLFIND_COMMANDS" != ""; then
128   OCAMLFIND="OCAMLFIND_COMMANDS='$OCAMLFIND_COMMANDS' $OCAMLFIND"
129 fi
130
131 AC_MSG_CHECKING(--enable-debug argument)
132 AC_ARG_ENABLE(debug,
133   [  --enable-debug       Turn on debugging],
134   [GIVEN="yes";
135    case "${enableval}" in
136    yes) DEBUG=true ;;
137    no)  DEBUG=false ;;
138    *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
139   esac],
140   [GIVEN="no"; DEBUG="$DEBUG_DEFAULT"])
141 MSG=$GIVEN
142 if test "$DEBUG" = "true"; then
143   MSG="$MSG, debugging enabled."
144 else
145   MSG="$MSG, debugging disabled."
146 fi
147 AC_MSG_RESULT($MSG)
148
149 AC_MSG_CHECKING(--enable-annot argument)
150 AC_ARG_ENABLE(annot,
151   [  --enable-annot       Turn on -dtypes compilation option],
152   [GIVEN="yes";
153    case "${enableval}" in
154    yes) ANNOT=true;;
155    no)  ANNOT=false;;
156    *) AC_MSG_ERROR(bad value ${enableval} for --enable-annot) ;;
157   esac],
158   [GIVEN="no"; ANNOT="false"])
159 MSG=$GIVEN
160 if test "$ANNOT" = "true"; then
161   MSG="$MSG, type annotation enabled."
162 else
163   MSG="$MSG, type annotation disabled."
164 fi
165 AC_MSG_RESULT($MSG)
166
167
168 AC_MSG_CHECKING(--with-runtime-dir argument)
169 AC_ARG_WITH(runtime-dir,
170   [  --with-runtime-dir      Runtime directory (current working directory if not given)],
171   [ RT_BASE_DIR="${withval}" ],
172   [ RT_BASE_DIR="$RT_BASE_DIR_DEFAULT" ])
173 MSG="$RT_BASE_DIR"
174 if test "yes" = "$RT_BASE_DIR"; then
175   MSG="
176 ** error:                                                                  **
177 **  empty --with-runtime-dir argument, please use --with-runtime-dir=value **"
178 fi
179 AC_MSG_RESULT($MSG)
180
181 AC_MSG_CHECKING(--with-dbhost argument)
182 AC_ARG_WITH(dbhost,
183   [  --with-dbhost           SQL database hostname],
184   [ DBHOST="${withval}" ],
185   [ DBHOST="$DEFAULT_DBHOST" ])
186 MSG="$DBHOST"
187 if test "yes" = "$DBHOST"; then
188   MSG="
189 ** error:                                                                  **
190 **  empty --with-dbhost argument, please use --with-dbhost=value           **"
191 fi
192 AC_MSG_RESULT($MSG)
193
194 AC_SUBST(CAMLP5O)
195 AC_SUBST(DBHOST)
196 AC_SUBST(DEBUG)
197 AC_SUBST(ANNOT)
198 AC_SUBST(DISTRIBUTED)
199 AC_SUBST(FINDLIB_CREQUIRES)
200 AC_SUBST(FINDLIB_REQUIRES)
201 AC_SUBST(HAVE_OCAMLOPT)
202 AC_SUBST(LABLGLADECC)
203 AC_SUBST(MATITA_VERSION)
204 AC_SUBST(OCAMLFIND)
205 AC_SUBST(OCAMLPATH)
206 AC_SUBST(RT_BASE_DIR)
207 AC_SUBST(SRCROOT)
208 AC_SUBST(TRANSFORMER_MODULE)
209
210 AC_OUTPUT([
211   components/extlib/componentsConf.ml
212   matita/matita.conf.xml
213   matita/buildTimeConf.ml
214   matita/gtkmathview.matita.conf.xml
215   matita/help/C/version.txt
216   Makefile.defs
217 ])
218