crosstool-ng/m4/ctng_python_version.m4
Bryan Hundven fa05153eba Make checking for python more predictable.
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
2023-03-16 16:54:05 +13:00

18 lines
681 B
Plaintext

# CTNG_PYTHON_VERSION([major],[minor])
#
# Check for at least a specific Major.Minor of python.
# Don't error out if it isn't matched... Might go back on that.
AC_DEFUN([CTNG_PYTHON_VERSION],
[
AC_MSG_CHECKING(for python version greater than $1.$2)
pyvermajor=$($PYTHON_BIN -c "import sys; print(sys.version_info.major)")
pyverminor=$($PYTHON_BIN -c "import sys; print(sys.version_info.minor)")
AS_IF([test $pyvermajor -ge $1 -a $pyverminor -ge $2],
eval "python_$1_$2_or_newer=y"
[CTNG_SET_KCONFIG_OPTION([python_$1_$2_or_newer])
AC_MSG_RESULT([yes: ${pyvermajor}.${pyverminor}])],
AC_MSG_RESULT([no: ${pyvermajor}.${pyverminor}]))
])dnl