You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ns...@apache.org on 2016/01/18 19:40:50 UTC
[5/8] thrift git commit: THRIFT-3439 Run make cross using Python3
when available Client: Test Patch: Nobuaki Sukegawa
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
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/ffc2bb3d
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/ffc2bb3d
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/ffc2bb3d
Branch: refs/heads/master
Commit: ffc2bb3dd7afc3214bddc0bcd656ea79f3ead427
Parents: baa1101
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Tue Jan 12 19:20:05 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Jan 19 02:48:07 2016 +0900
----------------------------------------------------------------------
Makefile.am | 17 ++++++++++-------
configure.ac | 11 +++++------
2 files changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/ffc2bb3d/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index 3eaa94e..f2ce16a 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,9 +42,6 @@ precross-%: all
$(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 @@ comma := ,
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 = \
http://git-wip-us.apache.org/repos/asf/thrift/blob/ffc2bb3d/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 3a1314d..92dc58c 100755
--- a/configure.ac
+++ b/configure.ac
@@ -274,10 +274,11 @@ if test "$with_lua" = "yes"; then
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 @@ AM_CONDITIONAL(WITH_PYTHON, [test "$have_python" = "yes"])
# 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"])