From e2c42a9f79e86ee0d01ddb7ebb3ab4a13b202e19 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 30 Apr 2003 12:35:22 +0000 Subject: [PATCH] * m4/pypath.m4: New file. * Makefile.am (SUBDIRS): Add wrap. * wrap/Makefile.am: New file. * wrap/spot.i: New file. Preliminary bindings for Python. * configure.ac: Call adl_CHECK_PYTHON and output wrap/Makefile. --- .cvsignore | 3 ++ ChangeLog | 8 +++++ Makefile.am | 4 +-- configure.ac | 3 ++ doc/.cvsignore | 4 +++ m4/pypath.m4 | 6 ++++ src/ltlast/.cvsignore | 3 ++ src/ltlenv/.cvsignore | 3 ++ src/ltlparse/.cvsignore | 3 ++ src/ltltest/.cvsignore | 2 ++ src/ltlvisit/.cvsignore | 3 ++ tools/.cvsignore | 4 +++ wrap/.cvsignore | 9 ++++++ wrap/Makefile.am | 22 ++++++++++++++ wrap/spot.i | 66 +++++++++++++++++++++++++++++++++++++++++ 15 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 doc/.cvsignore create mode 100644 m4/pypath.m4 create mode 100644 wrap/.cvsignore create mode 100644 wrap/Makefile.am create mode 100644 wrap/spot.i diff --git a/.cvsignore b/.cvsignore index 72c96115e..f847db02b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -5,3 +5,6 @@ config.log config.status aclocal.m4 autom4te.cache +libtool +*.tar.gz +*.patch diff --git a/ChangeLog b/ChangeLog index bfe16b0d3..d9bdf0827 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-04-30 Alexandre DURET-LUTZ + + * m4/pypath.m4: New file. + * Makefile.am (SUBDIRS): Add wrap. + * wrap/Makefile.am: New file. + * wrap/spot.i: New file. Preliminary bindings for Python. + * configure.ac: Call adl_CHECK_PYTHON and output wrap/Makefile. + 2003-04-29 Alexandre DURET-LUTZ * configure.ac: Call AC_PROG_LIBTOOL. diff --git a/Makefile.am b/Makefile.am index 38448e108..d2ad118b7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS = doc src +SUBDIRS = doc src wrap ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = m4/gccwarn.m4 \ No newline at end of file +EXTRA_DIST = m4/gccwarn.m4 m4/pypath.m4 diff --git a/configure.ac b/configure.ac index 19586cbc2..d5b30e352 100644 --- a/configure.ac +++ b/configure.ac @@ -3,6 +3,8 @@ AC_INIT([spot], [0.1]) AC_CONFIG_AUX_DIR([tools]) AM_INIT_AUTOMAKE([foreign nostdinc 1.7.3]) +adl_CHECK_PYTHON + AC_PROG_CXX AM_PROG_LEX @@ -28,5 +30,6 @@ AC_CONFIG_FILES([ src/ltltest/defs src/ltlvisit/Makefile src/misc/Makefile + wrap/Makefile ]) AC_OUTPUT \ No newline at end of file diff --git a/doc/.cvsignore b/doc/.cvsignore new file mode 100644 index 000000000..1ff203ff5 --- /dev/null +++ b/doc/.cvsignore @@ -0,0 +1,4 @@ +Doxyfile +Makefile +Makefile.in +spot.html diff --git a/m4/pypath.m4 b/m4/pypath.m4 new file mode 100644 index 000000000..5af6736d8 --- /dev/null +++ b/m4/pypath.m4 @@ -0,0 +1,6 @@ +AC_DEFUN([adl_CHECK_PYTHON], + [AM_PATH_PYTHON([2.0]) + AC_CACHE_CHECK([for $am_display_PYTHON includes directory], + [adl_cv_python_inc], + [adl_cv_python_inc=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()" 2>/dev/null`]) + AC_SUBST([PYTHONINC], [$adl_cv_python_inc])]) diff --git a/src/ltlast/.cvsignore b/src/ltlast/.cvsignore index e99558847..6fe665a04 100644 --- a/src/ltlast/.cvsignore +++ b/src/ltlast/.cvsignore @@ -1,3 +1,6 @@ .deps Makefile Makefile.in +*.lo +*.la +.libs diff --git a/src/ltlenv/.cvsignore b/src/ltlenv/.cvsignore index 4908c148a..df884f89f 100644 --- a/src/ltlenv/.cvsignore +++ b/src/ltlenv/.cvsignore @@ -2,3 +2,6 @@ Makefile Makefile.in libltlenv.a +*.lo +*.la +.libs diff --git a/src/ltlparse/.cvsignore b/src/ltlparse/.cvsignore index 635dda921..3ac0ce0a5 100644 --- a/src/ltlparse/.cvsignore +++ b/src/ltlparse/.cvsignore @@ -9,3 +9,6 @@ ltlscan.cc position.hh readltl stack.hh +*.lo +*.la +.libs diff --git a/src/ltltest/.cvsignore b/src/ltltest/.cvsignore index 3ac19ee00..d72ca829b 100644 --- a/src/ltltest/.cvsignore +++ b/src/ltltest/.cvsignore @@ -12,3 +12,5 @@ lunabbrev tunabbrev nenoform tunenoform +.libs +tostring diff --git a/src/ltlvisit/.cvsignore b/src/ltlvisit/.cvsignore index e99558847..6fe665a04 100644 --- a/src/ltlvisit/.cvsignore +++ b/src/ltlvisit/.cvsignore @@ -1,3 +1,6 @@ .deps Makefile Makefile.in +*.lo +*.la +.libs diff --git a/tools/.cvsignore b/tools/.cvsignore index 81ac0ddb9..23a686078 100644 --- a/tools/.cvsignore +++ b/tools/.cvsignore @@ -2,3 +2,7 @@ depcomp install-sh missing mkinstalldirs +py-compile +config.guess +config.sub +ltmain.sh diff --git a/wrap/.cvsignore b/wrap/.cvsignore new file mode 100644 index 000000000..50dd12bdb --- /dev/null +++ b/wrap/.cvsignore @@ -0,0 +1,9 @@ +.deps +.libs +Makefile +Makefile.in +*.la +spot.py* +*.lo +*.loT +spot_wrap.cxx diff --git a/wrap/Makefile.am b/wrap/Makefile.am new file mode 100644 index 000000000..2d7902ec2 --- /dev/null +++ b/wrap/Makefile.am @@ -0,0 +1,22 @@ + +AM_CPPFLAGS = -I$(PYTHONINC) -I$(top_srcdir)/src + +python_PYTHON = spot.py +pyexec_LTLIBRARIES = _spot.la + +_spot_la_SOURCES = spot_wrap.cxx +_spot_la_LDFLAGS = -avoid-version -module +_spot_la_LIBADD = \ + ../src/ltlenv/libltlenv.la \ + ../src/ltlparse/libltlparse.la \ + ../src/ltlvisit/libltlvisit.la \ + ../src/ltlast/libltlast.la + +EXTRA_DIST = spot.i +spot_wrap.cxx: spot.i + swig -c++ -python -I$(top_srcdir)/src spot.i + +spot.py: spot.i + $(MAKE) $(AM_MAKEFLAGS) spot_wrap.cxx + +MAINTAINERCLEANFILES = spot_wrap.cxx spot.py diff --git a/wrap/spot.i b/wrap/spot.i new file mode 100644 index 000000000..364591501 --- /dev/null +++ b/wrap/spot.i @@ -0,0 +1,66 @@ +%module spot + +%include "std_string.i" +%include "std_list.i" + +%{ +#include "ltlenv/environment.hh" +#include "ltlenv/defaultenv.hh" +#include "ltlast/formula.hh" +#include "ltlparse/public.hh" +#include "ltlast/visitor.hh" + +#include "ltlvisit/clone.hh" +#include "ltlvisit/dotty.hh" +#include "ltlvisit/dump.hh" +#include "ltlvisit/equals.hh" +#include "ltlvisit/lunabbrev.hh" +#include "ltlvisit/tunabbrev.hh" +#include "ltlvisit/nenoform.hh" +#include "ltlvisit/tostring.hh" + +using namespace spot::ltl; +%} + +%include "ltlenv/environment.hh" +%include "ltlenv/defaultenv.hh" +%include "ltlast/formula.hh" +%include "ltlparse/public.hh" +%include "ltlast/visitor.hh" + +%include "ltlvisit/clone.hh" +%include "ltlvisit/dotty.hh" +%include "ltlvisit/dump.hh" +%include "ltlvisit/equals.hh" +%include "ltlvisit/lunabbrev.hh" +%include "ltlvisit/tunabbrev.hh" +%include "ltlvisit/nenoform.hh" +%include "ltlvisit/tostring.hh" + +%inline %{ + +spot::ltl::parse_error_list +empty_parse_error_list() +{ + parse_error_list l; + return l; +} + +std::ostream& +get_cout() +{ + return std::cout; +} + +std::ostream& +get_cerr() +{ + return std::cerr; +} + +void +print_on(std::ostream& on, const std::string& what) +{ + on << what; +} +%} -- GitLab