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