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