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