]> matita.cs.unibo.it Git - helm.git/blob - matita/configure.ac
Update online helper entries
[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.99.4"
9 DISTRIBUTED="yes"  # "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, lablgladecc3, yes, no)
28 if test $HAVE_LABLGLADECC = "yes"; then
29   LABLGLADECC="lablgladecc3"
30 else
31   AC_MSG_ERROR(could not find lablgladecc3)
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 OCAMLPATHL="$LIBSPATH/METAS"
44 OCAMLPATH="$OCAMLPATHL:$OCAMLPATH"
45
46 # creating META.*
47
48 echo -n "creating METAs ... "
49 for f in $OCAMLPATHL/meta.*.src; do
50   basename=`basename $f`
51   metaname=`echo $basename | sed 's/meta\.\(.*\)\.src/\1/'`
52   dirname=`echo $metaname | sed 's/^helm-//'`
53   metafile="$OCAMLPATHL/META.$metaname"
54   cp $f $metafile
55   echo "directory=\"$LIBSPATH/$dirname\"" >> $metafile
56 done
57 echo "done"
58
59 # (libs) findlib requisites
60
61 #gdome2 \
62 #mysql \
63 FINDLIB_LIBSREQUIRES="\
64 expat \
65 http \
66 pcre \
67 str \
68 unix \
69 lablgtk3 \
70 lablgtk3-sourceview3 \
71 netstring \
72 ulex-camlp5 \
73 zip \
74 "
75
76 # (Matita) findlib requisites
77
78 #lablgtk3.glade \
79 FINDLIB_COMREQUIRES="\
80 helm-disambiguation \
81 helm-grafite \
82 helm-grafite_engine \
83 helm-ng_disambiguation \
84 helm-ng_cic_content \
85 helm-grafite_parser \
86 helm-content_pres \
87 helm-ng_paramodulation \
88 helm-ng_tactics \
89 "
90 FINDLIB_CREQUIRES=" \
91 $FINDLIB_COMREQUIRES \
92 "
93 FINDLIB_REQUIRES="\
94 $FINDLIB_CREQUIRES \
95 lablgtk3-sourceview3 \
96 "
97
98 for r in $FINDLIB_LIBSREQUIRES $FINDLIB_REQUIRES
99 do
100   AC_MSG_CHECKING(for $r ocaml library)
101   if OCAMLPATH=$OCAMLPATH $OCAMLFIND query $r &> /dev/null; then
102     AC_MSG_RESULT(yes)
103   else
104     AC_MSG_ERROR(could not find $r ocaml library)
105   fi
106 done
107
108 OCAMLFIND_COMMANDS=""
109 # AC_CHECK_PROG(HAVE_OCAMLC_OPT, ocamlc.opt, yes, no)
110 # if test $HAVE_OCAMLC_OPT = "yes"; then
111 #   if test "$OCAMLFIND_COMMANDS" = ""; then
112 #     OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt"
113 #   else
114 #     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlc=ocamlc.opt"
115 #   fi
116 # fi
117 # AC_CHECK_PROG(HAVE_OCAMLOPT_OPT, ocamlopt.opt, yes, no)
118 # if test $HAVE_OCAMLOPT_OPT = "yes"; then
119 #   if test "$OCAMLFIND_COMMANDS" = ""; then
120 #     OCAMLFIND_COMMANDS="ocamlopt=ocamlopt.opt"
121 #   else
122 #     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlopt=ocamlopt.opt"
123 #   fi
124 # fi
125 if test "$OCAMLFIND_COMMANDS" != ""; then
126   OCAMLFIND="OCAMLFIND_COMMANDS='$OCAMLFIND_COMMANDS' $OCAMLFIND"
127 fi
128
129 AC_MSG_CHECKING(--enable-debug argument)
130 AC_ARG_ENABLE(debug,
131   [  --enable-debug       Turn on debugging],
132   [GIVEN="yes";
133    case "${enableval}" in
134    yes) DEBUG=true ;;
135    no)  DEBUG=false ;;
136    *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
137   esac],
138   [GIVEN="no"; DEBUG="$DEBUG_DEFAULT"])
139 MSG=$GIVEN
140 if test "$DEBUG" = "true"; then
141   MSG="$MSG, debugging enabled."
142 else
143   MSG="$MSG, debugging disabled."
144 fi
145 AC_MSG_RESULT($MSG)
146
147 AC_MSG_CHECKING(--enable-annot argument)
148 AC_ARG_ENABLE(annot,
149   [  --enable-annot       Turn on -dtypes compilation option],
150   [GIVEN="yes";
151    case "${enableval}" in
152    yes) ANNOT=true;;
153    no)  ANNOT=false;;
154    *) AC_MSG_ERROR(bad value ${enableval} for --enable-annot) ;;
155   esac],
156   [GIVEN="no"; ANNOT="false"])
157 MSG=$GIVEN
158 if test "$ANNOT" = "true"; then
159   MSG="$MSG, type annotation enabled."
160 else
161   MSG="$MSG, type annotation disabled."
162 fi
163 AC_MSG_RESULT($MSG)
164
165
166 AC_MSG_CHECKING(--with-runtime-dir argument)
167 AC_ARG_WITH(runtime-dir,
168   [  --with-runtime-dir      Runtime directory (current working directory if not given)],
169   [ RT_BASE_DIR="${withval}" ],
170   [ RT_BASE_DIR="$RT_BASE_DIR_DEFAULT" ])
171 MSG="$RT_BASE_DIR"
172 if test "yes" = "$RT_BASE_DIR"; then
173   MSG="
174 ** error:                                                                  **
175 **  empty --with-runtime-dir argument, please use --with-runtime-dir=value **"
176 fi
177 AC_MSG_RESULT($MSG)
178
179 AC_MSG_CHECKING(--with-dbhost argument)
180 AC_ARG_WITH(dbhost,
181   [  --with-dbhost           SQL database hostname],
182   [ DBHOST="${withval}" ],
183   [ DBHOST="$DEFAULT_DBHOST" ])
184 MSG="$DBHOST"
185 if test "yes" = "$DBHOST"; then
186   MSG="
187 ** error:                                                                  **
188 **  empty --with-dbhost argument, please use --with-dbhost=value           **"
189 fi
190 AC_MSG_RESULT($MSG)
191
192 AC_SUBST(CAMLP5O)
193 AC_SUBST(DBHOST)
194 AC_SUBST(DEBUG)
195 AC_SUBST(ANNOT)
196 AC_SUBST(DISTRIBUTED)
197 AC_SUBST(FINDLIB_CREQUIRES)
198 AC_SUBST(FINDLIB_REQUIRES)
199 AC_SUBST(HAVE_OCAMLOPT)
200 AC_SUBST(LABLGLADECC)
201 AC_SUBST(MATITA_VERSION)
202 AC_SUBST(OCAMLFIND)
203 AC_SUBST(OCAMLPATH)
204 AC_SUBST(RT_BASE_DIR)
205 AC_SUBST(SRCROOT)
206 AC_SUBST(TRANSFORMER_MODULE)
207
208 AC_OUTPUT([
209   components/extlib/componentsConf.ml
210   matita/matita.conf.xml
211   matita/buildTimeConf.ml
212   matita/help/C/version.txt
213   Makefile.defs
214 ])
215