]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/configure.ac
* licenses updated
[helm.git] / helm / DEVEL / mathml_editor / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(editex, [0.0.1])
3 AC_CONFIG_SRCDIR(src/TToken.hh)
4 AM_INIT_AUTOMAKE($AC_PACKAGE_NAME, $AC_PACKAGE_VERSION)
5
6 PACKAGE=$PACKAGE_NAME
7 VERSION=$PACKAGE_VERSION
8 AC_SUBST(PACKAGE)
9 AC_SUBST(VERSION)
10
11 EDITEX_VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
12 AC_SUBST(EDITEX_VERSION_INFO)
13
14 AC_ARG_ENABLE(
15         profile,
16         [  --enable-profile[=ARG]  include profiling information [default=no]],
17         profile=$enableval,
18         profile=no
19 )
20
21 AC_ARG_ENABLE(
22         debug,
23         [  --enable-debug[=ARG]    include debugging debug [default=yes]],
24         enable_debug=$enableval,
25         enable_debug=yes
26 )
27
28 if test "x$enable_debug" = "xyes"; then
29    AC_DEFINE(ENABLE_DEBUG,,[Define to 1 if you want to enable validity checks while running])
30 fi
31
32 GMETADOM_PREFIX=""
33 AC_ARG_WITH(gmetadom-prefix,
34         [  --with-gmetadom-prefix=[PFX]         Specify location of gmetadom],
35         GMETADOM_PREFIX=$withval
36 )
37
38 AC_CONFIG_HEADERS([config.h])
39 AM_CONFIG_HEADER(config.h)
40
41 AH_TOP([
42 /* This file is part of EdiTeX, an editor of mathematical
43  * expressions based on TeX syntax.
44  * 
45  * Copyright (C) 2002-2003 Luca Padovani <lpadovan@cs.unibo.it>,
46  *                    2003 Paolo Marinelli <pmarinel@cs.unibo.it>.
47  *
48  * This library is free software; you can redistribute it and/or
49  * modify it under the terms of the GNU Lesser General Public
50  * License as published by the Free Software Foundation; either
51  * version 2.1 of the License, or (at your option) any later version.
52  *
53  * This library is distributed in the hope that it will be useful,
54  * but WITHOUT ANY WARRANTY; without even the implied warranty of
55  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
56  * Lesser General Public License for more details.
57  *
58  * You should have received a copy of the GNU Lesser General Public
59  * License along with this library; if not, write to the Free Software
60  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
61  *
62  * For more information, please visit the project's home page
63  * http://helm.cs.unibo.it/editex/
64  * or send an email to <lpadovan@cs.unibo.it>
65  */
66
67 #ifndef config_h
68 #define config_h
69 ])
70
71 AH_BOTTOM([
72 #endif /* config_h */
73 ])
74
75 AC_PROG_CC
76 AC_PROG_CXX
77 AC_PROG_INSTALL
78 AC_HEADER_STDC([])
79
80 AC_LANG_PUSH(C++)
81 AC_CHECK_HEADERS(hash_map)
82 AC_CHECK_HEADERS(ext/hash_map)
83 AC_LANG_POP(C++)
84
85 AC_SUBST(CFLAGS)
86 AC_SUBST(CPPFLAGS)
87 AC_SUBST(LDFLAGS)
88
89 AM_PROG_LIBTOOL
90
91 PKG_CHECK_MODULES(GLIB2, glib-2.0)
92 AC_SUBST(GLIB2_CFLAGS)
93 AC_SUBST(GLIB2_LIBS)
94
95 GMETADOM_CONFIG="gmetadom-config"
96 GMETADOM_MIN_VERSION=0.1.0
97 AC_MSG_CHECKING([for GMetaDOM C++ library] >= $GMETADOM_MIN_VERSION) 
98 if test "x$GMETADOM_PREFIX" != "x"
99 then
100         if ${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG --version > /dev/null 2>&1
101         then
102                 GMETADOM_CONFIG=${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG
103         elif ! $GMETADOM_CONFIG --version > /dev/null 2>&1
104         then
105                 AC_MSG_ERROR([Could not find gmetadom anywhere (see config.log for details).])
106         fi
107 fi
108
109 dnl
110 dnl test version and init our variables
111 dnl
112 vers=`$GMETADOM_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
113 minvers=`echo $GMETADOM_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
114 if test "$vers" -ge "$minvers"
115 then
116         GMETADOM_LIBS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --libs`"
117         GMETADOM_CFLAGS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --cflags`"
118         AC_MSG_RESULT(found)
119 else
120         AC_MSG_ERROR([You need at least GMetaDOM (C++) $GMETADOM_MIN_VERSION for this version of $PACKAGE])
121 fi
122
123 AC_SUBST(GMETADOM_CFLAGS)
124 AC_SUBST(GMETADOM_LIBS)
125
126 GDOMEXSLT_CONFIG="gdome_xslt_cpp_smart-config"
127 GDOMEXSLT_MIN_VERSION=0.0.4
128 AC_MSG_CHECKING([for gdome_xslt C++ library] >= $GDOMEXSLT_MIN_VERSION) 
129 if test "x$GDOMEXSLT_PREFIX" != "x"
130 then
131         if ${GDOMEXSLT_PREFIX}/bin/$GDOMEXSLT_CONFIG --version > /dev/null 2>&1
132         then
133                 GDOMEXSLT_CONFIG=${GDOMEXSLT_PREFIX}/bin/$GDOMEXSLT_CONFIG
134         elif ! $GDOMEXSLT_CONFIG --version > /dev/null 2>&1
135         then
136                 AC_MSG_ERROR([Could not find gdome_xslt anywhere (see config.log for details).])
137         fi
138 fi
139
140 dnl
141 dnl test version and init our variables
142 dnl
143 vers=`$GDOMEXSLT_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
144 minvers=`echo $GDOMEXSLT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
145 if test "$vers" -ge "$minvers"
146 then
147         GDOMEXSLT_LIBS="`$GDOMEXSLT_CONFIG --libs`"
148         GDOMEXSLT_CFLAGS="`$GDOMEXSLT_CONFIG --cflags`"
149         AC_MSG_RESULT(found)
150 else
151         AC_MSG_ERROR([You need at least gdome_xslt (C++) $GDOMEXSLT_MIN_VERSION for this version of $PACKAGE])
152 fi
153
154 AC_SUBST(GDOMEXSLT_CFLAGS)
155 AC_SUBST(GDOMEXSLT_LIBS)
156
157 GTKMATHVIEW_CONFIG="gtkmathview-config"
158 GTKMATHVIEW_MIN_VERSION=0.4.0
159 AC_MSG_CHECKING([for gtkmathview library] >= $GTKMATHVIEW_MIN_VERSION) 
160 if test "x$GTKMATHVIEW_PREFIX" != "x"
161 then
162         if ${GTKMATHVIEW_PREFIX}/bin/$GTKMATHVIEW_CONFIG --version > /dev/null 2>&1
163         then
164                 GTKMATHVIEW_CONFIG=${GTKMATHVIEW_PREFIX}/bin/$GTKMATHVIEW_CONFIG
165         elif ! $GTKMATHVIEW_CONFIG --version > /dev/null 2>&1
166         then
167                 AC_MSG_ERROR([Could not find gtkmathview anywhere (see config.log for details).])
168         fi
169 fi
170
171 dnl
172 dnl test version and init our variables
173 dnl
174 vers=`$GTKMATHVIEW_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
175 minvers=`echo $GTKMATHVIEW_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
176 if test "$vers" -ge "$minvers"
177 then
178         GTKMATHVIEW_LIBS="`$GTKMATHVIEW_CONFIG --libs`"
179         GTKMATHVIEW_CFLAGS="`$GTKMATHVIEW_CONFIG --cflags`"
180         AC_MSG_RESULT(found)
181 else
182         AC_MSG_ERROR([You need at least gtkmathview $GTKMATHVIEW_MIN_VERSION for this version of $PACKAGE])
183 fi
184
185 AC_SUBST(GTKMATHVIEW_CFLAGS)
186 AC_SUBST(GTKMATHVIEW_LIBS)
187
188 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
189 if test $HAVE_OCAMLC = "no"; then
190   AC_MSG_ERROR([could not find ocamlc in PATH, please make sure ocaml is installed])
191 else
192   OCAMLC=ocamlc
193   OCAMLSTDLIBDIR="`ocamlc -where`"
194   OCAMLSTUBDIR="`ocamlc -where`/stublibs"
195   AC_SUBST(OCAMLC)
196   AC_SUBST(OCAMLSTDLIBDIR)
197   AC_SUBST(OCAMLSTUBDIR)
198 fi
199
200 AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no)
201 if test $HAVE_OCAMLOPT = "no"; then
202         AC_MSG_WARN([ocaml native libraries won't be compiled since ocamlopt was not found])
203 else
204   OCAMLOPT=ocamlopt
205   AC_SUBST(OCAMLOPT)
206 fi
207 AM_CONDITIONAL(HAVE_OCAMLOPT_COND, test x$HAVE_OCAMLOPT = xyes)
208
209 AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
210 if test $HAVE_OCAMLFIND = "no"; then
211   AC_MSG_ERROR([could not find ocamlfind in PATH, please make sure findlib is installed])
212 else
213   OCAMLFIND=ocamlfind
214   AC_SUBST(OCAMLFIND)
215 fi
216
217 AC_CHECK_PROG(HAVE_OCAMLDEP, ocamldep, yes, no)
218 if test $HAVE_OCAMLDEP = "yes"; then
219   OCAMLDEP=ocamldep
220   AC_SUBST(OCAMLDEP)
221 fi
222
223 AC_CHECK_PROG(HAVE_OCAMLMKLIB, ocamlmklib, yes, no)
224 if test $HAVE_OCAMLMKLIB = "no"; then
225   AC_MSG_ERROR([could not find ocamlmklib in PATH, please make sure ocamlmklib is installed])
226 else
227   OCAMLMKLIB=ocamlmklib
228   AC_SUBST(OCAMLMKLIB)
229 fi
230 AM_CONDITIONAL(HAVE_SHAREDLIBS_COND, test x$enable_shared = xyes)
231
232 AC_MSG_CHECKING(for gdome2 ocaml binding)
233 ocamlfind query gdome2 ||
234   AC_MSG_ERROR(gdome2 not installed (according to findlib))
235 MLGDOME_CFLAGS="`$OCAMLFIND query -i-format gdome2`"
236 AC_SUBST(MLGDOME_CFLAGS)
237
238 AC_MSG_CHECKING(for the ocaml library dir)
239 OCAML_LIB_DIR=`ocamlc -where`
240 AC_MSG_RESULT($OCAML_LIB_DIR)
241
242 AC_CHECK_FILE(/usr/include/caml/mlvalues.h,
243         OCAML_INCLUDE_DIR=/usr/include/caml,
244         OCAML_INCLUDE_DIR=$OCAML_LIB_DIR/caml
245 )
246
247 AC_SUBST(OCAML_INCLUDE_DIR)
248
249 AC_CONFIG_FILES([
250  Makefile 
251  src/Makefile
252  test/Makefile
253  textomml/Makefile
254  textomml/config.dirs
255  ocaml/Makefile
256  ocaml/META
257  editex.pc
258 ])
259 AC_OUTPUT