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.

59 lines
1.9 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. diff --git a/Makefile.am b/Makefile.am
  13. index 31d633179..4b9e8d491 100644
  14. --- a/Makefile.am
  15. +++ b/Makefile.am
  16. @@ -59,7 +59,7 @@ endif
  17. # foo/__init__.pyc will cause Python to ignore foo.py.
  18. run_python = \
  19. PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH \
  20. - PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
  21. + PYTHONDONTWRITEBYTECODE=yes $(PYTHON_HOST)
  22. ALL_LOCAL =
  23. BUILT_SOURCES =
  24. diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
  25. index 00ffad35f..52f207bda 100644
  26. --- a/m4/openvswitch.m4
  27. +++ b/m4/openvswitch.m4
  28. @@ -347,20 +347,16 @@ else:
  29. if test $ovs_cv_python = no; then
  30. AC_MSG_ERROR([cannot find python 2.7 or higher.])
  31. fi
  32. - AM_MISSING_PROG([PYTHON], [python])
  33. + AC_SUBST([PYTHON])
  34. PYTHON=$ovs_cv_python
  35. + AM_MISSING_PROG([PYTHON_HOST], [python])
  36. + PYTHON_HOST=$ovs_cv_python_host
  37. # HAVE_PYTHON is always true. (Python has not always been a build
  38. # requirement, so this variable is now obsolete.)
  39. AC_SUBST([HAVE_PYTHON])
  40. HAVE_PYTHON=yes
  41. - AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])
  42. -
  43. - AC_MSG_CHECKING([whether $PYTHON has six library])
  44. - if ! $PYTHON -c 'import six ; six.moves.range' >&AS_MESSAGE_LOG_FD 2>&1; then
  45. - AC_MSG_ERROR([Missing Python six library or version too old.])
  46. - fi
  47. - AC_MSG_RESULT([yes])])
  48. + AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])])
  49. dnl Checks for Python 3.x, x >= 4.
  50. AC_DEFUN([OVS_CHECK_PYTHON3],
  51. --
  52. 2.16.2