[Python-Dev] autoconfigure patch submitted on SourceForge

Eric S. Raymond esr@snark.thyrsus.com
Sun, 7 Jan 2001 23:16:53 -0500


Setting things up so curses is autoconfigured into the default build
if your system has it in the expected places turned out to be dead
easy.  Some clever person (the BDFL himself?) wrote the build process
so that there is *already* a Setup.config.in that gets configure
expansions done on it, with the generated Setup.config used when
makesetup does its magic.

As a bonus, I've also added autoconfiguration for readline.  A small
detail, but one which I suspect many people building their own Pythons
frequently trip over.

The technique generalizes easily.  The archetype for a facility for
autoconfiguring libfoo with a Python extension foo.c if it's present
has just two steps:

Add this to Modules/Setup.config.in:

@USE_FOO_MODULE@foo foo.c -lfoo

Add this to configure.in:

# This is used to generate Setup.config
AC_SUBST(USE_FOO_MODULE)
AC_CHECK_LIB(foo, random_foo_function, 
	[USE_FOO_MODULE=""],
	[USE_FOO_MODULE="#"])

(Apologies for the lack of description with the patch.  I tripped over
a SourceForge interface bug.)
-- 
		<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>

The possession of arms by the people is the ultimate warrant
that government governs only with the consent of the governed.
        -- Jeff Snyder