logo       

SWIG and autotools: msg#00018

programming.swig

Subject: SWIG and autotools

        Hi,

        I'm trying to create a Python binding for a set of C++ libraries that are build using autotools (autoconf, automake, libtools).

        I added the swig commands as part of the autotools build with no problem, but I'm having problems to make Python recognize the new module.

        Here are more specifics:

        My library is called openModeller (om for short). My Makefile.am looks like this:

Lib_LTLIBRARIES = _ompython.la

_ompython_la_SOURCES = om_wrap.cxx

_omphython_la_CPPFLAGS = -I. -I.. -I../inc -I/usr/include/python2.2
_omphython_la_LDFLAGS = -module -avoid-version
_omphython_la_LIBADD = $(GDAL_LIB) ../lib/libopenmodeller.la ../lib/env_io/libenv_io.la

om_wrap.cxx: om.i
        swig -c++ -python om.i

        Part of the problem is that Python is expecting something called _modulename.so. But I can only compile a .la library using autotools.

        So, how do I solve this problem?

        If I don't use autotools, then I can get my SWIG Python binding working fine.
        I found an example of what I'm trying to do (https://cvs.comedi.org/cgi-bin/viewcvs.cgi/comedilib/swig/python/Makefile.am?rev=1.3&content-type=text/vnd.viewcvs-markup), but I can't figure out how they got Python to recognize their module (in .la format).

        Any help would be greatly appreciated.
        Regards,

Ricardo


--
Ricardo Scachetti Pereira
Computer Engineer
Biodiversity Research Center
Natural History Museum
University of Kansas
1345 Jayhawk Boulevard
Lawrence, KS 66045-7561 USA
Tel: (785) 864-4655, Fax: (785) 864-5335
email: rpereira@xxxxxx


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise