using automake/autoconf to build extension module?

Martin v. Loewis martin at v.loewis.de
Mon Apr 22 17:49:15 EDT 2002


Skip Montanaro <skip at pobox.com> writes:

> Can someone explain what automake incantations are necessary to build a
> Python extension module?  

I personally recommend to stay away from libtool, if you can. It is
terribly broken.

> I'd prefer not to use distutils if possible, since
> the rest of the project is using automake/autoconf/libtool for build
> configuration.

That does not necessary contradict each other. You can easily embed
Python fragments into a configure.in, to determine the appropriate
command line options.

You need to extract PY_CFLAGS from Python's Makefile; one way is, e.g.

eval `python - <<END
import distutils.sysconfig
flags=distutils.sysconfig.get_config_var("PY_CFLAGS")
print 'PY_CFLAGS="%"' % flags
END`

Then, you can integrate PY_CFLAGS into your own build process.

Notice that this still won't get the right -I option; your computation
of the include directory will be still needed.

Regards,
Martin



More information about the Python-list mailing list