Changeset View
Changeset View
Standalone View
Standalone View
m4/python.m4
Context not available. | |||||
# numbers and dots only. | # numbers and dots only. | ||||
AC_DEFUN([AM_PATH_PYTHON], | AC_DEFUN([AM_PATH_PYTHON], | ||||
[ | [ | ||||
dnl Find a Python interpreter. Python versions prior to 2.0 are not | dnl Find a Python interpreter. Python versions prior to 2.1 are not | ||||
dnl supported. (2.0 was released on October 16, 2000). Python 3.0 | dnl supported. Python 3.0 through to Python 3.3 are also not supported. | ||||
dnl through to Python 3.9 are also not supported. | |||||
m4_define_default([_AM_PYTHON_INTERPRETER_LIST], | m4_define_default([_AM_PYTHON_INTERPRETER_LIST], | ||||
[python2 python2.7 dnl | [python2 python2.7 dnl | ||||
python dnl | python dnl | ||||
python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 | python3 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 | ||||
]) | ]) | ||||
AC_ARG_VAR([PYTHON], [the Python interpreter]) | AC_ARG_VAR([PYTHON], [the Python interpreter]) | ||||
Context not available. | |||||
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) | m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) | ||||
else | else | ||||
dnl Query Python for its version number. Getting [:3] seems to be | dnl Query Python for its version number. Formatting sys.version_info[:2] | ||||
dnl the best way to do this; it's what "site.py" does in the standard | dnl seems to be the most reliable way to do this across versions 2.1 | ||||
dnl library. | dnl through 3.10; it's what "site.py" does in the standard 3.10 library. | ||||
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], | AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], | ||||
[am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) | [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write('%d.%d' % sys.version_info[[:2]])"`]) | ||||
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) | AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) | ||||
dnl Use the values of $prefix and $exec_prefix for the corresponding | dnl Use the values of $prefix and $exec_prefix for the corresponding | ||||
Context not available. |