Commit 09fc0560 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Merge branch 'exp/remove-swig' into next

parents 9563f878 ae7d4c52
2009-03-23 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Remove Vaucanswig.
* vaucanswig/: Delete.
* Makefile.am (SUBDIRS): Adjust.
* build-aux/vcsn-internal.m4: Delete.
* build-aux/Makefile.am (EXTRA_DIST): Adjust.
* configure.ac: Remove Python and Swig checks.
* vaucanson.spec, debian/rules: Remove --disable-vaucanswig and
--disable-build-demos.
* bootstrap: Do not call vaucanswig/expand.sh.
2009-06-05 Alexandre Duret-Lutz <adl@lrde.epita.fr>
 
BOOST_CPPFLAGS were ignored while compiling lib/.
......
......@@ -16,16 +16,13 @@ include $(top_srcdir)/vaucanson.mk
if ENABLE_TAF_KIT
MAYBE_TAF_KIT = taf-kit
endif
if ENABLE_VAUCANSWIG
MAYBE_VAUCANSWIG = vaucanswig
endif
SUBDIRS = gnulib lib include src data $(MAYBE_TAF_KIT) $(MAYBE_VAUCANSWIG) \
SUBDIRS = gnulib lib include src data $(MAYBE_TAF_KIT) \
tools doc build-aux debian
EXTRA_DIST = vaucanson.spec ChangeLog.1 ChangeLog.2 README NEWS m4/gnulib-cache.m4
DISTCHECK_CONFIGURE_FLAGS = --enable-demos --enable-bench --enable-vaucanswig \
DISTCHECK_CONFIGURE_FLAGS = --enable-demos --enable-bench \
$(MORE_DISTCHECK_CONFIGURE_FLAGS)
# Prevent accidental edition of generated files.
......
......@@ -61,7 +61,6 @@ do
done
run src/tests/test-suites ./generate-all.sh
run vaucanswig ./expand.sh .
run src/bench ./generate_bench.sh --all
run . build-aux/find_tests.sh
run include ./generate_headers.sh
......
## Vaucanson, a generic library for finite state machines.
## Copyright (C) 2006, 2008 The Vaucanson Group.
## Copyright (C) 2006, 2008, 2009 The Vaucanson Group.
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
......@@ -19,7 +19,6 @@ m4datadir = $(datadir)/aclocal
dist_m4data_DATA = vcsn.m4 vcsn-xml.m4 ax_boost_base.m4
EXTRA_DIST = \
vcsn-internal.m4 \
find_tests.sh \
fix-rights \
move-if-change \
......
# vcsn.m4 -*- Autoconf -*-
#
# Vaucanson, a generic library for finite state machines.
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The Vaucanson Group.
#
# This program 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.
#
# The complete GNU General Public Licence Notice can be found as the
# `COPYING' file in the root directory.
#
# The Vaucanson Group consists of people listed in the `AUTHORS' file.
AC_PREREQ([2.60])
m4_pattern_forbid([^_?VCSN_])
# AC_CHECK_SWIG13
# ---------------
# Check for SWIG
AC_DEFUN([AC_CHECK_SWIG13],
[dnl
AC_ARG_VAR([SWIG], [the SWIG interface generator])
AC_CHECK_PROGS([SWIG], [swig], [$am_aux_dir/missing swig])
AC_CACHE_CHECK([for SWIG >= 1.3],
[ac_cv_recent_swig],
[ac_cv_recent_swig=no
swig_ver=`$SWIG -version 2>&1 | sed -n -e '/SWIG Version/{s/^.*Version \(.*\)/\1/g;p;q;}'`
swig_minor=`echo "$swig_ver" | sed -e 's/^@<:@0-9@:>@*\.\(@<:@^.@:>@*\).*/\1/g'`
swig_major=`echo "$swig_ver" | sed -e 's/^\(@<:@0-9@:>@*\)\..*/\1/g'`
if test `expr $swig_major \* 100 + $swig_minor 2>/dev/null` -ge 103 >/dev/null 2>&1; then
ac_cv_recent_swig=yes
fi])
])
......@@ -62,51 +62,6 @@ AC_ARG_ENABLE([bench],
[build benchmarks during "make all"])])
AM_CONDITIONAL([ENABLE_BENCH], [test "x$enable_bench" = "xyes"])
## ------------ ##
## Vaucanswig. ##
## ------------ ##
# SWIG and Python used.
AC_ARG_ENABLE([vaucanswig],
[AC_HELP_STRING([--enable-vaucanswig],
[enable building vaucanswig])])
AC_ARG_WITH([python],
[AC_HELP_STRING([--with-python@<:@=DIR@:>@],
[set python prefix (default is PREFIX)])],
[ac_python_path="$withval"],[])
AC_SUBST([MORE_DISTCHECK_CONFIGURE_FLAGS])
if test "${with_python+set}" = set; then
MORE_DISTCHECK_CONFIGURE_FLAGS="$MORE_DISTCHECK_CONFIGURE_FLAGS --with-python=$with_python"
fi
# Always check for swig: it is needed by `make dist' (that will recurse
# vaucanswig) in case the *.py files do not exist already. E.g., after
# a fresh checkout.
AC_CHECK_SWIG13
# We distribute the product of swig, so do not error out (just warn)
# if swig is too old : it might not be needed.
if test "x$ac_cv_recent_swig" != xyes; then
AC_MSG_WARN([You need swig >= 1.3 to compile vaucanswig from a fresh checkout.])
fi
if test "x$enable_vaucanswig" = xyes; then
VCSN_CHECK_PYTHON
fi
AC_CONFIG_FILES([vaucanswig/Makefile
vaucanswig/meta/Makefile
vaucanswig/src/Makefile
vaucanswig/python/Makefile])
AM_CONDITIONAL([ENABLE_VAUCANSWIG],
[test "x$enable_vaucanswig" = "xyes"])
# Boost
AX_BOOST_BASE([1.34])
# Do not require boost::serialization headers.
......@@ -114,6 +69,7 @@ BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION"
# FIXME: It would be nice to check that the Boost package we require
# (boost::graph, boost::multi_index...)
AC_SUBST([MORE_DISTCHECK_CONFIGURE_FLAGS])
if test "${with_boost+set}" = set; then
MORE_DISTCHECK_CONFIGURE_FLAGS="$MORE_DISTCHECK_CONFIGURE_FLAGS --with-boost=$with_boost"
fi
......
......@@ -21,8 +21,6 @@ config.status: configure
./configure \
--host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) \
--disable-vaucanswig \
--disable-build-demo \
--prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info
......@@ -38,14 +36,14 @@ build-stamp: config.status
clean:
dh_testdir
dh_testroot
rm -f build-stamp
rm -f build-stamp
-$(MAKE) distclean
dh_clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_clean -k
dh_installdirs
$(MAKE) install DESTDIR=$(CURDIR)/debian
......@@ -71,4 +69,4 @@ binary-arch: build install
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
.PHONY: build clean binary-indep binary-arch binary install
......@@ -9,7 +9,7 @@ Group: Development/Tools
Source: %{name}-%{version}.tar.gz
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildArch: noarch
# Requires:
# Requires:
%description
The goal of this library is to enable the development of C++ programs
......@@ -28,10 +28,7 @@ totally stable and well tested.
%setup -n %{name}-%{version}*
%build
./configure \
--prefix=/usr \
--disable-vaucanswig \
--disable-build-demo
./configure --prefix=/usr
make
%install
......@@ -54,5 +51,5 @@ rm -rf $RPM_BUILD_ROOT
- Change to noarch
- Add docs and examples
* Mon Jul 4 2005 Olivier Gournet <victor@lrde.epita.fr>
* Mon Jul 4 2005 Olivier Gournet <victor@lrde.epita.fr>
- RPM integration.
2007-10-13 Guillaume Lazzara <z@lrde.epita.fr>
Fix vaucanswig Makefile.am
There was a mistyped variable name.
* vaucanswig/Makefile.am: here.
2007-07-29 Guillaume Lazzara <z@lrde.epita.fr>
Fix Python include path
* expand.sh: Use the PYTHON_PREFIX variable.
2003-07-19 Raphal Poss <raph@lrde.epita.fr>
* meta/vaucanswig_automaton.i: Add missing virtual method
declarations, so that SWIG does not think `gen_auto_t' is pure
abstract.
2003-07-14 Raphal Poss <raph@lrde.epita.fr>
* README: Mention I/O methods.
2003-07-14 Raphal Poss <raph@lrde.epita.fr>
* meta/vaucanswig_context.i: Dot not include `dot_dump.hh'.
* meta/vauto.hh: Fix includes. Update I/O method prototypes.
* meta/automaton.hh: Update accordingly. Add new I/O.
* meta/automaton.hh (MAKE_VAUTO_TYPES): Mention converter.
* meta/vaucanswig_automaton.i: Update declarations. Add new I/O.
* meta/vaucanswig_core.i: Reorder to recognise std::string.
* meta/vauto.cc: Add new I/O.
2003-07-13 Raphal Poss <raph@lrde.epita.fr>
* meta/vaucanswig_context.i: Update for new I/O.
* meta/automaton.hh: Likewise.
* meta/vaucanswig_automaton.i: Likewise.
* expand.sh (ALGDB): Use conditional.
2003-07-11 Raphal Poss <raph@lrde.epita.fr>
* meta/vaucanswig_context.i: Workaround.
2003-07-10 Raphal Poss <raph@lrde.epita.fr>
* meta/vaucanswig_context.i: Add more conversions.
* expand.sh (AM_CXXFLAGS): Use debug flags.
2003-07-10 Raphal Poss <raph@lrde.epita.fr>
* expand.sh (AM_CXXFLAGS): New.
2003-07-09 Raphal Poss <raph@lrde.epita.fr>
* meta/Makefile.am (EXTRA_DIST): Mention `automaton.hh'.
2003-07-08 Raphal Poss <raph@lrde.epita.fr>
* meta/vaucanswig_core.i: Handle list<string>.
2003-07-08 Raphal Poss <raph@lrde.epita.fr>
* meta/vauto.hh: Add new method `add_states'.
* meta/vaucanswig_automaton.i: Update accordingly.
* meta/vauto.cc: Update accordingly.
2003-07-08 Raphal Poss <raph@lrde.epita.fr>
* meta/context.hh,
meta/vcontext.hh,
meta/vauto.hh,
meta/automaton.hh,
meta/vauto.cc,
meta/vcontext.cc: Update prefix headers.
2003-07-08 Raphal Poss <raph@lrde.epita.fr>
* meta/context.hh (virtual_context): Call parent constructors.
* meta/automaton.hh (virtual_automaton): Add missing `return'
statements.
2003-07-07 Raphal Poss <raph@lrde.epita.fr>
* README: Add.
2003-07-07 Raphal Poss <raph@lrde.epita.fr>
* meta/algo_common.i: Add.
* meta/vaucanswig_exception.i: Add missing include.
* meta/vaucanswig_context.i: Add missing method to `exp'.
* meta/context.hh: Add missing constructor to `virtual_context'.
* meta/vauto.hh: Add missing includes.
* meta/vauto.cc: Likewise.
* meta/automaton.hh: Add new constructor. Fix existing one. Add
missing methods.
* meta/vaucanswig_automaton.i: Add missing declarations.
* meta/vaucanswig_core.i: Remove redundant include of `unique.hcc'.
* meta/Makefile.am: Update.
* expand.sh: Fix link to `libvv.a'. Use libtool. Rewrite to
support algorithms.
2003-07-07 Raphal Poss <raph@lrde.epita.fr>
* meta/vaucanswig_exception.i: Remove superfluous declaration of
`std::exception'.
* meta/vaucanswig_core.i, meta/vaucanswig_automaton.i,
meta/automaton.hh, meta/vauto.hh, meta/vauto.cc, meta/vcontext.cc,
meta/vcontext.hh: Add.
* meta/Makefile.am: Update accordingly. Make `libvv' a target.
* meta/context.hh: Update for inheritance from `virtual_context'.
* meta/vaucanswig_context.i: Update accordingly. Import `vaucanswig_core'.
* expand.sh: Update.
2003-07-07 Raphal Poss <raph@lrde.epita.fr>
* Makefile.am: Add.
* expand.sh, meta/context.hh, meta/vaucanswig_context.i,
meta/vaucanswig_exception.i, meta/vaucanswig_describe: Add.
## Vaucanson, a generic library for finite state machines.
## Copyright (C) 2004, 2005, 2006 The Vaucanson Group.
##
## This program 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.
##
## The complete GNU General Public Licence Notice can be found as the
## `COPYING' file in the root directory.
##
## The Vaucanson Group consists of people listed in the `AUTHORS' file.
SUBDIRS = meta src python
EXTRA_DIST = expand.sh
#! /bin/sh
set -e
[ -d "$1" -a -f "$1/expand.sh" -a -f "$1/ChangeLog" ] || \
{ echo "usage: $0 <vaucanswig srcdir>" >&2; exit 1; }
VAUCANSWIG=`cd $1 && pwd`
VAUC=$VAUCANSWIG/../include
mkdir -p "$VAUCANSWIG/src"
mkdir -p "$VAUCANSWIG/python"
MODULES="core $MODULES"
ALGS=""
#### ALGORITHM DATABASE RETRIEVAL ####
ALGDB=$VAUCANSWIG/src/vaucanswig_algorithms.i
dbapp() {
echo "$@" >>"$ALGDB"
}
start_algorithms() {
# General database header
echo "%include vaucanswig_algo_common.i" >"$ALGDB"
dbapp "%define decl_algorithms(Kind)"
dbapp "%include vaucanswig_exception.i"
dbapp "algo_common_decls(Kind)"
}
end_algorithms() {
dbapp "%inline %{"
dbapp "struct empty {};"
dbapp "struct Kind :"
for af in $ALGS; do
dbapp "Kind ##_$af,"
done
dbapp " empty {};"
dbapp "%}"
dbapp "%enddef"
}
# afapp FAMILY-NAME LINES...
afapp() {
AF=$1
AFDB=$VAUCANSWIG/src/vaucanswig_alg_$AF.i
shift
for i
do
echo "$i" >>"$AFDB"
done
}
start_family() {
AF=$1
AFDB=$VAUCANSWIG/src/vaucanswig_alg_$AF.i
echo >"$AFDB"
afapp "$AF" "%include vaucanswig_algo_common.i"
afapp "$AF" "%{"
afapp "$AF" "#include <vaucanson/algorithms/$AF.hh>"
afapp "$AF" "%}"
}
do_family_interface_impl() {
AF=$1
AFDB=$VAUCANSWIG/src/vaucanswig_alg_$AF.i
afapp "$AF" "%define alg_${AF}_interface_impl(Automaton, GenAutomaton, Series, Exp, HList, Word, Letter)"
cat "$VAUC/vaucanson/algorithms/$AF.hh" \
| sed -n -e '/^ *\/\/ INTERFACE:/{s,^ *// INTERFACE:,static ,g;p;}' \
| sed -e 's/ExpImpl/Exp/' \
>>"$AFDB"
afapp "$AF" "%enddef"
}
do_family_interface() {
AF=$1
AFDB=$VAUCANSWIG/src/vaucanswig_alg_$AF.i
afapp "$AF" "%define alg_${AF}_interface(Automaton, GenAutomaton, Series, Exp, HList, Word, Letter)"
cat "$VAUC/vaucanson/algorithms/$AF.hh" \
| sed -n -e '/^ *\/\/ INTERFACE:/{s,^ *// INTERFACE: \([^{]*\).*$,static \1;,g;p;}' \
| sed -e 's/ExpImpl/Exp/' \
>>"$AFDB"
afapp "$AF" "%enddef"
}
# output FAMILY-NAME
# ------------------
output ()
{
family_name=$1
# Create a sub-database with its header
start_family "$family_name"
do_family_interface "$family_name"
do_family_interface_impl "$family_name"
afapp "$family_name" \
"%define alg_interface_${family_name}(Kind)" \
"%{" \
"struct Kind ##_alg_${family_name} {" \
"alg_${family_name}_interface(Kind ##_types::Kind ##_auto_t, \\" \
" Kind ##_types::gen_## Kind ##_auto_t, \\" \
" Kind ##_types::Kind ##_series_set_elt_t, \\" \
" Kind ##_types::Kind ##_exp_t, \\" \
" std::list<int>, \\" \
" std::basic_string<Kind ##_types::Kind ##_letter_t>, \\" \
" Kind ##_types::Kind ##_letter_t)" \
"};" \
"%}" \
"%enddef" \
"%define decl_alg_${family_name}(Kind)" \
"algo_common_decls(Kind)" \
"%{" \
"struct Kind ##_alg_${family_name} {" \
"alg_${family_name}_interface_impl(Kind ##_types::Kind ##_auto_t, \\" \
" Kind ##_types::gen_## Kind ##_auto_t, \\" \
" Kind ##_types::Kind ##_series_set_elt_t, \\" \
" Kind ##_types::Kind ##_exp_t, \\" \
" std::list<int>, \\" \
" std::basic_string<Kind ##_types::Kind ##_letter_t>, \\" \
" Kind ##_types::Kind ##_letter_t)" \
"};" \
"%}" \
"struct Kind ##_alg_${family_name} {" \
"alg_${family_name}_interface(Kind ##_types::Kind ##_auto_t, \\" \
" Kind ##_types::gen_## Kind ##_auto_t, \\" \
" Kind ##_types::Kind ##_series_set_elt_t, \\" \
" Kind ##_types::Kind ##_exp_t," \
" std::list<int>," \
" std::basic_string<Kind ##_types::Kind ##_letter_t>, \\" \
" Kind ##_types::Kind ##_letter_t)" \
"};" \
"%enddef"
# Mention the sub-database in the general database
dbapp "%import vaucanswig_## Kind ##_alg_${family_name}.i"
dbapp "%include vaucanswig_alg_${family_name}.i"
dbapp "alg_interface_${family_name}(Kind)"
}
start_algorithms
if [ "$3" != "noalg" ]; then
# Loop over all algorithm families
for family_header in `cd "$VAUC" && find vaucanson/algorithms -name \*.hh | sort`; do
# Test whether the file declares some interfaces
if grep "^ *// INTERFACE:" <"$VAUC/$family_header" >/dev/null 2>&1; then
candidate_family=$(basename "$family_header" .hh)
echo "Got interface for $candidate_family"
# As for now, the bindings can only be generated for automata
# (not transducers), so we prevent building transducers only
# algorithms with a well defined interface metadata.
# Moreover, the only bindings generated are for simple letters,
# so we disable aut_projection and pair_to_fmp.
if [ "$candidate_family" = "invert" ] || \
[ "$candidate_family" = "domain" ] || \
[ "$candidate_family" = "reduce" ] || \
[ "$candidate_family" = "image" ] || \
[ "$candidate_family" = "ltl_to_pair" ] || \
[ "$candidate_family" = "is_ltl" ] || \
[ "$candidate_family" = "projection" ] || \
[ "$candidate_family" = "aut_projection" ] || \
[ "$candidate_family" = "pair_to_fmp" ] || \
[ "$candidate_family" = "evaluation_fmp" ] || \
[ "$candidate_family" = "normalized_composition" ] || \
[ "$candidate_family" = "rw_composition" ] || \
[ "$candidate_family" = "sub_normalize" ] || \
[ "$candidate_family" = "composition_cover" ]; then
echo "Ignoring $candidate_family"
else
# Yes, retrieve the algorithm family name.
output $candidate_family
# Add the sub-database to the algorithm category
ALGS="$ALGS alg_${family_name}"
fi
fi
done
fi
end_algorithms
#### #####
if [ "x$2" = "xshort" ]; then
kinds="boolean_automaton"
else
kinds="boolean_automaton z_automaton z_max_plus_automaton z_min_plus_automaton"
fi
for cat in $kinds; do
for mod in context $ALGS algorithms; do
cat >"$VAUCANSWIG/src/vaucanswig_${cat}_${mod}.i" <<EOF
%include vaucanswig_${mod}.i
%module vaucanswig_${cat}_${mod}
decl_${mod}(${cat})
EOF
MODULES="$MODULES ${cat}_${mod}"
done
cat >"$VAUCANSWIG/src/vaucanswig_${cat}.i" <<EOF
%include vaucanswig_automaton.i
%module vaucanswig_${cat}
decl_automaton(${cat})
EOF
MODULES="$MODULES ${cat}"
echo "${cat}_context" >"$VAUCANSWIG/src/${cat}.deps"
echo >"$VAUCANSWIG/src/${cat}_algorithms.deps"
for alg in $ALGS; do
echo "${cat}" >"$VAUCANSWIG/src/${cat}_${alg}.deps"
echo "${cat}_${alg}" >>"$VAUCANSWIG/src/${cat}_algorithms.deps"
done
done
#################### Python stuff #######################
PYMODS=''
PYTHON=''
header_python()
{
cat <<EOF
## Process this file through Automake to produce Makefile.in -*- Makefile -*-
##
## Makefile.am for vaucanswig/python
## NOTE: this file was generated automatically by expand.sh
##
INCLUDES = -I\$(PYTHON_INCLUDEDIR) -I\$(srcdir)/../src -I\$(srcdir)/../meta \\
-I\$(top_srcdir)/include -I\$(top_builddir)/include
AM_CPPFLAGS = \$(BOOST_CPPFLAGS) -DINTERNAL_CHECKS -DSTRICT -DVCSN_DEFAULT_GRAPH_IMPL=listg
AM_CXXFLAGS = \$(CXXFLAGS_DEBUG)
AM_LDFLAGS = -avoid-version
EOF
}
# canonical NAME
# Return an Automake canonical name, i.e., non-alphanumerical -> _.
canonical ()
{
echo "$@" | sed 's/[^a-zA-Z0-9]/_/g'
}
dump_python()
{
printf "pyexec_LTLIBRARIES ="
ilist=0
for mod in $MODULES; do
if [ `expr $ilist % 4` = 0 ]; then
echo " \\"; printf "\t"
fi
printf " libvs_$mod.la"
ilist=`expr $ilist + 1`
done
echo; echo
printf "python_PYTHON ="
ilist=0
for mod in $MODULES; do
if [ `expr $ilist % 4` = 0 ]; then
echo " \\"; printf "\t"
fi
printf " vaucanswig_$(canonical $mod).py"
ilist=`expr $ilist + 1`
done
echo; echo
for mod in $MODULES; do
echo "libvs_$(canonical $mod)_la_SOURCES = vaucanswig_$(canonical $mod)_wrap.cxx"
if [ "$mod" = "core" ]; then
echo "libvs_core_la_LIBADD = ../meta/libvv.la"
else