[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: building/installing Python modules?
From: |
Alexandre Duret-Lutz |
Subject: |
Re: building/installing Python modules? |
Date: |
Tue, 23 Apr 2002 11:07:28 +0200 |
User-agent: |
Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu) |
>>> "Skip" == Skip Montanaro <address@hidden> writes:
Skip> I'm trying to figure out how to compile and link a Python
Skip> extension module.
The Python support in Automake is very limited. Basically,
Automake knows how to byte-compile a python script and where to
install it, but that's all.
There is no specific support for creating C extension modules,
or, conversely, embeding python in your program.
Doing the latter requires an Autoconf macro to find the
libraries to link with (look at the "dia" project, IIRC they do
that).
Doing the former involves building a shared library, so you'll
probably have to go through Libtool (unless you manage to
integrate Python's distutils with Automake...).
In both cases, you'll also have to find the Python headers. I
think someone wrote an AM_CHECK_PYTHON_HEADERS macro for that,
Google is likely to know where it is (sounds like our proxy is
down here).
Skip> In my generated aclocal.m4 file I saw this comment:
Skip> # Adds support for distributing Python modules and packages. To
Skip> # install modules, copy them to $(pythondir), using the python_PYTHON
Skip> # automake variable. To install a package with the same name as the
Skip> # automake package, install to $(pkgpythondir), or use the
Skip> # pkgpython_PYTHON automake variable.
Skip> This, unfortunately, makes not a lick of sense to me. I
Skip> didn't see anything in the automake info file about
Skip> building Python extension modules. Can someone give me a
Skip> simple automake recipe for building python/alfmodule.so
Skip> from python/alfmodule.c?
Completly untested:
pyexecdir_LTLIBRARY = alfmodule.la
alfmodule_la_SOURCES = alfmodule.c
alfmodule_la_LDFLAGS = -module
This will have the unfortunate side-effect of installing a
couple of other files in addition to alfmodule.so (you can
remove them using an `install-exec-hook').
--
Alexandre Duret-Lutz