diff --git a/configure.ac b/configure.ac index 6d0d9f3..956d537 100644 --- a/configure.ac +++ b/configure.ac @@ -78,7 +78,8 @@ AM_SANITY_CHECK # swig AM_PATH_PYTHON(2.3) AC_PROG_SWIG(1.3.21) -SWIG_ENABLE_CXX +#SWIG_ENABLE_CXX +SWIG_ENABLE_C SWIG_PYTHON #--------------------------------------------- diff --git a/src/Makefile.am b/src/Makefile.am index 17e4a54..a144ea6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -44,6 +44,23 @@ libmasa_la_SOURCES = $(cc_sources) $(h_sources) libfmasa_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) libfmasa_la_SOURCES = masa.f90 +#----------------------- +# MASA (SWIG) Python interface -- optional! +#----------------------- + +BUILT_SOURCES += $(srcdir)/masa_wrap.c +SWIG_SOURCES=masa.i + +pkgpython_PYTHON = masa.py +pkgpyexec_LTLIBRARIES = _your_extension.la +_your_extension_la_SOURCES = $(srcdir)/masa_wrap.c $(SWIG_SOURCES) +_your_extension_la_CFLAGS = $(SWIG_PYTHON_CFLAGS) -I$(top_srcdir)/src +_your_extension_la_LDFLAGS = -module +_your_extension_la_LIBADD = ../src/libmasa.la + +$(srcdir)/masa_wrap.c : $(SWIG_SOURCES) + $(SWIG) $(SWIG_PYTHON_OPT) -I$(top_srcdir)/src -o $@ $< + #----------------------- # Standalone binaries #----------------------- diff --git a/src/masa.i b/src/masa.i new file mode 100644 index 0000000..007ea12 --- /dev/null +++ b/src/masa.i @@ -0,0 +1,18 @@ +// SWIG declarations for building MASA module +// Notice the C and not the C++ API is wrapped +// See SWIG documentation at http://www.swig.org/ + +%module masa + +// Verbatim #includes passed into C compilation +%{ +#define SWIG_FILE_WITH_INIT +%} + +%include "masa.h" + + + // + // nick and rhys + // 7/2/13 + //