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