aboutsummaryrefslogtreecommitdiff
path: root/m4/ctng_python_version.m4
blob: b07cc36845e74d5c3b2710e19e1ff05053a2373b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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