Commit f2865e91 authored by Michaël Cadilhac's avatar Michaël Cadilhac
Browse files

Force the use of XML in Vaucanson.

- build-aux/vcsn-xml.m4: Don't offer the possibility not to use XML.

- include/Makefile.am,
- include/vaucanson/misc/usual_macros.hh,
- include/vaucanson/algebra/implementation/series/rat/xml_exp_visitor.hh,
- include/vaucanson/algebra/implementation/series/rat/exp.hh,
- include/vaucanson/algebra/implementation/series/rat/exp.hxx,
- include/vaucanson/tools/xml_dump.hh,
- include/vaucanson/tools/out_display.hh,
- include/vaucanson/tools/dumper.hxx,
- include/vaucanson/tools/xml_display.hh,
- include/vaucanson/tools/dumper.hh,
- include/vaucanson/tools/xml_load.hh,
- include/vaucanson/xml/xml_chooser.hh,
- include/vaucanson/xml/session.hh,
- include/vaucanson/xml/node.hh,
- include/vaucanson/xml/error_handler.hh,
- include/vaucanson/xml/xml_converter.hh,
- include/vaucanson/xml/strings.hh,
- include/vaucanson/xml/ios.hh,
- include/vaucanson/xml/tools.hh,
- include/vaucanson/xml/XML.hh,
- include/vaucanson/xml/xerces_parser.hh,
- include/vaucanson/config/system.hh,
- include/vaucanson/config/pconf.hh.in,
- include/vaucanson/design_pattern/factory.hh,
- src/tests/xml/Makefile.am,
- src/tests/sanity/generate_files.sh,
- src/tests/Makefile.am,
- src/demos/function_library/Makefile.am,
- src/demos/demo.mk,
- src/demos/transducers/one_rule_rewriting/Makefile.am,
- src/demos/transducers/Makefile.am,
- build-aux/vcsn-taf-kit.m4,
- taf-kit/src/Makefile.am,
- doc/xml/Makefile.am,
- doc/Makefile.am: Remove every check on XML.

