diff options
author | Kurt von Laven <kurt@endlessm.com> | 2015-05-02 11:52:59 -0700 |
---|---|---|
committer | Kurt von Laven <kurt@endlessm.com> | 2015-05-06 12:38:46 -0700 |
commit | b4b57ec0863e56960e9eb5dae726391134e21293 (patch) | |
tree | 15668d39edfa933204bff9a033ae85bb6950c805 /m4/ax_python_module_version.m4 | |
parent | d577a21b0ca03def9c817324b6092c6a200e78f6 (diff) | |
download | autoconf-archive-b4b57ec0863e56960e9eb5dae726391134e21293.tar.gz |
ax_python_module[_version]: Add Python 3 support.
Permit dependency checking of both Python 2 and Python 3 modules.
Default to Python 3 if unspecified.
Diffstat (limited to 'm4/ax_python_module_version.m4')
-rw-r--r-- | m4/ax_python_module_version.m4 | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/m4/ax_python_module_version.m4 b/m4/ax_python_module_version.m4 index 15d6d1b..0ffb7b0 100644 --- a/m4/ax_python_module_version.m4 +++ b/m4/ax_python_module_version.m4 @@ -4,13 +4,15 @@ # # SYNOPSIS # -# AX_PYTHON_MODULE_VERSION(modname, min_version) +# AX_PYTHON_MODULE_VERSION(modname, min_version[, python]) # # DESCRIPTION # # Checks for Python module with at least the given version. # # Triggers an error if module is absent or present but at a lower version. +# The third parameter can either be "python" for Python 2 or "python3" for +# Python 3; defaults to Python 3. # # LICENSE # @@ -21,10 +23,10 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 1 +#serial 2 AC_DEFUN([AX_PYTHON_MODULE_VERSION], [ - AX_PYTHON_MODULE([$1], [required]) + AX_PYTHON_MODULE([$1], [required], [$3]) AC_MSG_CHECKING([for version $2 or higher of $1]) $PYTHON -c "import sys, $1; from distutils.version import StrictVersion; sys.exit(StrictVersion($1.__version__) < StrictVersion('$2'))" 2> /dev/null AS_IF([test $? -eq 0], [], [ |