]> matita.cs.unibo.it Git - helm.git/blob - configure.ac
New dependency over acic_procedural.
[helm.git] / 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="mowgli.cs.unibo.it"
7 RT_BASE_DIR_DEFAULT="`pwd`/matita"
8 MATITA_VERSION="0.1.0"
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_CAMLP4O, camlp4o, yes, no)
34 if test $HAVE_CAMLP4O = "yes"; then
35   CAMLP4O="camlp4o"
36 else
37   AC_MSG_ERROR(could not find camlp4o)
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 lablgtkmathview \
66 lablgtksourceview \
67 mysql \
68 netstring \
69 ulex \
70 zip \
71 "
72
73 # (Matita) findlib requisites
74
75 FINDLIB_COMREQUIRES="\
76 helm-cic_disambiguation \
77 helm-grafite \
78 helm-grafite_engine \
79 helm-tptp_grafite \
80 helm-grafite_parser \
81 helm-acic_procedural \
82 helm-hgdome \
83 helm-tactics \
84 "
85 FINDLIB_CREQUIRES=" \
86 $FINDLIB_COMREQUIRES \
87 "
88 FINDLIB_REQUIRES="\
89 $FINDLIB_CREQUIRES \
90 lablgtk2.glade \
91 lablgtkmathview \
92 lablgtksourceview \
93 helm-xmldiff \
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(--with-runtime-dir argument)
145 AC_ARG_WITH(runtime-dir,
146   [  --with-runtime-dir      Runtime directory (current working directory if not given)],
147   [ RT_BASE_DIR="${withval}" ],
148   [ RT_BASE_DIR="$RT_BASE_DIR_DEFAULT" ])
149 MSG="$RT_BASE_DIR"
150 if test "yes" = "$RT_BASE_DIR"; then
151   MSG="
152 ** error:                                                                  **
153 **  empty --with-runtime-dir argument, please use --with-runtime-dir=value **"
154 fi
155 AC_MSG_RESULT($MSG)
156
157 AC_MSG_CHECKING(--with-dbhost argument)
158 AC_ARG_WITH(dbhost,
159   [  --with-dbhost           SQL database hostname],
160   [ DBHOST="${withval}" ],
161   [ DBHOST="$DEFAULT_DBHOST" ])
162 MSG="$DBHOST"
163 if test "yes" = "$DBHOST"; then
164   MSG="
165 ** error:                                                                  **
166 **  empty --with-dbhost argument, please use --with-dbhost=value           **"
167 fi
168 AC_MSG_RESULT($MSG)
169
170 AC_SUBST(CAMLP4O)
171 AC_SUBST(DBHOST)
172 AC_SUBST(DEBUG)
173 AC_SUBST(DISTRIBUTED)
174 AC_SUBST(FINDLIB_CREQUIRES)
175 AC_SUBST(FINDLIB_REQUIRES)
176 AC_SUBST(HAVE_OCAMLOPT)
177 AC_SUBST(LABLGLADECC)
178 AC_SUBST(MATITA_VERSION)
179 AC_SUBST(OCAMLFIND)
180 AC_SUBST(OCAMLPATH)
181 AC_SUBST(RT_BASE_DIR)
182 AC_SUBST(SRCROOT)
183 AC_SUBST(TRANSFORMER_MODULE)
184
185 AC_OUTPUT([
186   components/extlib/componentsConf.ml
187   matita/matita.conf.xml
188   matita/buildTimeConf.ml
189   matita/gtkmathview.matita.conf.xml
190   matita/help/C/version.txt
191   Makefile.defs
192 ])