[jhbuild/wip/lantw/exit-early-if-python-is-not-python2] configure.ac: Exit early if PYTHON is not Python 2
- From: Ting-Wei Lan <lantw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild/wip/lantw/exit-early-if-python-is-not-python2] configure.ac: Exit early if PYTHON is not Python 2
- Date: Mon, 24 Jun 2019 17:54:36 +0000 (UTC)
commit c62629a1585a32b8610fd791314d2adc33af1e6c
Author: Ting-Wei Lan <lantw src gnome org>
Date: Tue Jun 25 00:54:37 2019 +0800
configure.ac: Exit early if PYTHON is not Python 2
JHBuild still only supports Python 2. However, automake doesn't seem to
provide a way to choose between python 2 and 3, and it just accepts the
default one if its version number is high enough. Therefore, on systems
using Python 3 by default, JHBuild will be configured to use Python 3,
causing JHBuild to crash immediately because of invalid syntax. In order
to avoid installing a broken version of JHBuild, we should check the
version ourselves and exit early from the configure script.
configure.ac | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/configure.ac b/configure.ac
index 78a76cf5..98a4f35b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,7 +13,10 @@ AM_MAINTAINER_MODE([enable])
# Check for programs
AC_PROG_CC
-AM_PATH_PYTHON
+AM_PATH_PYTHON([], [
+ AS_CASE(["$PYTHON_VERSION"],
+ [2.*], [],
+ [AC_MSG_ERROR([JHBuild only works with python 2])])])
PKG_PROG_PKG_CONFIG
# i18n
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]