[Mesa-dev] [PATCH 1/2] configure: use AM_PATH_PYTHON to look for the python version

Emil Velikov emil.l.velikov at gmail.com
Thu Aug 16 16:18:56 UTC 2018

From: Emil Velikov <emil.velikov at collabora.com>

Currently we use AC_CHECK_PROGS looking for python2.7, python2 and
finally python. That is due to the varying names used across the
different OS.

Use the handy AM_PATH_PYTHON which finds the correct name and checks for
the version.

Note: python2.7 has been an unofficial requirement for quite some time.
Update the docs to reflect that.

Cc: Dylan Baker <dylan at pnwbakers.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
 configure.ac      | 7 +++++--
 docs/install.html | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index c2155a541b0..57fddb927ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,7 +125,10 @@ AC_PROG_GREP
-AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
+AM_PATH_PYTHON([2.7],, [:])
@@ -157,7 +160,7 @@ fi
-if test -z "$PYTHON2"; then
+if test "$PYTHON2" = ":"; then
     if test ! -f "$srcdir/src/util/format_srgb.c"; then
         AC_MSG_ERROR([Python not found - unable to generate sources])
diff --git a/docs/install.html b/docs/install.html
index 08081944cfc..f6094671cf9 100644
--- a/docs/install.html
+++ b/docs/install.html
@@ -72,7 +72,7 @@ you think you've spotted a bug let developers know by filing a
 <li><a href="https://www.python.org/">Python</a> - Python is required.
-Version 2.6.4 or later should work.
+Version 2.7 or later should work.
 <li><a href="http://www.makotemplates.org/">Python Mako module</a> -
 Python Mako module is required. Version 0.3.4 or later should work.

More information about the mesa-dev mailing list