From 392554b8de4641c8ac9c5ca1e062919a64ecd020 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 3 Nov 2008 21:25:20 -0500 Subject: Try to guess whether the email package is actually needed or not. --- configure.in | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index a3aabfdf..0e4c4212 100644 --- a/configure.in +++ b/configure.in @@ -52,8 +52,7 @@ AC_SUBST(PYTHON) PYTHON=$with_python AC_MSG_RESULT($PYTHON) -# See if Python is new enough. 2.1 or better is required, with 2.1.3 -# recommended. +# See if Python is new enough. AC_MSG_CHECKING(Python version) changequote(,) cat > conftest.py <= 0x2010000: +if v >= 0x2030000: s = sys.version.split()[0] else: s = "" @@ -80,11 +78,46 @@ then AC_MSG_ERROR([ ***** $PYTHON is too old (or broken) -***** Python 2.1 or newer is required -***** Python 2.1.3 or better is recommended]) +***** Python 2.3 or newer is required]) fi AC_MSG_RESULT($version) +# Check the email package version. +AC_MSG_CHECKING(Python's email package) +changequote(,) +cat > conftest.py < version: + res = "not ok" + else: + res = "ok" +fp = open("conftest.out", "w") +fp.write("%s\n" % res) +fp.close() +EOF +changequote([, ]) +$PYTHON conftest.py +needemailpkg=`cat conftest.out` +rm -f conftest.out conftest.py + +# Should we rely on Python's own email package or use the pre-packaged version? +AC_SUBST(EMAILPKG) +if test "$needemailpkg" = "ok" +then + EMAILPKG="" +else + EMAILPKG=email-2.5.8 +fi +AC_MSG_RESULT($needemailpkg) + + # Make sure distutils is available. Some Linux Python packages split # distutils into the "-devel" package, so they need both. AC_MSG_CHECKING(that Python has a working distutils) @@ -489,6 +522,7 @@ else fi AC_MSG_RESULT($with_urlhost) + changequote(,) cat > conftest.py <