From 54484e79aca0981ebc42ddc68487e6531da9b59d Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Fri, 20 Mar 2020 15:11:31 +0800 Subject: [PATCH] python: separate host/target python for cross-compile Signed-off-by: Yousong Zhou --- Makefile.am | 2 +- m4/openvswitch.m4 | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) --- a/Makefile.am +++ b/Makefile.am @@ -60,7 +60,7 @@ endif # foo/__init__.pyc will cause Python to ignore foo.py. run_python = \ PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH \ - PYTHONDONTWRITEBYTECODE=yes $(PYTHON3) + PYTHONDONTWRITEBYTECODE=yes $(PYTHON3_HOST) ALL_LOCAL = BUILT_SOURCES = @@ -148,7 +148,7 @@ ro_shell = printf '\043 Generated automa SUFFIXES += .in .in: - $(AM_V_GEN)PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON3) $(srcdir)/build-aux/soexpand.py -I$(srcdir) < $< | \ + $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/soexpand.py -I$(srcdir) < $< | \ $(PYTHON3) $(srcdir)/build-aux/dpdkstrip.py $(DPDKSTRIP_FLAGS) | \ sed \ -e 's,[@]PKIDIR[@],$(PKIDIR),g' \ @@ -415,7 +415,7 @@ CLEANFILES += flake8-check -include manpages.mk manpages.mk: $(MAN_ROOTS) build-aux/sodepends.py python/ovs_build_helpers/soutil.py - @PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON3) $(srcdir)/build-aux/sodepends.py -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp + @$(run_python) $(srcdir)/build-aux/sodepends.py -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp @if cmp -s $(@F).tmp $@; then \ touch $@; \ rm -f $(@F).tmp; \ --- a/m4/openvswitch.m4 +++ b/m4/openvswitch.m4 @@ -400,6 +400,8 @@ else: AC_MSG_ERROR([Python 3.4 or later is required but not found in $PATH, please install it or set $PYTHON3 to point to it]) fi AC_ARG_VAR([PYTHON3]) + PYTHON3_HOST=$ovs_cv_python3_host + AM_MISSING_PROG([PYTHON3_HOST], [python3]) PYTHON3=$ovs_cv_python3]) dnl Checks for flake8.