THRIFT-3439 Run make cross using Python3 when available
Client: Test
Patch: Nobuaki Sukegawa
Add Makefile.am change that was missing in the original patch.
This closes #792
diff --git a/Makefile.am b/Makefile.am
index 3eaa94e..f2ce16a 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,9 +42,6 @@
$(MAKE) -C $* precross
precross: all precross-test precross-lib
-# TODO: generate --server and --client switches from "--with(out)-..." build flags
-
-
empty :=
space := $(empty) $(empty)
comma := ,
@@ -52,14 +49,20 @@
CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_JAVA@ @MAYBE_CSHARP@ @MAYBE_PYTHON@ @MAYBE_PY3@ @MAYBE_RUBY@ @MAYBE_HASKELL@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@ @MAYBE_DART@ @MAYBE_ERLANG@
CROSS_LANGS_COMMA_SEPARATED = $(subst $(space),$(comma),$(CROSS_LANGS))
+if WITH_PY3
+CROSS_PY=$(PYTHON3)
+else
+CROSS_PY=$(PYTHON)
+endif
+
cross: precross
- $(PYTHON) test/test.py -F.* -s --server $(CROSS_LANGS_COMMA_SEPARATED)
- $(PYTHON) test/test.py -s --server $(CROSS_LANGS_COMMA_SEPARATED) --client $(CROSS_LANGS_COMMA_SEPARATED)
+ $(CROSS_PY) test/test.py -F.* -s --server $(CROSS_LANGS_COMMA_SEPARATED)
+ $(CROSS_PY) test/test.py -s --server $(CROSS_LANGS_COMMA_SEPARATED) --client $(CROSS_LANGS_COMMA_SEPARATED)
TIMES = 1 2 3
fail: precross
- $(PYTHON) test/test.py || true
- $(PYTHON) test/test.py --update-expected-failures=overwrite
+ $(CROSS_PY) test/test.py || true
+ $(CROSS_PY) test/test.py --update-expected-failures=overwrite
$(foreach var,$(TIMES),test/test.py -s || true;test/test.py --update-expected-failures=merge;)
codespell_skip_files = \
diff --git a/configure.ac b/configure.ac
index 3a1314d..92dc58c 100755
--- a/configure.ac
+++ b/configure.ac
@@ -274,10 +274,11 @@
fi
AM_CONDITIONAL(WITH_LUA, [test "$have_lua" = "yes"])
+# Find python regardless of with_python value, because it's needed by make cross
+AM_PATH_PYTHON(2.6,, :)
AX_THRIFT_LIB(python, [Python], yes)
if test "$with_python" = "yes"; then
AC_PATH_PROG([TRIAL], [trial])
- AM_PATH_PYTHON(2.6,, :)
if test -n "$TRIAL" && test "x$PYTHON" != "x" && test "x$PYTHON" != "x:" ; then
have_python="yes"
fi
@@ -286,11 +287,9 @@
# Find "python3" executable.
# It's distro specific and far from ideal but needed to cross test py2-3 at once.
-if test "x$have_python" = "xyes"; then
- AC_PATH_PROG([PYTHON3], [python3])
- if test "x$PYTHON3" != "x" && test "x$PYTHON3" != "x:" ; then
- have_py3="yes"
- fi
+AC_PATH_PROG([PYTHON3], [python3])
+if test "x$PYTHON3" != "x" && test "x$PYTHON3" != "x:" ; then
+ have_py3="yes"
fi
AM_CONDITIONAL(WITH_PY3, [test "$have_py3" = "yes"])