]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/configure.ac
Initial revision
[helm.git] / helm / DEVEL / mathml_editor / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT
3 AC_CONFIG_SRCDIR([src/TToken.hh])
4
5 PACKAGE=editex
6 VERSION=0.0.1
7 EDITEX_VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
8 AC_SUBST(EDITEX_VERSION_INFO)
9
10 AC_ARG_ENABLE(
11         profile,
12         [  --enable-profile[=ARG]  include profiling information [default=no]],
13         profile=$enableval,
14         profile=no
15 )
16
17 AC_ARG_ENABLE(
18         debug,
19         [  --enable-debug[=ARG]    include debugging debug [default=yes]],
20         enable_debug=$enableval,
21         enable_debug=yes
22 )
23
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])
26 fi
27
28 GMETADOM_PREFIX=""
29 AC_ARG_WITH(gmetadom-prefix,
30         [  --with-gmetadom-prefix=[PFX]         Specify location of gmetadom],
31         GMETADOM_PREFIX=$withval
32 )
33
34 AC_CONFIG_HEADERS([config.h])
35 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
36 AM_CONFIG_HEADER(config.h)
37
38 AH_TOP([
39 /* Copyright (C) 2002, Luca Padovani <luca.padovani@cs.unibo.it>.
40  *
41  * This file is part of EdiTeX, an editor of mathematical
42  * expressions based on TeX syntax
43  * 
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.
48  *
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.
53  *
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.
57  * 
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>
61  */
62 #ifndef config_h
63 #define config_h
64 ])
65
66 AH_BOTTOM([
67 #endif /* config_h */
68 ])
69
70 AC_PROG_CC
71 AC_PROG_CXX
72 AC_PROG_INSTALL
73 AC_HEADER_STDC([])
74
75 AC_SUBST(CFLAGS)
76 AC_SUBST(CPPFLAGS)
77 AC_SUBST(LDFLAGS)
78
79 AM_PROG_LIBTOOL
80
81 GMETADOM_CONFIG="gmetadom-config"
82 GMETADOM_MIN_VERSION=0.1.0
83 AC_MSG_CHECKING([for GMetaDOM C++ library] >= $GMETADOM_MIN_VERSION) 
84 if test "x$GMETADOM_PREFIX" != "x"
85 then
86         if ${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG --version > /dev/null 2>&1
87         then
88                 GMETADOM_CONFIG=${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG
89         elif ! $GMETADOM_CONFIG --version > /dev/null 2>&1
90         then
91                 AC_MSG_ERROR([Could not find gmetadom anywhere (see config.log for details).])
92         fi
93 fi
94
95 dnl
96 dnl test version and init our variables
97 dnl
98 vers=`$GMETADOM_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
99 minvers=`echo $GMETADOM_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
100 if test "$vers" -ge "$minvers"
101 then
102         GMETADOM_LIBS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --libs`"
103         GMETADOM_CFLAGS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --cflags`"
104         AC_MSG_RESULT(found)
105 else
106         AC_MSG_ERROR([You need at least GMetaDOM (C++) $GMETADOM_MIN_VERSION for this version of $PACKAGE])
107 fi
108
109 AC_SUBST(GMETADOM_CFLAGS)
110 AC_SUBST(GMETADOM_LIBS)
111
112 GDOMEXSLT_CONFIG="gdome_xslt_cpp_smart-config"
113 GDOMEXSLT_MIN_VERSION=0.0.1
114 AC_MSG_CHECKING([for gdome_xslt C++ library] >= $GDOMEXSLT_MIN_VERSION) 
115 if test "x$GDOMEXSLT_PREFIX" != "x"
116 then
117         if ${GDOMEXSLT_PREFIX}/bin/$GDOMEXSLT_CONFIG --version > /dev/null 2>&1
118         then
119                 GDOMEXSLT_CONFIG=${GDOMEXSLT_PREFIX}/bin/$GDOMEXSLT_CONFIG
120         elif ! $GDOMEXSLT_CONFIG --version > /dev/null 2>&1
121         then
122                 AC_MSG_ERROR([Could not find gdome_xslt anywhere (see config.log for details).])
123         fi
124 fi
125
126 dnl
127 dnl test version and init our variables
128 dnl
129 vers=`$GDOMEXSLT_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
130 minvers=`echo $GDOMEXSLT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
131 if test "$vers" -ge "$minvers"
132 then
133         GDOMEXSLT_LIBS="`$GDOMEXSLT_CONFIG --libs`"
134         GDOMEXSLT_CFLAGS="`$GDOMEXSLT_CONFIG --cflags`"
135         AC_MSG_RESULT(found)
136 else
137         AC_MSG_ERROR([You need at least gdome_xslt (C++) $GDOMEXSLT_MIN_VERSION for this version of $PACKAGE])
138 fi
139
140 AC_SUBST(GDOMEXSLT_CFLAGS)
141 AC_SUBST(GDOMEXSLT_LIBS)
142
143 GTKMATHVIEW_CONFIG="gtkmathview-config"
144 GTKMATHVIEW_MIN_VERSION=0.4.0
145 AC_MSG_CHECKING([for gtkmathview library] >= $GTKMATHVIEW_MIN_VERSION) 
146 if test "x$GTKMATHVIEW_PREFIX" != "x"
147 then
148         if ${GTKMATHVIEW_PREFIX}/bin/$GTKMATHVIEW_CONFIG --version > /dev/null 2>&1
149         then
150                 GTKMATHVIEW_CONFIG=${GTKMATHVIEW_PREFIX}/bin/$GTKMATHVIEW_CONFIG
151         elif ! $GTKMATHVIEW_CONFIG --version > /dev/null 2>&1
152         then
153                 AC_MSG_ERROR([Could not find gtkmathview anywhere (see config.log for details).])
154         fi
155 fi
156
157 dnl
158 dnl test version and init our variables
159 dnl
160 vers=`$GTKMATHVIEW_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
161 minvers=`echo $GTKMATHVIEW_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
162 if test "$vers" -ge "$minvers"
163 then
164         GTKMATHVIEW_LIBS="`$GTKMATHVIEW_CONFIG --libs`"
165         GTKMATHVIEW_CFLAGS="`$GTKMATHVIEW_CONFIG --cflags`"
166         AC_MSG_RESULT(found)
167 else
168         AC_MSG_ERROR([You need at least gtkmathview $GTKMATHVIEW_MIN_VERSION for this version of $PACKAGE])
169 fi
170
171 AC_SUBST(GTKMATHVIEW_CFLAGS)
172 AC_SUBST(GTKMATHVIEW_LIBS)
173
174 AC_CONFIG_FILES([
175  Makefile 
176  src/Makefile
177  test/Makefile
178  editex-config
179 ])
180 AC_CONFIG_COMMANDS([default],[[chmod +x editex-config]],[[]])
181 AC_OUTPUT