1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_SRCDIR([src/TToken.hh])
7 EDITEX_VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
8 AC_SUBST(EDITEX_VERSION_INFO)
12 [ --enable-profile[=ARG] include profiling information [default=no]],
19 [ --enable-debug[=ARG] include debugging debug [default=yes]],
20 enable_debug=$enableval,
24 if test "x$enable_debug" = "xyes"; then
25 AC_DEFINE(ENABLE_DEBUG,,[Define to 1 if you want to enable validity checks while running])
29 AC_ARG_WITH(gmetadom-prefix,
30 [ --with-gmetadom-prefix=[PFX] Specify location of gmetadom],
31 GMETADOM_PREFIX=$withval
34 AC_CONFIG_HEADERS([config.h])
35 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
36 AM_CONFIG_HEADER(config.h)
39 /* Copyright (C) 2002, Luca Padovani <luca.padovani@cs.unibo.it>.
41 * This file is part of EdiTeX, an editor of mathematical
42 * expressions based on TeX syntax
44 * EdiTeX is free software; you can redistribute it and/or
45 * modify it under the terms of the GNU General Public License
46 * as published by the Free Software Foundation; either version 2
47 * of the License, or (at your option) any later version.
49 * EdiTeX is distributed in the hope that it will be useful,
50 * but WITHOUT ANY WARRANTY; without even the implied warranty of
51 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52 * GNU General Public License for more details.
54 * You should have received a copy of the GNU General Public License
55 * along with EdiTeX; if not, write to the Free Software
56 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
58 * For details, see the EdiTeX World-Wide-Web page,
59 * http://helm.cs.unibo.it/editex, or send a mail to
60 * <luca.padovani@cs.unibo.it>
76 AC_CHECK_HEADERS(hash_map)
77 AC_CHECK_HEADERS(ext/hash_map)
86 GMETADOM_CONFIG="gmetadom-config"
87 GMETADOM_MIN_VERSION=0.1.0
88 AC_MSG_CHECKING([for GMetaDOM C++ library] >= $GMETADOM_MIN_VERSION)
89 if test "x$GMETADOM_PREFIX" != "x"
91 if ${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG --version > /dev/null 2>&1
93 GMETADOM_CONFIG=${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG
94 elif ! $GMETADOM_CONFIG --version > /dev/null 2>&1
96 AC_MSG_ERROR([Could not find gmetadom anywhere (see config.log for details).])
101 dnl test version and init our variables
103 vers=`$GMETADOM_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
104 minvers=`echo $GMETADOM_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
105 if test "$vers" -ge "$minvers"
107 GMETADOM_LIBS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --libs`"
108 GMETADOM_CFLAGS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --cflags`"
111 AC_MSG_ERROR([You need at least GMetaDOM (C++) $GMETADOM_MIN_VERSION for this version of $PACKAGE])
114 AC_SUBST(GMETADOM_CFLAGS)
115 AC_SUBST(GMETADOM_LIBS)
117 GDOMEXSLT_CONFIG="gdome_xslt_cpp_smart-config"
118 GDOMEXSLT_MIN_VERSION=0.0.4
119 AC_MSG_CHECKING([for gdome_xslt C++ library] >= $GDOMEXSLT_MIN_VERSION)
120 if test "x$GDOMEXSLT_PREFIX" != "x"
122 if ${GDOMEXSLT_PREFIX}/bin/$GDOMEXSLT_CONFIG --version > /dev/null 2>&1
124 GDOMEXSLT_CONFIG=${GDOMEXSLT_PREFIX}/bin/$GDOMEXSLT_CONFIG
125 elif ! $GDOMEXSLT_CONFIG --version > /dev/null 2>&1
127 AC_MSG_ERROR([Could not find gdome_xslt anywhere (see config.log for details).])
132 dnl test version and init our variables
134 vers=`$GDOMEXSLT_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
135 minvers=`echo $GDOMEXSLT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
136 if test "$vers" -ge "$minvers"
138 GDOMEXSLT_LIBS="`$GDOMEXSLT_CONFIG --libs`"
139 GDOMEXSLT_CFLAGS="`$GDOMEXSLT_CONFIG --cflags`"
142 AC_MSG_ERROR([You need at least gdome_xslt (C++) $GDOMEXSLT_MIN_VERSION for this version of $PACKAGE])
145 AC_SUBST(GDOMEXSLT_CFLAGS)
146 AC_SUBST(GDOMEXSLT_LIBS)
148 GTKMATHVIEW_CONFIG="gtkmathview-config"
149 GTKMATHVIEW_MIN_VERSION=0.4.0
150 AC_MSG_CHECKING([for gtkmathview library] >= $GTKMATHVIEW_MIN_VERSION)
151 if test "x$GTKMATHVIEW_PREFIX" != "x"
153 if ${GTKMATHVIEW_PREFIX}/bin/$GTKMATHVIEW_CONFIG --version > /dev/null 2>&1
155 GTKMATHVIEW_CONFIG=${GTKMATHVIEW_PREFIX}/bin/$GTKMATHVIEW_CONFIG
156 elif ! $GTKMATHVIEW_CONFIG --version > /dev/null 2>&1
158 AC_MSG_ERROR([Could not find gtkmathview anywhere (see config.log for details).])
163 dnl test version and init our variables
165 vers=`$GTKMATHVIEW_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
166 minvers=`echo $GTKMATHVIEW_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
167 if test "$vers" -ge "$minvers"
169 GTKMATHVIEW_LIBS="`$GTKMATHVIEW_CONFIG --libs`"
170 GTKMATHVIEW_CFLAGS="`$GTKMATHVIEW_CONFIG --cflags`"
173 AC_MSG_ERROR([You need at least gtkmathview $GTKMATHVIEW_MIN_VERSION for this version of $PACKAGE])
176 AC_SUBST(GTKMATHVIEW_CFLAGS)
177 AC_SUBST(GTKMATHVIEW_LIBS)
179 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
180 if test $HAVE_OCAMLC = "no"; then
181 AC_MSG_ERROR([could not find ocamlc in PATH, please make sure ocaml is installed])
184 OCAMLSTDLIBDIR="`ocamlc -where`"
185 OCAMLSTUBDIR="`ocamlc -where`/stublibs"
187 AC_SUBST(OCAMLSTDLIBDIR)
188 AC_SUBST(OCAMLSTUBDIR)
191 AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no)
192 if test $HAVE_OCAMLOPT = "no"; then
193 AC_MSG_WARN([ocaml native libraries won't be compiled since ocamlopt was not found])
198 AM_CONDITIONAL(HAVE_OCAMLOPT_COND, test x$HAVE_OCAMLOPT = xyes)
200 AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
201 if test $HAVE_OCAMLFIND = "no"; then
202 AC_MSG_ERROR([could not find ocamlfind in PATH, please make sure findlib is installed])
208 AC_CHECK_PROG(HAVE_OCAMLDEP, ocamldep, yes, no)
209 if test $HAVE_OCAMLDEP = "yes"; then
214 AC_CHECK_PROG(HAVE_OCAMLMKLIB, ocamlmklib, yes, no)
215 if test $HAVE_OCAMLMKLIB = "no"; then
216 AC_MSG_ERROR([could not find ocamlmklib in PATH, please make sure ocamlmklib is installed])
218 OCAMLMKLIB=ocamlmklib
222 AC_MSG_CHECKING(for gdome2 ocaml binding)
223 ocamlfind query gdome2 ||
224 AC_MSG_ERROR(gdome2 not installed (according to findlib))
225 MLGDOME_CFLAGS="`$OCAMLFIND query -i-format gdome2`"
226 AC_SUBST(MLGDOME_CFLAGS)
228 AC_MSG_CHECKING(for the ocaml library dir)
229 OCAML_LIB_DIR=`ocamlc -where`
230 AC_MSG_RESULT($OCAML_LIB_DIR)
232 AC_CHECK_FILE(/usr/include/caml/mlvalues.h,
233 OCAML_INCLUDE_DIR=/usr/include/caml,
234 OCAML_INCLUDE_DIR=$OCAML_LIB_DIR/caml
237 AC_SUBST(OCAML_INCLUDE_DIR)
248 AC_CONFIG_COMMANDS([default],[[chmod +x editex-config]],[[]])