# vSwitch, but it causes trouble if you switch from a version with
# foo/__init__.py into an (older) version with plain foo.py, since
# foo/__init__.pyc will cause Python to ignore foo.py.
-run_python = \
- PYTHONDONTWRITEBYTECODE=yes \
- PYTHONPATH=$(top_srcdir)/python:$$PYTHONPATH \
- $(PYTHON)
+if INCLUDE_PYTHON_COMPAT
+run_python = PYTHONPATH=$(top_srcdir)/python:$(top_srcdir)/python/compat:$$PYTHONPATH
+else
+run_python = PYTHONPATH=$(top_srcdir)/python:$$PYTHONPATH
+endif
+run_python += PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
+
ALL_LOCAL =
BUILT_SOURCES =
AC_MSG_RESULT([$BUILD_OVSDBMONITOR])
AM_CONDITIONAL([BUILD_OVSDBMONITOR], [test $BUILD_OVSDBMONITOR = yes])])
+dnl Checks for missing python modules at build time
+AC_DEFUN([OVS_CHECK_PYTHON_COMPAT],
+ [OVS_CHECK_PYTHON_MODULE([uuid])
+ if test $ovs_cv_py_uuid = yes; then
+ INCLUDE_PYTHON_COMPAT=no
+ else
+ INCLUDE_PYTHON_COMPAT=yes
+ fi
+ AC_MSG_CHECKING([whether to add python/compat to PYTHONPATH])
+ AC_MSG_RESULT([$INCLUDE_PYTHON_COMPAT])
+ AM_CONDITIONAL([INCLUDE_PYTHON_COMPAT], [test $INCLUDE_PYTHON_COMPAT = yes])])
+
# OVS_LINK2_IFELSE(SOURCE1, SOURCE2, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
# -------------------------------------------------------------
# Based on AC_LINK_IFELSE, but tries to link both SOURCE1 and SOURCE2