python: Improve Python detection.
authorJustus Winter <justus@g10code.com>
Wed, 22 Mar 2017 14:33:06 +0000 (15:33 +0100)
committerJustus Winter <justus@g10code.com>
Wed, 22 Mar 2017 14:33:06 +0000 (15:33 +0100)
* m4/python.m4 (_AM_PYTHON_INTERPRETER_LIST): Prefer the generic
'pythonX' over 'pythonX.Y'.  This way we select the users preferred
version for both flavors.  Prefer 'python' over 'python3' but not over
'python2' so that the algorithm still finds a 'python2' even if
'python' is a Python3.

Fixes-commit: 5189c08af9468cdeb6f16a6ecd0fee53e1e3aa0e
Signed-off-by: Justus Winter <justus@g10code.com>
m4/python.m4

index 13962f4..822b2dd 100644 (file)
@@ -37,8 +37,10 @@ AC_DEFUN([AM_PATH_PYTHON],
   dnl Find a Python interpreter.  Python versions prior to 2.0 are not
   dnl supported. (2.0 was released on October 16, 2000).
   m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
-[python2.7 python2 python3.0 python3.1 python3.2 python3.3 python3.4 dnl
- python3.5 python3.6 python3.7 python3.8 python3 python])
+[python2 python2.7 dnl
+ python dnl
+ python3 python3.0 python3.1 python3.2 python3.3  dnl
+ python3.4 python3.5 python3.6 python3.7 python3.8])
 
   AC_ARG_VAR([PYTHON], [the Python interpreter])