]> matita.cs.unibo.it Git - helm.git/blob - matita/configure.ac
whelp and cic disambiguation removed
[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-grafite \
77 helm-grafite_engine \
78 helm-tptp_grafite \
79 helm-ng_disambiguation \
80 helm-ng_cic_content \
81 helm-grafite_parser \
82 helm-acic_procedural \
83 helm-content_pres \
84 helm-hgdome \
85 helm-tactics \
86 helm-ng_paramodulation \
87 helm-ng_tactics \
88 helm-cic_exportation \
89 "
90 FINDLIB_CREQUIRES=" \
91 $FINDLIB_COMREQUIRES \
92 "
93 FINDLIB_REQUIRES="\
94 $FINDLIB_CREQUIRES \
95 lablgtk2.glade \
96 lablgtksourceview2.gtksourceview2 \
97 helm-xmldiff \
98 "
99 for r in $FINDLIB_LIBSREQUIRES $FINDLIB_REQUIRES
100 do
101   AC_MSG_CHECKING(for $r ocaml library)
102   if OCAMLPATH=$OCAMLPATH $OCAMLFIND query $r &> /dev/null; then
103     AC_MSG_RESULT(yes)
104   else
105     AC_MSG_ERROR(could not find $r ocaml library)
106   fi
107 done
108
109 OCAMLFIND_COMMANDS=""
110 # AC_CHECK_PROG(HAVE_OCAMLC_OPT, ocamlc.opt, yes, no)
111 # if test $HAVE_OCAMLC_OPT = "yes"; then
112 #   if test "$OCAMLFIND_COMMANDS" = ""; then
113 #     OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt"
114 #   else
115 #     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlc=ocamlc.opt"
116 #   fi
117 # fi
118 # AC_CHECK_PROG(HAVE_OCAMLOPT_OPT, ocamlopt.opt, yes, no)
119 # if test $HAVE_OCAMLOPT_OPT = "yes"; then
120 #   if test "$OCAMLFIND_COMMANDS" = ""; then
121 #     OCAMLFIND_COMMANDS="ocamlopt=ocamlopt.opt"
122 #   else
123 #     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlopt=ocamlopt.opt"
124 #   fi
125 # fi
126 if test "$OCAMLFIND_COMMANDS" != ""; then
127   OCAMLFIND="OCAMLFIND_COMMANDS='$OCAMLFIND_COMMANDS' $OCAMLFIND"
128 fi
129
130 AC_MSG_CHECKING(--enable-debug argument)
131 AC_ARG_ENABLE(debug,
132   [  --enable-debug       Turn on debugging],
133   [GIVEN="yes";
134    case "${enableval}" in
135    yes) DEBUG=true ;;
136    no)  DEBUG=false ;;
137    *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
138   esac],
139   [GIVEN="no"; DEBUG="$DEBUG_DEFAULT"])
140 MSG=$GIVEN
141 if test "$DEBUG" = "true"; then
142   MSG="$MSG, debugging enabled."
143 else
144   MSG="$MSG, debugging disabled."
145 fi
146 AC_MSG_RESULT($MSG)
147
148 AC_MSG_CHECKING(--enable-annot argument)
149 AC_ARG_ENABLE(annot,
150   [  --enable-annot       Turn on -dtypes compilation option],
151   [GIVEN="yes";
152    case "${enableval}" in
153    yes) ANNOT=true;;
154    no)  ANNOT=false;;
155    *) AC_MSG_ERROR(bad value ${enableval} for --enable-annot) ;;
156   esac],
157   [GIVEN="no"; ANNOT="false"])
158 MSG=$GIVEN
159 if test "$ANNOT" = "true"; then
160   MSG="$MSG, type annotation enabled."
161 else
162   MSG="$MSG, type annotation disabled."
163 fi
164 AC_MSG_RESULT($MSG)
165
166
167 AC_MSG_CHECKING(--with-runtime-dir argument)
168 AC_ARG_WITH(runtime-dir,
169   [  --with-runtime-dir      Runtime directory (current working directory if not given)],
170   [ RT_BASE_DIR="${withval}" ],
171   [ RT_BASE_DIR="$RT_BASE_DIR_DEFAULT" ])
172 MSG="$RT_BASE_DIR"
173 if test "yes" = "$RT_BASE_DIR"; then
174   MSG="
175 ** error:                                                                  **
176 **  empty --with-runtime-dir argument, please use --with-runtime-dir=value **"
177 fi
178 AC_MSG_RESULT($MSG)
179
180 AC_MSG_CHECKING(--with-dbhost argument)
181 AC_ARG_WITH(dbhost,
182   [  --with-dbhost           SQL database hostname],
183   [ DBHOST="${withval}" ],
184   [ DBHOST="$DEFAULT_DBHOST" ])
185 MSG="$DBHOST"
186 if test "yes" = "$DBHOST"; then
187   MSG="
188 ** error:                                                                  **
189 **  empty --with-dbhost argument, please use --with-dbhost=value           **"
190 fi
191 AC_MSG_RESULT($MSG)
192
193 AC_SUBST(CAMLP5O)
194 AC_SUBST(DBHOST)
195 AC_SUBST(DEBUG)
196 AC_SUBST(ANNOT)
197 AC_SUBST(DISTRIBUTED)
198 AC_SUBST(FINDLIB_CREQUIRES)
199 AC_SUBST(FINDLIB_REQUIRES)
200 AC_SUBST(HAVE_OCAMLOPT)
201 AC_SUBST(LABLGLADECC)
202 AC_SUBST(MATITA_VERSION)
203 AC_SUBST(OCAMLFIND)
204 AC_SUBST(OCAMLPATH)
205 AC_SUBST(RT_BASE_DIR)
206 AC_SUBST(SRCROOT)
207 AC_SUBST(TRANSFORMER_MODULE)
208
209 AC_OUTPUT([
210   components/extlib/componentsConf.ml
211   matita/matita.conf.xml
212   matita/buildTimeConf.ml
213   matita/gtkmathview.matita.conf.xml
214   matita/help/C/version.txt
215   Makefile.defs
216 ])
217