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