From 195b5c3563ed4ab580eed37ee2fd6a10d210012b Mon Sep 17 00:00:00 2001
From: Ben Pfaff <blp@nicira.com>
Date: Thu, 3 Dec 2009 17:06:29 -0800
Subject: [PATCH] Distribute ovsdb-idlc built sources, so Python is not
 required for build.

The Xen DDK VM does not include Python, so it's best if we don't have to
require it for the build.

The built sources are still regenerated if necessary.
---
 INSTALL.Linux        | 2 ++
 m4/openvswitch.m4    | 8 +++++---
 tests/automake.mk    | 1 +
 vswitchd/automake.mk | 1 +
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/INSTALL.Linux b/INSTALL.Linux
index 7090ce672..c0344f230 100644
--- a/INSTALL.Linux
+++ b/INSTALL.Linux
@@ -67,6 +67,8 @@ you will also need the following software:
 
     - pkg-config.  We test with version 0.22.
 
+    - Python 2.x, for x >= 4.
+
 Installation Requirements
 -------------------------
 
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index b7267438c..ceb10732c 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -236,8 +236,7 @@ AC_DEFUN([OVS_CHECK_PCRE],
 
 dnl Checks for Python 2.x, x >= 4.
 AC_DEFUN([OVS_CHECK_PYTHON],
-  [AC_ARG_VAR([PYTHON], [path to Python 2.x])
-   AC_CACHE_CHECK(
+  [AC_CACHE_CHECK(
      [for Python 2.x for x >= 4],
      [ovs_cv_python],
      [if test -n "$PYTHON"; then
@@ -260,4 +259,7 @@ else:
           done
         done
       fi])
-   PYTHON=$ovs_cv_python])
+   AM_MISSING_PROG([PYTHON], [python])
+   if test $ovs_cv_python != no; then
+     PYTHON=$ovs_cv_python
+   fi])
diff --git a/tests/automake.mk b/tests/automake.mk
index 93b187e93..6d383d71b 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -114,6 +114,7 @@ BUILT_SOURCES += tests/idltest.c tests/idltest.h
 noinst_DATA += tests/idltest.ovsschema
 DISTCLEANFILES += tests/idltest.ovsschema
 tests/idltest.c tests/idltest.h tests/idltest.ovsschema: ovsdb/ovsdb-idlc.in
+EXTRA_DIST += tests/idltest.c tests/idltest.h tests/idltest.ovsschema
 
 noinst_PROGRAMS += tests/test-reconnect
 tests_test_reconnect_SOURCES = tests/test-reconnect.c
diff --git a/vswitchd/automake.mk b/vswitchd/automake.mk
index a36d1ae5e..e7942df7e 100644
--- a/vswitchd/automake.mk
+++ b/vswitchd/automake.mk
@@ -40,3 +40,4 @@ noinst_DATA += vswitchd/vswitch-idl.ovsschema
 DISTCLEANFILES += vswitchd/vswitch-idl.ovsschema
 vswitchd/vswitch-idl.c vswitchd/vswitch-idl.h vswitchd/vswitch-idl.ovsschema: \
 	ovsdb/ovsdb-idlc.in
+EXTRA_DIST += vswitchd/vswitch-idl.c vswitchd/vswitch-idl.h vswitchd/vswitch-idl.ovsschema
-- 
2.47.0