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