diff options
Diffstat (limited to 'config/python.m4')
-rw-r--r-- | config/python.m4 | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/config/python.m4 b/config/python.m4 index 7f775e77d23..953d7093053 100644 --- a/config/python.m4 +++ b/config/python.m4 @@ -18,7 +18,8 @@ fi # _PGAC_CHECK_PYTHON_DIRS # ----------------------- -# Determine the name of various directories of a given Python installation. +# Determine the name of various directories of a given Python installation, +# as well as the Python version. AC_DEFUN([_PGAC_CHECK_PYTHON_DIRS], [AC_REQUIRE([PGAC_PATH_PYTHON]) AC_MSG_CHECKING([for Python distutils module]) @@ -36,6 +37,11 @@ python_version=`${PYTHON} -c "import sys; print(sys.version[[:3]])"` python_configdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBPL'))))"` AC_MSG_RESULT([$python_configdir]) +# Reject unsupported Python versions as soon as practical. +if test "$python_majorversion" -lt 3 -a "$python_minorversion" -lt 4; then + AC_MSG_ERROR([Python version $python_version is too old (version 2.4 or later is required)]) +fi + AC_MSG_CHECKING([Python include directories]) python_includespec=`${PYTHON} -c " import distutils.sysconfig |