You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.7 KiB

  1. From b3cc748d502f7f87aeb103b3f69573b0e640e2ba Mon Sep 17 00:00:00 2001
  2. From: Yousong Zhou <yszhou4tech@gmail.com>
  3. Date: Wed, 28 Feb 2018 13:42:44 +0800
  4. Subject: [PATCH 102/104] python: separate host/target python for cross-compile
  5. At the moment, python-six is a requirement for openvswitch python
  6. library on target machine.
  7. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
  8. ---
  9. Makefile.am | 2 +-
  10. m4/openvswitch.m4 | 12 ++++--------
  11. 2 files changed, 5 insertions(+), 9 deletions(-)
  12. --- a/Makefile.am
  13. +++ b/Makefile.am
  14. @@ -60,7 +60,7 @@ endif
  15. # foo/__init__.pyc will cause Python to ignore foo.py.
  16. run_python = \
  17. PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH \
  18. - PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
  19. + PYTHONDONTWRITEBYTECODE=yes $(PYTHON_HOST)
  20. ALL_LOCAL =
  21. BUILT_SOURCES =
  22. --- a/m4/openvswitch.m4
  23. +++ b/m4/openvswitch.m4
  24. @@ -351,20 +351,16 @@ else:
  25. if test $ovs_cv_python = no; then
  26. AC_MSG_ERROR([cannot find python 2.7 or higher.])
  27. fi
  28. - AM_MISSING_PROG([PYTHON], [python])
  29. + AC_SUBST([PYTHON])
  30. PYTHON=$ovs_cv_python
  31. + AM_MISSING_PROG([PYTHON_HOST], [python])
  32. + PYTHON_HOST=$ovs_cv_python_host
  33. # HAVE_PYTHON is always true. (Python has not always been a build
  34. # requirement, so this variable is now obsolete.)
  35. AC_SUBST([HAVE_PYTHON])
  36. HAVE_PYTHON=yes
  37. - AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])
  38. -
  39. - AC_MSG_CHECKING([whether $PYTHON has six library])
  40. - if ! $PYTHON -c 'import six ; six.moves.range' >&AS_MESSAGE_LOG_FD 2>&1; then
  41. - AC_MSG_ERROR([Missing Python six library or version too old.])
  42. - fi
  43. - AC_MSG_RESULT([yes])])
  44. + AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])])
  45. dnl Checks for Python 3.x, x >= 4.
  46. AC_DEFUN([OVS_CHECK_PYTHON3],