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