summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-11-25 13:01:04 -0500
committerNick Mathewson <nickm@torproject.org>2019-11-25 13:01:04 -0500
commit031f204a10bba72ce5006c2aa66dad0ef0c52512 (patch)
treeaf263717311321cefa68dcbd7ca63a0e02d8f472 /configure.ac
parent31f8b4fa65b446a3ae4ce67051a7f0aabcd22a97 (diff)
downloadtor-031f204a10bba72ce5006c2aa66dad0ef0c52512.tar.gz
tor-031f204a10bba72ce5006c2aa66dad0ef0c52512.zip
configure: reject Python 2.
Python 2 will be end-of-life as of 1 Jan 2020, so we can finally stop supporting it. As a first step, we should make our configure script stop accepting python 2 as something acceptable to run our tests with. Closes ticket 32608.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 10 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index afbf436f7a..894ca2b0f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -352,15 +352,20 @@ AM_CONDITIONAL(BUILD_HTML_DOCS, [test "x$enable_html_manual" != "xno"])
AM_PROG_CC_C_O
AC_PROG_CC_C99
-AC_ARG_VAR([PYTHON], [path to Python binary])
-AC_CHECK_PROGS(PYTHON, [ \
+AC_CACHE_CHECK([for Python 3], [tor_cv_PYTHON],
+ [AC_PATH_PROGS_FEATURE_CHECK([PYTHON], [ \
python3 \
python3.8 python3.7 python3.6 python3.5 python3.4 \
- python \
- python2 python2.7])
+ python ],
+ [["$ac_path_PYTHON" -c 'import sys; sys.exit(sys.version_info[0]<3)' && tor_cv_PYTHON="$ac_path_PYTHON" ac_path_PYTHON_found=:]] )])
+AC_SUBST([PYTHON], [$tor_cv_PYTHON])
+
+PYTHON="$tor_cv_PYTHON"
+
if test "x$PYTHON" = "x"; then
- AC_MSG_WARN([Python unavailable; some tests will not be run.])
+ AC_MSG_WARN([Python 3 unavailable; some tests will not be run.])
fi
+
AM_CONDITIONAL(USEPYTHON, [test "x$PYTHON" != "x"])
dnl List all external rust crates we depend on here. Include the version