- build-aux/check_xml.sh: Remove.
- bootstrap.sh,
- build-aux/Makefile.am: Update accordingly.
parent c9f39dfa
2006-07-26 Michael Cadilhac <michael.cadilhac@lrde.epita.fr>
Force the use of XML in Vaucanson.
* build-aux/vcsn-xml.m4: Don't offer the possibility not to use XML.
* include/Makefile.am,
* include/vaucanson/misc/usual_macros.hh,
* include/vaucanson/algebra/implementation/series/rat/xml_exp_visitor.hh,
* include/vaucanson/algebra/implementation/series/rat/exp.hh,
* include/vaucanson/algebra/implementation/series/rat/exp.hxx,
* include/vaucanson/tools/xml_dump.hh,
* include/vaucanson/tools/out_display.hh,
* include/vaucanson/tools/dumper.hxx,
* include/vaucanson/tools/xml_display.hh,
* include/vaucanson/tools/dumper.hh,
* include/vaucanson/tools/xml_load.hh,
* include/vaucanson/xml/xml_chooser.hh,
* include/vaucanson/xml/session.hh,
* include/vaucanson/xml/node.hh,
* include/vaucanson/xml/error_handler.hh,
* include/vaucanson/xml/xml_converter.hh,
* include/vaucanson/xml/strings.hh,
* include/vaucanson/xml/ios.hh,
* include/vaucanson/xml/tools.hh,
* include/vaucanson/xml/XML.hh,
* include/vaucanson/xml/xerces_parser.hh,
* include/vaucanson/config/system.hh,
* include/vaucanson/config/pconf.hh.in,
* include/vaucanson/design_pattern/factory.hh,
* src/tests/xml/Makefile.am,
* src/tests/sanity/generate_files.sh,
* src/tests/Makefile.am,
* src/demos/function_library/Makefile.am,
* src/demos/demo.mk,
* src/demos/transducers/one_rule_rewriting/Makefile.am,
* src/demos/transducers/Makefile.am,
* build-aux/vcsn-taf-kit.m4,
* taf-kit/src/Makefile.am,
* doc/xml/Makefile.am,
* doc/Makefile.am: Remove every check on XML.
* build-aux/check_xml.sh: Remove.
* bootstrap.sh,
* build-aux/Makefile.am: Update accordingly.
2006-07-26 Akim Demaille <akim@epita.fr>
* configure.ac: Don't forget automata/tdc. While we're at
......
......@@ -44,8 +44,6 @@ do
fi
done
run . build-aux/check_xml.sh
run src/tests/test-suites ./generate-all.sh
run src/tests/sanity ./generate_files.sh .
run src/vaucanswig ./expand.sh .
......
......@@ -15,14 +15,11 @@
### Autoconf macros are installable and distributable.
###
### XML files should be distributed even if VCSN_USE_XML is not set.
m4datadir = $(datadir)/aclocal
dist_m4data_DATA = vcsn.m4 vcsn-xml.m4
EXTRA_DIST = \
check_xml.sh \
find_tests.sh \
fix-rights \
move-if-change
#! /bin/sh
set -e
use_xml_flags='VCSN_USE_XML\|XML_CHECK\|VCSN_INCLUDE_XML\|demo.mk'
exit_status=0
find . \
-type f \
-and \( -name \*.am -or -name \*.cc -or -name \*.hh -or -name \*.hxx \
-or -name \*.thh -or -name \*.thxx -or -name \*.hcc \
\) \
-and -exec grep -q -i xml '{}' \; \
-and -not -exec grep -q $use_xml_flags '{}' \; \
-print |
while read f;
do
# See if the corresponding header checks for XML.
header_check=false
if base=$(expr "$f" : '\(.*h\)\(.\)\2$') &&
grep -q $use_xml_flags "${base}h"; then
header_check=true
fi
# Or if the Makefile.am does.
makefile_check=false
makefile=$(dirname "$f")/Makefile.am
if test -f $makefile &&
grep -q $use_xml_flags "$makefile"; then
makefile_check=true
fi
if ! $header_check && ! $makefile_check; then
echo "Warning: $f uses XML I/O but does not test $use_xml_flags."
exit_status=1
fi
done
exit $exit_status
......@@ -47,17 +47,11 @@ AC_DEFUN([VCSN_TAF_KIT],
[enable_taf_kit=yes])
if test x$enable_taf_kit = xyes; then
if test x$enable_vcsn_xml = xno; then
AC_MSG_WARN([XML support should be enabled for TAF-Kit to be compiled,
it will not be built])
VCSN_CHECK_TERMLIB
if test -z "$TERMLIBS"; then
AC_MSG_WARN([need a terminal library (${TERMLIB_VARIANTS}), TAF-Kit
will not be built])
enable_taf_kit=no
else
VCSN_CHECK_TERMLIB
if test -z "$TERMLIBS"; then
AC_MSG_WARN([need a terminal library (${TERMLIB_VARIANTS}), TAF-Kit
will not be built])
enable_taf_kit=no
fi
fi
else
enable_taf_kit=no
......
......@@ -96,33 +96,11 @@ int main() {
# Xerces C++
AC_DEFUN([VCSN_XML],
[dnl
AC_ARG_ENABLE([xml],
[AC_HELP_STRING([--disable-xml],
[disable XML support in Vaucanson (needs Xerces-C++ >= 2.3)])],
[enable_vcsn_xml=$enableval],
[enable_vcsn_xml=yes])
AC_CACHE_CHECK([for Xerces-C++ in user-specified directory],
[with_xerces],
[AC_ARG_WITH([xerces],
[AC_HELP_STRING([--with-xerces=DIR],
[base directory where Xerces-C++ is installed])])])
AC_ARG_ENABLE([xml-tests],
[AC_HELP_STRING([--disable-xml-tests],
[disable tests of XML features])],
[],
[enable_xml_tests=yes])
if test x$enable_vcsn_xml = xyes; then
_VCSN_CHECK_XML
else
enable_xml_tests=no
fi
if test x$enable_vcsn_xml = xyes; then
AC_DEFINE([VCSN_USE_XML], 1, [Define to 1 if you want to use XML I/O.])
fi
AM_CONDITIONAL([VCSN_USE_XML], [test x$enable_vcsn_xml = xyes])
AM_CONDITIONAL([XML_CHECK], [test x$enable_xml_tests = xyes])
_VCSN_CHECK_XML
])
......@@ -11,7 +11,6 @@
##
## The Vaucanson Group consists of people listed in the `AUTHORS' file.
# VCSN_USE_XML is tested in the `xml' subdirectory.
include $(top_srcdir)/vaucanson.mk
include $(srcdir)/doc.mk
......
......@@ -11,10 +11,6 @@
##
## The Vaucanson Group consists of people listed in the `AUTHORS' file.
# This document should be compiled even if VCSN_USE_XML is not set.
# The token VCSN_USE_XML is spelled out to pacify build-aux/check_xml.sh.
include $(top_srcdir)/doc/doc.mk
manual = $(srcdir)/xml_proposal.pdf
......
......@@ -405,8 +405,6 @@ vaucanson/z_automaton.hh \
vaucanson/r_automaton.hh \
vaucanson/standard_algorithms.hh
# XMLSOURCES can be included even if VCSN_USE_XML is not set.
nobase_include_HEADERS += $(XMLSOURCES)
......
......@@ -17,13 +17,9 @@
#ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_EXP_HH
# define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_EXP_HH
#include <vaucanson/config/system.hh>
# if VCSN_INCLUDE_XML()
# include <xercesc/dom/DOM.hpp>
# include <xercesc/util/XMLString.hpp>
# include <xercesc/util/PlatformUtils.hpp>
# endif
# include <xercesc/dom/DOM.hpp>
# include <xercesc/util/XMLString.hpp>
# include <xercesc/util/PlatformUtils.hpp>
# include <vaucanson/algebra/implementation/series/rat/nodes.hh>
# include <vaucanson/design_pattern/element.hh>
......@@ -96,10 +92,8 @@ namespace vcsn {
/// i.e. the number of letters used in the expression.
size_t length() const;
# if VCSN_INCLUDE_XML()
xercesc::DOMElement* xml_tree(xercesc::DOMDocument* doc,
char* node_name) const;
# endif
/// Get the root node of the expression.
//@{
......
......@@ -128,7 +128,6 @@ namespace vcsn {
return v.get();
}
# if VCSN_INCLUDE_XML()
template<typename LetterT, typename WeightT>
xercesc::DOMElement* exp<LetterT, WeightT>::xml_tree(
xercesc::DOMDocument* doc, char* node_name) const
......@@ -137,7 +136,6 @@ namespace vcsn {
accept(v);
return v.get();
}
# endif
template<typename LetterT, typename WeightT>
typename exp<LetterT, WeightT>::node_t* &
......
......@@ -15,16 +15,9 @@
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
#include <vaucanson/config/system.hh>
#if not defined (VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_XML_EXP_VISITOR_HH) \
and VCSN_INCLUDE_XML()
#ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_XML_EXP_VISITOR_HH
# define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_XML_EXP_VISITOR_HH
# ifndef VCSN_USE_XML
# error Vaucanson XML support is disabled.
# endif
/**
* @file xml_exp_visitor.hh
*
......@@ -96,5 +89,4 @@ namespace vcsn {
# include <vaucanson/algebra/implementation/series/rat/xml_exp_visitor.hxx>
# endif // VCSN_USE_INTERFACE_ONLY
#endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_XML_EXP_VISITOR_HH &&
// VCSN_INCLUDE_XML()
#endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_XML_EXP_VISITOR_HH
......@@ -12,6 +12,3 @@
/* Define the path to data of this package. */
#undef VCSN_DATA_PATH
/* Define this if you want to use XML I/O */
#undef VCSN_USE_XML
......@@ -43,9 +43,6 @@
# include <vaucanson/config/math.hh>
# define VCSN_INCLUDE_XML() \
(not defined (VCSN_SANITY_CHECK) or defined (VCSN_USE_XML))
# if (defined __GNUC__) && (__GNUC__ < 3)
# include <stl_config.h>
# undef __STL_BEGIN_RELOPS_NAMESPACE
......
......@@ -27,7 +27,7 @@
* the proposed implementation by Alexandrescu, in his "Modern C++
* Design" book.
*
* @see xml::converter, xml::Node if VCSN_USE_XML
* @see xml::converter, xml::Node
*
* @author Louis-Nol Pouchet <Louis-Noel.Pouchet@lrde.epita.fr>
*
......
......@@ -134,16 +134,14 @@
((unsigned) int(((float) rand() / (float) RAND_MAX) * Max));
// Some useful macros for XML.
# ifdef VCSN_USE_XML
# ifndef VCSN_NDEBUG
# define XML_FAIL(S) \
# ifndef VCSN_NDEBUG
# define XML_FAIL(S) \
do { \
std::cerr << "Implement for " << typeid(S).name() << std::endl; \
exit(1); \
} while (0)
# else
# define XML_FAIL(S)
# endif
# else
# define XML_FAIL(S)
# endif
# define FAIL(S) { std::cerr << (S) << std::endl; exit(1); }
......
......@@ -31,10 +31,11 @@
* @author Raphaël Poss <Raphael.Poss@lrde.epita.fr>
*/
#if not defined (VCSN_TOOLS_DUMPER_HH) and not defined (VCSN_SANITY_CHECK)
#ifndef VCSN_TOOLS_DUMPER_HH
# define VCSN_TOOLS_DUMPER_HH
# ifndef VCSN_SANITY_CHECK
# include <string>
# include <string>
namespace vcsn
{
......@@ -76,8 +77,8 @@ namespace vcsn
}
}
# ifndef VCSN_USE_INTERFACE_ONLY
# include <vaucanson/tools/dumper.hxx>
# endif // ! VCSN_USE_INTERFACE_ONLY
# ifndef VCSN_USE_INTERFACE_ONLY
# include <vaucanson/tools/dumper.hxx>
# endif // ! VCSN_USE_INTERFACE_ONLY
# endif // ! VCSN_SANITY_CHECK
#endif // ! VCSN_TOOLS_DUMPER_HH && ! VCSN_SANITY_CHECK
......@@ -18,9 +18,7 @@
# define VCSN_TOOLS_DUMPER_HXX
# include <vaucanson/tools/usual_io.hh>
# ifdef VCSN_USE_XML
# include <vaucanson/tools/xml_dump.hh>
# endif
# include <vaucanson/tools/xml_dump.hh>
# include <vaucanson/tools/dot_dump.hh>
# include <vaucanson/tools/fsm_dump.hh>
# include <vaucanson/tools/simple_dump.hh>
......@@ -58,11 +56,7 @@ namespace vcsn
if (pos < argc_)
fmt_ = dump_format (argv_[pos]);
if (fmt_ == fmt_error
#ifndef VCSN_USE_XML
|| fmt_ == fmt_xml
#endif
)
if (fmt_ == fmt_error)
{
std::cerr << "Invalid input: " << pos << " " << argv_[pos] << std::endl;
usage (1);
......@@ -77,10 +71,7 @@ namespace vcsn
<< " dot : graphviz format" << std::endl
<< " fsm : FSM toolbox format" << std::endl
<< " simple : internal Vaucanson format" << std::endl
#ifdef VCSN_USE_XML
<< " xml : Vaucanson XML I/O format" << std::endl
#endif
;
<< " xml : Vaucanson XML I/O format" << std::endl;
exit (estatus);
}
......@@ -124,11 +115,9 @@ namespace vcsn
case fmt_dot:
vcsn::tools::dot_dump (o, automaton, name);
break;
#ifdef VCSN_USE_XML
case fmt_xml:
vcsn::tools::xml_dump (o, automaton, name);
break;
#endif
case fmt_simple:
vcsn::tools::simple_dump (o, automaton,
vcsn::io::usual_converter_poly<rat_exp_t>());
......
......@@ -20,8 +20,7 @@
/**
* @file out_display.hh
*
* Out display method, useful for xml_display (if VCSN_USE_XML)
* and dot_display.
* Out display method, useful for xml_display and dot_display.
*
* @author Florent Terrones <florent.terrones@lrde.epita.fr>
*/
......
......@@ -15,15 +15,9 @@
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
#include <vaucanson/config/system.hh>
#if not defined (VCSN_TOOLS_XML_DISPLAY_HH) and VCSN_INCLUDE_XML()
#ifndef VCSN_TOOLS_XML_DISPLAY_HH
# define VCSN_TOOLS_XML_DISPLAY_HH
# ifndef VCSN_USE_XML
# error Vaucanson XML support is disabled.
# endif
/**
* @file xml_display.hh
*
......@@ -55,4 +49,4 @@ namespace vcsn
# include <vaucanson/tools/xml_display.hxx>
# endif // VCSN_USE_INTERFACE_ONLY
#endif // ! VCSN_TOOLS_XML_DISPLAY_HH && VCSN_INCLUDE_XML()
#endif // ! VCSN_TOOLS_XML_DISPLAY_HH
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment