Merge branch 'require-python34' into 'master'

[RFC] build: Drop Python 2 support and require Python 3.4+

See merge request GNOME/glib!196
This commit is contained in:
Philip Withnall 2018-08-31 10:48:11 +00:00
commit 8271263af3
2 changed files with 8 additions and 2 deletions

View File

@ -338,12 +338,12 @@ AC_PROG_AWK
# python.m4 will get the expected input
AC_ARG_WITH(python,
AS_HELP_STRING([--with-python=PATH],
[Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
[Path to Python interpreter; searches $PATH if only a program name, such as "python3" or "python3.4", is given; if not given, searches for a few standard names]),
[PYTHON="$withval"], [])
if test x"$PYTHON" = xyes; then
AC_MSG_ERROR([--with-python option requires a path or program argument])
fi
AM_PATH_PYTHON(2.7,,PYTHON="python2.7")
AM_PATH_PYTHON(3.4,,[AC_MSG_ERROR([Requires Python >=3.4])])
dnl ***********************

View File

@ -1842,6 +1842,12 @@ python = import('python').find_installation('python3')
# used for '#!/usr/bin/env <name>'
python_name = 'python3'
python_version = python.language_version()
python_version_req = '>=3.4'
if not python_version.version_compare(python_version_req)
error('Requires Python @0@, @1@ found.'.format(python_version_req, python_version))
endif
# Determine which user environment-dependent files that we want to install
have_bash = find_program('bash', required : false).found() # For completion scripts
have_m4 = find_program('m4', required : false).found() # For m4 macros