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