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

Dylan Baker dylan at pnwbakers.com
Fri Aug 17 17:36:16 UTC 2018


Quoting Emil Velikov (2018-08-17 03:12:56)
> On 16 August 2018 at 21:28, Dylan Baker <dylan at pnwbakers.com> wrote:
> > Quoting Eric Engestrom (2018-08-16 09:52:05)
> >> On Thursday, 2018-08-16 17:18:56 +0100, Emil Velikov wrote:
> >> > 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_PROG_NM
> >> >  AM_PROG_AS
> >> >  AX_CHECK_GNU_MAKE
> >> > -AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
> >> > +AM_PATH_PYTHON([2.7],, [:])
> >> > +PYTHON2=$PYTHON
> >> > +AC_SUBST([PYTHON2])
> >> > +
> >> >  AC_PROG_SED
> >> >  AC_PROG_MKDIR_P
> >> >
> >> > @@ -157,7 +160,7 @@ fi
> >> >
> >> >  AX_CHECK_PYTHON_MAKO_MODULE($PYTHON_MAKO_REQUIRED)
> >> >
> >> > -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])
> >> >      fi
> >> > 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
> >> >
> >> >  <ul>
> >> >  <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.
> >
> > Is this just the autotools build, or is this for all builds? For meson 3.4+ is
> > required.
> >
> With a 1-2 line change one could use python 2.7 there, not sure if
> that's a good idea though ;-)

For meson I don't think it makes any sense to allow using python 2.7 for the
generators since meson itself requires 3.x; in the same way I don't think it's
worthwhile to allow python 3.x with the current scons build since it requires
2.7

> Since there is no mention about build systems lets leave that as
> follow-up patch?

That seems fine.

> 
> >> >  </li>
> >> >  <li><a href="http://www.makotemplates.org/">Python Mako module</a> -
> >> >  Python Mako module is required. Version 0.3.4 or later should work.
> >> Side note: I think this is also wrong      ^^^^^
> >> Should be 0.8.0 I believe.
> >
> > Yes, it should be 0.8.0, good catch.
> >
> Agreed. Separate patch is out [1] having a correct documentation in
> stable is nice.
> 
> Thanks
> Emil
> 
> [1] https://patchwork.freedesktop.org/patch/244951/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180817/d14f463f/attachment.sig>


More information about the mesa-dev mailing list