Skip to content

Commit eb03952

Browse files
committed
m4/ctng_python_version.m4: Handle python not existing
Update the python version check to handle the fact that python may not be present at all. Fixes: crosstool-ng#2416 Signed-off-by: Chris Packham <judge.packham@gmail.com>
1 parent 2c952e0 commit eb03952

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

m4/ctng_python_version.m4

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ AC_DEFUN([CTNG_PYTHON_VERSION],
66
[
77
AC_MSG_CHECKING(for python version greater than $1.$2)
88
9-
pyvermajor=$($PYTHON_BIN -c "import sys; print(sys.version_info.major)")
10-
pyverminor=$($PYTHON_BIN -c "import sys; print(sys.version_info.minor)")
9+
AS_IF([test -n "$PYTHON_BIN"],
10+
pyvermajor=$($PYTHON_BIN -c "import sys; print(sys.version_info.major)")
11+
pyverminor=$($PYTHON_BIN -c "import sys; print(sys.version_info.minor)"),
12+
pyvermajor=0
13+
pyverminor=0)
1114
1215
AS_IF([test $pyvermajor -ge $1 -a $pyverminor -ge $2],
1316
eval "python_$1_$2_or_newer=y"
14-
[CTNG_SET_KCONFIG_OPTION([python_$1_$2_or_newer])
15-
AC_MSG_RESULT([yes: ${pyvermajor}.${pyverminor}])],
16-
AC_MSG_RESULT([no: ${pyvermajor}.${pyverminor}]))
17+
AC_MSG_RESULT([yes: ${pyvermajor}.${pyverminor}]),
18+
AC_MSG_RESULT([no]))
19+
20+
CTNG_SET_KCONFIG_OPTION([python_$1_$2_or_newer])
1721
])dnl

0 commit comments

Comments
 (0)