]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/configure.ac
ocaml 3.09 transition
[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.5])
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 dnl 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-2004 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 dnl PKG_CHECK_MODULES(GLIB2, glib-2.0)
92 dnl AC_SUBST(GLIB2_CFLAGS)
93 dnl AC_SUBST(GLIB2_LIBS)
94
95 PKG_CHECK_MODULES(GMETADOM,gdome2-cpp-smart)
96 AC_SUBST(GMETADOM_CFLAGS)
97 AC_SUBST(GMETADOM_LIBS)
98
99 PKG_CHECK_MODULES(GDOMEXSLT,gdome2-xslt-cpp-smart)
100 AC_SUBST(GDOMEXSLT_CFLAGS)
101 AC_SUBST(GDOMEXSLT_LIBS)
102
103 PKG_CHECK_MODULES(GTKMATHVIEW,gtkmathview-gmetadom)
104 AC_SUBST(GTKMATHVIEW_CFLAGS)
105 AC_SUBST(GTKMATHVIEW_LIBS)
106
107 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
108 if test $HAVE_OCAMLC = "no"; then
109   AC_MSG_ERROR([could not find ocamlc in PATH, please make sure ocaml is installed])
110 else
111   OCAMLC=ocamlc
112   OCAMLSTDLIBDIR="`ocamlc -where`"
113   OCAMLSTUBDIR="`ocamlc -where`/stublibs"
114   AC_SUBST(OCAMLC)
115   AC_SUBST(OCAMLSTDLIBDIR)
116   AC_SUBST(OCAMLSTUBDIR)
117 fi
118
119 AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no)
120 if test $HAVE_OCAMLOPT = "no"; then
121         AC_MSG_WARN([ocaml native libraries won't be compiled since ocamlopt was not found])
122 else
123   OCAMLOPT=ocamlopt
124   AC_SUBST(OCAMLOPT)
125 fi
126 AM_CONDITIONAL(HAVE_OCAMLOPT_COND, test x$HAVE_OCAMLOPT = xyes)
127
128 AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
129 if test $HAVE_OCAMLFIND = "no"; then
130   AC_MSG_ERROR([could not find ocamlfind in PATH, please make sure findlib is installed])
131 else
132   OCAMLFIND=ocamlfind
133   AC_SUBST(OCAMLFIND)
134 fi
135
136 AC_CHECK_PROG(HAVE_OCAMLDEP, ocamldep, yes, no)
137 if test $HAVE_OCAMLDEP = "yes"; then
138   OCAMLDEP=ocamldep
139   AC_SUBST(OCAMLDEP)
140 fi
141
142 AC_CHECK_PROG(HAVE_OCAMLMKLIB, ocamlmklib, yes, no)
143 if test $HAVE_OCAMLMKLIB = "no"; then
144   AC_MSG_ERROR([could not find ocamlmklib in PATH, please make sure ocamlmklib is installed])
145 else
146   OCAMLMKLIB=ocamlmklib
147   AC_SUBST(OCAMLMKLIB)
148 fi
149 AM_CONDITIONAL(HAVE_SHAREDLIBS_COND, test x$enable_shared = xyes)
150
151 AC_MSG_CHECKING(for gdome2 ocaml binding)
152 ocamlfind query gdome2 ||
153   AC_MSG_ERROR(gdome2 not installed (according to findlib))
154 MLGDOME_CFLAGS="`$OCAMLFIND query -i-format gdome2`"
155 AC_SUBST(MLGDOME_CFLAGS)
156
157 AC_MSG_CHECKING(for the ocaml library dir)
158 OCAML_LIB_DIR=`ocamlc -where`
159 AC_MSG_RESULT($OCAML_LIB_DIR)
160
161 AC_CHECK_FILE(/usr/include/caml/mlvalues.h,
162         OCAML_INCLUDE_DIR=/usr/include/caml,
163         OCAML_INCLUDE_DIR=$OCAML_LIB_DIR/caml
164 )
165
166 AC_SUBST(OCAML_INCLUDE_DIR)
167
168 if test $profile = yes; then
169         CFLAFS="$CFLAGS -O0 -pg"
170         CXXFLAGS="$CXXFLAGS -O0 -pg"
171         AC_DEFINE(ENABLE_PROFILE,,[Define to 1 to let the widget collect some information for profiling purposes])
172 fi
173
174 AC_CONFIG_FILES([
175  Makefile 
176  src/Makefile
177  src/config.dirs
178  test/Makefile
179  textomml/Makefile
180  textomml/config.dirs
181  ocaml/Makefile
182  ocaml/META
183  editex.pc
184  xsl/Makefile
185  dict/Makefile
186 ])
187 AC_OUTPUT