X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fmathml_editor%2Fconfigure.ac;h=e1972fd90446f30d6d6074f14ae224287d020ce8;hb=97c2d258a5c524eb5c4b85208899d80751a2c82f;hp=0dca72c8cb5fec57e629218c746226b52332e5ec;hpb=89262281b6e83bd2321150f81f1a0583645eb0c8;p=helm.git diff --git a/helm/DEVEL/mathml_editor/configure.ac b/helm/DEVEL/mathml_editor/configure.ac index 0dca72c8c..e1972fd90 100644 --- a/helm/DEVEL/mathml_editor/configure.ac +++ b/helm/DEVEL/mathml_editor/configure.ac @@ -1,9 +1,13 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT -AC_CONFIG_SRCDIR([src/TToken.hh]) +AC_INIT(editex, [0.0.5]) +AC_CONFIG_SRCDIR(src/TToken.hh) +AM_INIT_AUTOMAKE($AC_PACKAGE_NAME, $AC_PACKAGE_VERSION) + +PACKAGE=$PACKAGE_NAME +VERSION=$PACKAGE_VERSION +AC_SUBST(PACKAGE) +AC_SUBST(VERSION) -PACKAGE=editex -VERSION=0.0.1 EDITEX_VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'` AC_SUBST(EDITEX_VERSION_INFO) @@ -31,34 +35,35 @@ AC_ARG_WITH(gmetadom-prefix, GMETADOM_PREFIX=$withval ) -AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +dnl AC_CONFIG_HEADERS([config.h]) AM_CONFIG_HEADER(config.h) AH_TOP([ -/* Copyright (C) 2002, Luca Padovani . - * - * This file is part of EdiTeX, an editor of mathematical - * expressions based on TeX syntax +/* This file is part of EdiTeX, an editor of mathematical + * expressions based on TeX syntax. * - * EdiTeX is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * Copyright (C) 2002-2004 Luca Padovani , + * 2003 Paolo Marinelli . * - * EdiTeX is distributed in the hope that it will be useful, + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with EdiTeX; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * For details, see the EdiTeX World-Wide-Web page, - * http://helm.cs.unibo.it/editex, or send a mail to - * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * For more information, please visit the project's home page + * http://helm.cs.unibo.it/editex/ + * or send an email to */ + #ifndef config_h #define config_h ]) @@ -72,110 +77,111 @@ AC_PROG_CXX AC_PROG_INSTALL AC_HEADER_STDC([]) +AC_LANG_PUSH(C++) +AC_CHECK_HEADERS(hash_map) +AC_CHECK_HEADERS(ext/hash_map) +AC_LANG_POP(C++) + AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) AM_PROG_LIBTOOL -GMETADOM_CONFIG="gmetadom-config" -GMETADOM_MIN_VERSION=0.1.0 -AC_MSG_CHECKING([for GMetaDOM C++ library] >= $GMETADOM_MIN_VERSION) -if test "x$GMETADOM_PREFIX" != "x" -then - if ${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG --version > /dev/null 2>&1 - then - GMETADOM_CONFIG=${GMETADOM_PREFIX}/bin/$GMETADOM_CONFIG - elif ! $GMETADOM_CONFIG --version > /dev/null 2>&1 - then - AC_MSG_ERROR([Could not find gmetadom anywhere (see config.log for details).]) - fi -fi - -dnl -dnl test version and init our variables -dnl -vers=`$GMETADOM_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` -minvers=`echo $GMETADOM_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` -if test "$vers" -ge "$minvers" -then - GMETADOM_LIBS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --libs`" - GMETADOM_CFLAGS="`$GMETADOM_CONFIG --module=gdome_cpp_smart --cflags`" - AC_MSG_RESULT(found) -else - AC_MSG_ERROR([You need at least GMetaDOM (C++) $GMETADOM_MIN_VERSION for this version of $PACKAGE]) -fi +dnl PKG_CHECK_MODULES(GLIB2, glib-2.0) +dnl AC_SUBST(GLIB2_CFLAGS) +dnl AC_SUBST(GLIB2_LIBS) +PKG_CHECK_MODULES(GMETADOM,gdome2-cpp-smart) AC_SUBST(GMETADOM_CFLAGS) AC_SUBST(GMETADOM_LIBS) -GDOMEXSLT_CONFIG="gdome_xslt_cpp_smart-config" -GDOMEXSLT_MIN_VERSION=0.0.1 -AC_MSG_CHECKING([for gdome_xslt C++ library] >= $GDOMEXSLT_MIN_VERSION) -if test "x$GDOMEXSLT_PREFIX" != "x" -then - if ${GDOMEXSLT_PREFIX}/bin/$GDOMEXSLT_CONFIG --version > /dev/null 2>&1 - then - GDOMEXSLT_CONFIG=${GDOMEXSLT_PREFIX}/bin/$GDOMEXSLT_CONFIG - elif ! $GDOMEXSLT_CONFIG --version > /dev/null 2>&1 - then - AC_MSG_ERROR([Could not find gdome_xslt anywhere (see config.log for details).]) - fi +PKG_CHECK_MODULES(GDOMEXSLT,gdome2-xslt-cpp-smart) +AC_SUBST(GDOMEXSLT_CFLAGS) +AC_SUBST(GDOMEXSLT_LIBS) + +PKG_CHECK_MODULES(GTKMATHVIEW,gtkmathview-gmetadom) +AC_SUBST(GTKMATHVIEW_CFLAGS) +AC_SUBST(GTKMATHVIEW_LIBS) + +AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no) +if test $HAVE_OCAMLC = "no"; then + AC_MSG_ERROR([could not find ocamlc in PATH, please make sure ocaml is installed]) +else + OCAMLC=ocamlc + OCAMLSTDLIBDIR="`ocamlc -where`" + OCAMLSTUBDIR="`ocamlc -where`/stublibs" + AC_SUBST(OCAMLC) + AC_SUBST(OCAMLSTDLIBDIR) + AC_SUBST(OCAMLSTUBDIR) fi -dnl -dnl test version and init our variables -dnl -vers=`$GDOMEXSLT_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` -minvers=`echo $GDOMEXSLT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` -if test "$vers" -ge "$minvers" -then - GDOMEXSLT_LIBS="`$GDOMEXSLT_CONFIG --libs`" - GDOMEXSLT_CFLAGS="`$GDOMEXSLT_CONFIG --cflags`" - AC_MSG_RESULT(found) +AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no) +if test $HAVE_OCAMLOPT = "no"; then + AC_MSG_WARN([ocaml native libraries won't be compiled since ocamlopt was not found]) else - AC_MSG_ERROR([You need at least gdome_xslt (C++) $GDOMEXSLT_MIN_VERSION for this version of $PACKAGE]) + OCAMLOPT=ocamlopt + AC_SUBST(OCAMLOPT) fi +AM_CONDITIONAL(HAVE_OCAMLOPT_COND, test x$HAVE_OCAMLOPT = xyes) -AC_SUBST(GDOMEXSLT_CFLAGS) -AC_SUBST(GDOMEXSLT_LIBS) +AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no) +if test $HAVE_OCAMLFIND = "no"; then + AC_MSG_ERROR([could not find ocamlfind in PATH, please make sure findlib is installed]) +else + OCAMLFIND=ocamlfind + AC_SUBST(OCAMLFIND) +fi -GTKMATHVIEW_CONFIG="gtkmathview-config" -GTKMATHVIEW_MIN_VERSION=0.4.0 -AC_MSG_CHECKING([for gtkmathview library] >= $GTKMATHVIEW_MIN_VERSION) -if test "x$GTKMATHVIEW_PREFIX" != "x" -then - if ${GTKMATHVIEW_PREFIX}/bin/$GTKMATHVIEW_CONFIG --version > /dev/null 2>&1 - then - GTKMATHVIEW_CONFIG=${GTKMATHVIEW_PREFIX}/bin/$GTKMATHVIEW_CONFIG - elif ! $GTKMATHVIEW_CONFIG --version > /dev/null 2>&1 - then - AC_MSG_ERROR([Could not find gtkmathview anywhere (see config.log for details).]) - fi +AC_CHECK_PROG(HAVE_OCAMLDEP, ocamldep, yes, no) +if test $HAVE_OCAMLDEP = "yes"; then + OCAMLDEP=ocamldep + AC_SUBST(OCAMLDEP) fi -dnl -dnl test version and init our variables -dnl -vers=`$GTKMATHVIEW_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` -minvers=`echo $GTKMATHVIEW_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` -if test "$vers" -ge "$minvers" -then - GTKMATHVIEW_LIBS="`$GTKMATHVIEW_CONFIG --libs`" - GTKMATHVIEW_CFLAGS="`$GTKMATHVIEW_CONFIG --cflags`" - AC_MSG_RESULT(found) +AC_CHECK_PROG(HAVE_OCAMLMKLIB, ocamlmklib, yes, no) +if test $HAVE_OCAMLMKLIB = "no"; then + AC_MSG_ERROR([could not find ocamlmklib in PATH, please make sure ocamlmklib is installed]) else - AC_MSG_ERROR([You need at least gtkmathview $GTKMATHVIEW_MIN_VERSION for this version of $PACKAGE]) + OCAMLMKLIB=ocamlmklib + AC_SUBST(OCAMLMKLIB) fi +AM_CONDITIONAL(HAVE_SHAREDLIBS_COND, test x$enable_shared = xyes) -AC_SUBST(GTKMATHVIEW_CFLAGS) -AC_SUBST(GTKMATHVIEW_LIBS) +AC_MSG_CHECKING(for gdome2 ocaml binding) +ocamlfind query gdome2 || + AC_MSG_ERROR(gdome2 not installed (according to findlib)) +MLGDOME_CFLAGS="`$OCAMLFIND query -i-format gdome2`" +AC_SUBST(MLGDOME_CFLAGS) + +AC_MSG_CHECKING(for the ocaml library dir) +OCAML_LIB_DIR=`ocamlc -where` +AC_MSG_RESULT($OCAML_LIB_DIR) + +AC_CHECK_FILE(/usr/include/caml/mlvalues.h, + OCAML_INCLUDE_DIR=/usr/include/caml, + OCAML_INCLUDE_DIR=$OCAML_LIB_DIR/caml +) + +AC_SUBST(OCAML_INCLUDE_DIR) + +if test $profile = yes; then + CFLAFS="$CFLAGS -O0 -pg" + CXXFLAGS="$CXXFLAGS -O0 -pg" + AC_DEFINE(ENABLE_PROFILE,,[Define to 1 to let the widget collect some information for profiling purposes]) +fi AC_CONFIG_FILES([ Makefile src/Makefile + src/config.dirs test/Makefile - editex-config + textomml/Makefile + textomml/config.dirs + ocaml/Makefile + ocaml/META + editex.pc + xsl/Makefile + dict/Makefile ]) -AC_CONFIG_COMMANDS([default],[[chmod +x editex-config]],[[]]) AC_OUTPUT