diff options
author | James E. King III <jking@apache.org> | 2019-01-02 08:28:47 -0500 |
---|---|---|
committer | James E. King III <jking@apache.org> | 2019-01-03 00:04:07 -0500 |
commit | 57516213cc3b17a38196b07282feb47144e5232f (patch) | |
tree | de772c325e3f8067406efdceaceeb2356f2ad39f /configure.ac | |
parent | 217e8246ab6fdb6a1fa6016ba0f4979eb1d8a92a (diff) | |
download | thrift-57516213cc3b17a38196b07282feb47144e5232f.tar.gz |
THRIFT-4301: fix inability to disable py3 with autoconf build
Diffstat (limited to 'configure.ac')
-rwxr-xr-x | configure.ac | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 4a5fb3925..fa507561f 100755 --- a/configure.ac +++ b/configure.ac @@ -325,10 +325,13 @@ AM_CONDITIONAL(WITH_TWISTED_TEST, [test "$have_trial" = "yes"]) # It's distro specific and far from ideal but needed to cross test py2-3 at once. # TODO: find "python2" if it's 3.x have_py3="no" -if python --version 2>&1 | grep -q "Python 2"; then - AC_PATH_PROGS([PYTHON3], [python3 python3.5 python35 python3.4 python34]) - if test -n "$PYTHON3"; then - have_py3="yes" +AX_THRIFT_LIB(py3, [Py3], yes) +if test "$with_py3" = "yes"; then + if $PYTHON --version 2>&1 | grep -q "Python 2"; then + AC_PATH_PROGS([PYTHON3], [python3 python3.7 python37 python3.6 python36 python3.5 python35 python3.4 python34]) + if test -n "$PYTHON3"; then + have_py3="yes" + fi fi fi AM_CONDITIONAL(WITH_PY3, [test "$have_py3" = "yes"]) |