diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-05-03 11:36:13 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-05-03 12:15:38 +0200 |
commit | 22a569f2ae7defc4eae62f0b1b6d790e412d9dc7 (patch) | |
tree | 4bec7d108f31c16f9db9fac57b7aa58ac01b4a99 /openbsc/configure.ac | |
parent | 133de7d87440e9a459abef0594a5d08006ff2ed6 (diff) |
tests: Fix selection of python version
According to documentation (and personal experience), AM_PATH_PYTHON
selects the highest version of python, no matter if major version is
different, which means if both python2 and 3 are available, 3 will be
chosen an PYTHON will point to "/.../python" which is python3. Apparently,
the macro cannot be easily used to pick highest python2 version.
chosen an PYTHON will point to "/.../python" which is python3. Apparently,
the macro cannot be easily used to pick highest python2 version.
As {vty,ctrl}_test_runner.py require python2 and are incompatible with
python3, let's instead rely on the system having a "python2" binary
available, which is the case in most distros.
cherry-picked from: osmo-bsc.git 7e78681f0f740bd68ed5255b506a1efa08a231b1.
Change-Id: Icc147c8457116ad551d166313f3a79e1c2107a22
Diffstat (limited to 'openbsc/configure.ac')
-rw-r--r-- | openbsc/configure.ac | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openbsc/configure.ac b/openbsc/configure.ac index 704c7d7e1..560231300 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -198,7 +198,10 @@ AC_ARG_ENABLE([external_tests], [Include the VTY/CTRL tests in make check [default=no]]), [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) if test "x$enable_ext_tests" = "xyes" ; then - AM_PATH_PYTHON + AC_CHECK_PROG(PYTHON2_AVAIL,python2,yes) + if test "x$PYTHON2_AVAIL" != "xyes" ; then + AC_MSG_ERROR([Please install python2 to run the VTY/CTRL tests.]) + fi AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.]) |