]> matita.cs.unibo.it Git - helm.git/blob - configure.ac
- no longer need to dynamically discover if the components dir is libs/ or
[helm.git] / configure.ac
1 AC_INIT(matita/matitaTypes.ml)
2
3 # Distribution settings (i.e. settings to be manipulated before a release)
4 DEBUG_DEFAULT="true"
5 DEFAULT_DBHOST="mowgli.cs.unibo.it"
6 RT_BASE_DIR_DEFAULT="`pwd`/matita"
7 MATITA_VERSION="0.1.0"
8 # End of distribution settings
9
10 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
11 if test $HAVE_OCAMLC = "no"; then
12   AC_MSG_ERROR(could not find ocamlc)
13 fi
14 AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no)
15 if test $HAVE_OCAMLOPT = "no"; then
16   AC_MSG_WARN(could not find ocamlopt: native code compilation disabled)
17 fi
18 AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
19 if test $HAVE_OCAMLFIND = "yes"; then
20   OCAMLFIND="ocamlfind"
21 else
22   AC_MSG_ERROR(could not find ocamlfind)
23 fi
24 AC_CHECK_PROG(HAVE_LABLGLADECC, lablgladecc2, yes, no)
25 if test $HAVE_LABLGLADECC = "yes"; then
26   LABLGLADECC="lablgladecc2"
27 else
28   AC_MSG_ERROR(could not find lablgladecc2)
29 fi
30 AC_CHECK_PROG(HAVE_CAMLP4O, camlp4o, yes, no)
31 if test $HAVE_CAMLP4O = "yes"; then
32   CAMLP4O="camlp4o"
33 else
34   AC_MSG_ERROR(could not find camlp4o)
35 fi
36
37 # look for METAS dir
38
39 LIBSPATH="`pwd`/components"
40 OCAMLPATH="$LIBSPATH/METAS"
41
42 # creating META.*
43
44 echo -n "creating METAs ... "
45 for f in $OCAMLPATH/meta.*.src; do
46   basename=`basename $f`
47   metaname=`echo $basename | sed 's/meta\.\(.*\)\.src/\1/'`
48   dirname=`echo $metaname | sed 's/^helm-//'`
49   metafile="$OCAMLPATH/META.$metaname"
50   cp $f $metafile
51   echo "directory=\"$LIBSPATH/$dirname\"" >> $metafile
52 done
53 echo "done"
54
55 # (libs) findlib requisites
56
57 FINDLIB_LIBSREQUIRES="\
58 expat \
59 gdome2 \
60 http \
61 lablgtk2 \
62 lablgtkmathview \
63 lablgtksourceview \
64 mysql \
65 netstring \
66 ulex \
67 zip \
68 "
69
70 # (Matita) findlib requisites
71
72 FINDLIB_COMREQUIRES="\
73 helm-cic_disambiguation \
74 helm-grafite \
75 helm-grafite_engine \
76 helm-grafite_parser \
77 helm-hgdome \
78 helm-tactics \
79 "
80 FINDLIB_CREQUIRES=" \
81 $FINDLIB_COMREQUIRES \
82 "
83 FINDLIB_REQUIRES="\
84 $FINDLIB_CREQUIRES \
85 lablgtk2.glade \
86 lablgtkmathview \
87 lablgtksourceview \
88 helm-xmldiff \
89 "
90 for r in $FINDLIB_LIBSREQUIRES $FINDLIB_REQUIRES
91 do
92   AC_MSG_CHECKING(for $r ocaml library)
93   if OCAMLPATH=$OCAMLPATH $OCAMLFIND query $r &> /dev/null; then
94     AC_MSG_RESULT(yes)
95   else
96     AC_MSG_ERROR(could not find $r ocaml library)
97   fi
98 done
99
100 OCAMLFIND_COMMANDS=""
101 # AC_CHECK_PROG(HAVE_OCAMLC_OPT, ocamlc.opt, yes, no)
102 # if test $HAVE_OCAMLC_OPT = "yes"; then
103 #   if test "$OCAMLFIND_COMMANDS" = ""; then
104 #     OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt"
105 #   else
106 #     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlc=ocamlc.opt"
107 #   fi
108 # fi
109 # AC_CHECK_PROG(HAVE_OCAMLOPT_OPT, ocamlopt.opt, yes, no)
110 # if test $HAVE_OCAMLOPT_OPT = "yes"; then
111 #   if test "$OCAMLFIND_COMMANDS" = ""; then
112 #     OCAMLFIND_COMMANDS="ocamlopt=ocamlopt.opt"
113 #   else
114 #     OCAMLFIND_COMMANDS="$OCAMLFIND_COMMANDS ocamlopt=ocamlopt.opt"
115 #   fi
116 # fi
117 if test "$OCAMLFIND_COMMANDS" != ""; then
118   OCAMLFIND="OCAMLFIND_COMMANDS='$OCAMLFIND_COMMANDS' $OCAMLFIND"
119 fi
120
121 AC_MSG_CHECKING(--enable-debug argument)
122 AC_ARG_ENABLE(debug,
123   [  --enable-debug       Turn on debugging],
124   [GIVEN="yes";
125    case "${enableval}" in
126    yes) DEBUG=true ;;
127    no)  DEBUG=false ;;
128    *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
129   esac],
130   [GIVEN="no"; DEBUG="$DEBUG_DEFAULT"])
131 MSG=$GIVEN
132 if test "$DEBUG" = "true"; then
133   MSG="$MSG, debugging enabled."
134 else
135   MSG="$MSG, debugging disabled."
136 fi
137 AC_MSG_RESULT($MSG)
138
139 AC_MSG_CHECKING(--with-runtime-dir argument)
140 AC_ARG_WITH(runtime-dir,
141   [  --with-runtime-dir      Runtime directory (current working directory if not given)],
142   [ RT_BASE_DIR="${withval}" ],
143   [ RT_BASE_DIR="$RT_BASE_DIR_DEFAULT" ])
144 AC_MSG_RESULT($RT_BASE_DIR)
145
146 AC_MSG_CHECKING(--with-dbhost argument)
147 AC_ARG_WITH(dbhost,
148   [  --with-dbhost           SQL database hostname],
149   [ DBHOST="${withval}" ],
150   [ DBHOST="$DEFAULT_DBHOST" ])
151 AC_MSG_RESULT($DBHOST)
152
153 AC_SUBST(CAMLP4O)
154 AC_SUBST(DBHOST)
155 AC_SUBST(DEBUG)
156 AC_SUBST(TRANSFORMER_MODULE)
157 AC_SUBST(FINDLIB_REQUIRES)
158 AC_SUBST(FINDLIB_CREQUIRES)
159 AC_SUBST(HAVE_OCAMLOPT)
160 AC_SUBST(LABLGLADECC)
161 AC_SUBST(OCAMLFIND)
162 AC_SUBST(OCAMLPATH)
163 AC_SUBST(RT_BASE_DIR)
164 AC_SUBST(MATITA_VERSION)
165
166 AC_OUTPUT([
167   components/extlib/componentsConf.ml
168   matita/matita.conf.xml.devel
169   matita/matita.conf.xml.user
170   matita/matita.conf.xml.build
171   matita/buildTimeConf.ml
172   matita/gtkmathview.matita.conf.xml
173   Makefile.defs
174 ])