]> matita.cs.unibo.it Git - helm.git/blob - configure.ac
moved toplevel makefile to sfotware/
[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="false"
5 DEFAULT_DBHOST="localhost"
6 RT_BASE_DIR_DEFAULT="/usr/local/share/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 OCAMLPATH=""
40 LIBSPATH=""
41 if test -d libs ; then
42   OCAMLPATH=`pwd`/libs/METAS
43   LIBSPATH=`pwd`/libs
44 fi
45 if test -d ocaml ; then
46   OCAMLPATH=`pwd`/ocaml/METAS
47   LIBSPATH=`pwd`/ocaml
48 fi
49 if test -z $OCAMLPATH; then
50   AC_MSG_ERROR(could not find METAS directory)
51 fi
52
53 # creating META.*
54
55 echo -n "creating METAs ... "
56 for f in $OCAMLPATH/meta.*.src; do
57   basename=`basename $f`
58   metaname=`echo $basename | sed 's/meta\.\(.*\)\.src/\1/'`
59   dirname=`echo $metaname | sed 's/^helm-//'`
60   metafile="$OCAMLPATH/META.$metaname"
61   cp $f $metafile
62   echo "directory=\"$LIBSPATH/$dirname\"" >> $metafile
63 done
64 echo "done"
65
66 # (libs) findlib requisites
67
68 FINDLIB_LIBSREQUIRES="\
69 expat \
70 gdome2 \
71 http \
72 lablgtk2 \
73 lablgtkmathview \
74 lablgtksourceview \
75 mysql \
76 netstring \
77 ulex \
78 zip \
79 "
80
81 # (Matita) findlib requisites
82
83 FINDLIB_COMREQUIRES="\
84 helm-cic_disambiguation \
85 helm-grafite \
86 helm-grafite_engine \
87 helm-grafite_parser \
88 helm-hgdome \
89 helm-tactics \
90 "
91 FINDLIB_CREQUIRES=" \
92 $FINDLIB_COMREQUIRES \
93 "
94 FINDLIB_REQUIRES="\
95 $FINDLIB_CREQUIRES \
96 lablgtk2.glade \
97 lablgtkmathview \
98 lablgtksourceview \
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 AC_MSG_RESULT($RT_BASE_DIR)
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 AC_MSG_RESULT($DBHOST)
163
164 AC_SUBST(CAMLP4O)
165 AC_SUBST(DBHOST)
166 AC_SUBST(DEBUG)
167 AC_SUBST(TRANSFORMER_MODULE)
168 AC_SUBST(FINDLIB_REQUIRES)
169 AC_SUBST(FINDLIB_CREQUIRES)
170 AC_SUBST(HAVE_OCAMLOPT)
171 AC_SUBST(LABLGLADECC)
172 AC_SUBST(OCAMLFIND)
173 AC_SUBST(OCAMLPATH)
174 AC_SUBST(RT_BASE_DIR)
175 AC_SUBST(MATITA_VERSION)
176
177 AC_OUTPUT([
178   $LIBSPATH/extlib/componentsConf.ml
179   matita/matita.conf.xml.devel
180   matita/matita.conf.xml.user
181   matita/matita.conf.xml.build
182   matita/buildTimeConf.ml
183   matita/gtkmathview.matita.conf.xml
184   Makefile.defs
185 ])