[PATCH 06/10] Expose the Milena wrappers to SWIG.

* swig/mln.i: New. * swig/Makefile.am (EXTRA_DIST): Add mln.i. * swig/python/Makefile.am (AM_LIBADD): Remove variable. (libdyn_la, libdynmilena_la): New variables. (_dyn_la_LIBADD): s/AM_LIBADD/libdyn_la/. (pyexec_LTLIBRARIES): Add _mln.la. (nodist__mln_la_SOURCES, _mln_la_LIBADD): New variables. (CLEANFILES): Add $(nodist__mln_la_SOURCES), mln.py and mln.py[co]. (nodist_python_PYTHON): Add mln.py. --- dynamic-use-of-static-c++/ChangeLog | 15 ++++++++ dynamic-use-of-static-c++/swig/Makefile.am | 2 +- dynamic-use-of-static-c++/swig/mln.i | 39 +++++++++++++++++++++ dynamic-use-of-static-c++/swig/python/Makefile.am | 22 +++++++++-- 4 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 dynamic-use-of-static-c++/swig/mln.i diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog index a483c8d..6921732 100644 --- a/dynamic-use-of-static-c++/ChangeLog +++ b/dynamic-use-of-static-c++/ChangeLog @@ -1,5 +1,20 @@ 2009-11-02 Roland Levillain <roland@lrde.epita.fr> + Expose the Milena wrappers to SWIG. + + * swig/mln.i: New. + * swig/Makefile.am (EXTRA_DIST): Add mln.i. + * swig/python/Makefile.am (AM_LIBADD): Remove variable. + (libdyn_la, libdynmilena_la): New variables. + (_dyn_la_LIBADD): s/AM_LIBADD/libdyn_la/. + (pyexec_LTLIBRARIES): Add _mln.la. + (nodist__mln_la_SOURCES, _mln_la_LIBADD): New variables. + (CLEANFILES): Add $(nodist__mln_la_SOURCES), mln.py and + mln.py[co]. + (nodist_python_PYTHON): Add mln.py. + +2009-11-02 Roland Levillain <roland@lrde.epita.fr> + Exercise Milena precompiled wrappers. * test/wrappers/test-milena.cc: New. diff --git a/dynamic-use-of-static-c++/swig/Makefile.am b/dynamic-use-of-static-c++/swig/Makefile.am index 2d894af..8743680 100644 --- a/dynamic-use-of-static-c++/swig/Makefile.am +++ b/dynamic-use-of-static-c++/swig/Makefile.am @@ -16,6 +16,6 @@ SUBDIRS = python -EXTRA_DIST = dyn.i +EXTRA_DIST = dyn.i mln.i check_SCRIPTS = run diff --git a/dynamic-use-of-static-c++/swig/mln.i b/dynamic-use-of-static-c++/swig/mln.i new file mode 100644 index 0000000..e5598ab --- /dev/null +++ b/dynamic-use-of-static-c++/swig/mln.i @@ -0,0 +1,39 @@ +// -*- C++ -*- +// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// +// This file is part of Olena. +// +// Olena 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, version 2 of the License. +// +// Olena 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. +// +// You should have received a copy of the GNU General Public License +// along with Olena. If not, see <http://www.gnu.org/licenses/>. +// +// As a special exception, you may use this file as part of a free +// software project without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to produce +// an executable, this file does not by itself cause the resulting +// executable to be covered by the GNU General Public License. This +// exception does not however invalidate any other reasons why the +// executable file might be covered by the GNU General Public License. + +/// \file +/// \brief A wrapper of libdynmilena. + +%module mln + +%import dyn.i + +%{ +#include "dyn-all.hh" +#include "wrappers/milena.hh" +%} + +%include "wrappers/milena.hh" diff --git a/dynamic-use-of-static-c++/swig/python/Makefile.am b/dynamic-use-of-static-c++/swig/python/Makefile.am index 81455f7..86611e3 100644 --- a/dynamic-use-of-static-c++/swig/python/Makefile.am +++ b/dynamic-use-of-static-c++/swig/python/Makefile.am @@ -26,12 +26,15 @@ CLEANFILES = AM_CPPFLAGS = -I$(PYTHONINC) -I$(top_builddir)/src -I$(top_srcdir)/src ## FIXME: Define an equivalent to Olena's TOOLS_CXXFLAGS? -## TOOLS_CXXFLAGS = @TOOLS_CXXFLAGS@ -## AM_CXXFLAGS = $(TOOLS_CXXFLAGS) +##TOOLS_CXXFLAGS = @TOOLS_CXXFLAGS@ +##AM_CXXFLAGS = $(TOOLS_CXXFLAGS) +## FIXME: Warning, `AM_SWIGFLAGS' is not a standard Automake variable. AM_SWIGFLAGS = -Wall -c++ -python -I$(top_builddir)/src -I$(top_srcdir)/src # We build modules, not plain libs. AM_LDFLAGS = -avoid-version -module -shared -AM_LIBADD = $(top_builddir)/src/libdyn.la # $(LIBLTDL) +# Libraries with their dependencies. +libdyn_la = $(top_builddir)/src/libdyn.la +libdynmilena_la = $(top_builddir)/src/wrappers/libdynmilena.la $(libdyn_la) # Run Swig to create the C++ wrapper files, the Python interface # files, and the dependency Makefile snippets. @@ -69,13 +72,24 @@ pyexec_LTLIBRARIES = ## dyn. pyexec_LTLIBRARIES += _dyn.la nodist__dyn_la_SOURCES = dyn-wrap.cc -_dyn_la_LIBADD = $(AM_LIBADD) +_dyn_la_LIBADD = $(libdyn_la) CLEANFILES += $(nodist__dyn_la_SOURCES) dyn.py dyn.py[co] ## Include the dependency files. Copied from Automake's generated ## case for C++. @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_dyn-wrap.Pcc@am__quote@ nodist_python_PYTHON += dyn.py +# FIXME: Should be optional. +## mln. +pyexec_LTLIBRARIES += _mln.la +nodist__mln_la_SOURCES = mln-wrap.cc +_mln_la_LIBADD = $(libdynmilena_la) +CLEANFILES += $(nodist__mln_la_SOURCES) mln.py mln.py[co] +## Include the dependency files. Copied from Automake's generated +## case for C++. +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_mln-wrap.Pcc@am__quote@ +nodist_python_PYTHON += mln.py + ## ------- ## ## Tests. ## -- 1.6.5
participants (1)
-
Roland Levillain