Revert previous commit, renaming comedi_wrap.c back to comedi_python_wrap.c.
authorIan Abbott <abbotti@mev.co.uk>
Thu, 16 Dec 2010 16:03:35 +0000 (16:03 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Thu, 16 Dec 2010 16:03:35 +0000 (16:03 +0000)
Add "comedi_python.i" swig interface file which merely %includes the
"comedi.i" in the parent directory.  Fix paths in "setup.py" and set it up
to run swig directly (using "comedi_python.i" as the source).  Change
"_comedi.py" to "comedi.py" (but keep the underscore prefix on the .so
and .la files).
Based on a patch by W. Trevor King.

swig/python/Makefile.am
swig/python/comedi_python.i [new file with mode: 0644]
swig/python/setup.py

index 7aa4cca4e137bcf6e2ae14612f1018a351c7fc7b..6f8f37b72c984a210cb75301aa825fc41c0f1d04 100644 (file)
@@ -2,19 +2,19 @@
 if HAVE_PYTHON
 pyexec_LTLIBRARIES = _comedi.la
 clean-local:
-       $(RM) comedi_wrap.c comedi.py
+       $(RM) comedi_python_wrap.c comedi.py
 else
 pyexec_LTLIBRARIES =
 clean-local:
 endif
 
-nodist__comedi_la_SOURCES = comedi_wrap.c
+nodist__comedi_la_SOURCES = comedi_python_wrap.c
 _comedi_la_CFLAGS = $(COMEDILIB_CFLAGS) $(PYTHON_INCLUDES) $(PYTHON_QUIET)
 _comedi_la_LDFLAGS = -module -avoid-version $(COMEDILIB_LIBS)
 
 pyexec_SCRIPTS = comedi.py
 
-EXTRA_DIST = README.txt setup.py test_comedi.py
+EXTRA_DIST = README.txt comedi_python.i setup.py test_comedi.py
 
-comedi_wrap.c comedi.py: $(srcdir)/../comedi.i
-       $(SWIG) -python -o comedi_wrap.c -I$(top_srcdir)/include $(srcdir)/../comedi.i
+comedi_python_wrap.c comedi.py: $(srcdir)/comedi_python.i $(srcdir)/../comedi.i
+       $(SWIG) -python -o comedi_python_wrap.c -I$(top_srcdir)/include -I$(srcdir)/.. $(srcdir)/comedi_python.i
diff --git a/swig/python/comedi_python.i b/swig/python/comedi_python.i
new file mode 100644 (file)
index 0000000..e18d092
--- /dev/null
@@ -0,0 +1 @@
+%include "comedi.i"
index 4c0c1ebd0fb9d07a6c9cdf155285016952b94a81..3f3aa4184a9dcc4dd02b7470eb1a6aae32095bc8 100644 (file)
@@ -3,15 +3,17 @@ from distutils.core import setup, Extension
 module1 = Extension('_comedi',
                        define_macros = [('MAJOR_VERSION','0'),
                                        ('MINOR_VERSION','1')],
-                       include_dirs = ['../include'],
-                       library_dirs = ['../lib'],
+                       include_dirs = ['../../include'],
+                       library_dirs = ['../../lib'],
+                       swig_opts = ['-I../../include', '-I..'],
                        libraries = ['comedi'],
-                       sources = ['comedi_wrap.c'])
+                       sources = ['comedi_python.i'])
                        
-setup (name='_comedi',
+setup (name='comedi',
        version = '0.1',
        description = 'Python wrapper module for the Comedi data-acquisition drivers',
        author = 'Bryan E. Cole',
        author_email = 'bryan.cole@teraview.co.uk',
        long_description = ''' Wrapper for the Comedi data-acquisition library ''',
-       ext_modules = [module1])
+       ext_modules = [module1],
+       py_modules = ['comedi'])