From: Numan Siddique
With this patch we have to configure OVN to refer to external OVS source/build
directory instead of the ovs subtree.
The new configuration options added are:
* --with-ovs-source=/path/to/ovs/source/dir
* --with-ovs-build=/path/to/ovs/build/dir
The path to these directories can also be a relative path.
Before configuring OVN, user should configure and compile OVS. If the user has
configured OVS on a different directory than the source dir, then
'with-ovs-build'
should be specified.
If ovs-build dir is not defined, then ovs-source is used.
An upcoming patch will delete the ovs subtree.
Example usage:
$ # Clone OVS repo
$cd /home/foo/ovs
$./boot.sh
$mkdir _gcc
$cd _gcc && ../configure && cd ..
$make -C _gcc
$ # Clone OVN repo
$cd /home/foo/ovn
$./boot.sh
$./configure --with-ovs-source=/home/foo/ovs/
--with-ovs-build=/home/foo/ovs/_gcc
$make
The test files ovn-controller-vtep.at, ovn-nbctl.at and ovn-sbctl.at needed to
be modified
because of this commit [1] in the openvswitch repo.
This patch also updates the tutorial/ovs-sandbox to use OVS binaries from the
OVS build
folder.
[1] -
https://github.com/openvswitch/ovs/commit/29004db273985088cdb60097bdfd4a6bc6a966d1
Acked-by: Lucas Alvares Gomes
Signed-off-by: Numan Siddique
Tested-by: Lorenzo Bianconi
---
.travis/linux-build.sh | 17 +-
.travis/osx-build.sh| 13 +-
Documentation/intro/install/general.rst | 31 ++-
Makefile.am | 24 +-
acinclude.m4| 43
configure.ac| 29 +--
controller-vtep/automake.mk | 2 +-
include/ovn/version.h.in| 28 +++
lib/ovsdb_automake.mk | 7 +-
tests/automake.mk | 6 +-
tests/ofproto-macros.at | 4 +-
tests/ovn-controller-vtep.at| 12 +-
tests/ovn-nbctl.at | 6 +-
tests/ovn-sbctl.at | 20 +-
tests/ovn.at| 158 ++--
tests/ovsdb-macros.at | 2 +-
tutorial/automake.mk| 2 +-
tutorial/ovs-sandbox| 308
18 files changed, 411 insertions(+), 301 deletions(-)
create mode 100644 include/ovn/version.h.in
diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index a20474345..37a6844ab 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -10,7 +10,18 @@ TARGET="x86_64-native-linuxapp-gcc"
function configure_ovs()
{
+git clone https://github.com/openvswitch/ovs.git ovs_src
+pushd ovs_src
./boot.sh && ./configure $* || { cat config.log; exit 1; }
+make -j4
+popd
+}
+
+function configure_ovn()
+{
+configure_ovs $*
+./boot.sh && ./configure --with-ovs-source=$PWD/ovs_src $* || \
+{ cat config.log; exit 1; }
}
OPTS="$EXTRA_OPTS $*"
@@ -28,16 +39,16 @@ fi
if [ "$TESTSUITE" ]; then
# 'distcheck' will reconfigure with required options.
# Now we only need to prepare the Makefile without sparse-wrapped CC.
-configure_ovs
+configure_ovn
-export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
+export DISTCHECK_CONFIGURE_FLAGS="$OPTS --with-ovs-source=$PWD/ovs_src"
if ! make distcheck -j4 TESTSUITEFLAGS="-j4 -k ovn" RECHECK=yes; then
# testsuite.log is necessary for debugging.
cat */_build/tests/testsuite.log
exit 1
fi
else
-configure_ovs $OPTS
+configure_ovn $OPTS
make selinux-policy
make -j4
diff --git a/.travis/osx-build.sh b/.travis/osx-build.sh
index f11d7b9af..1d6ac54af 100755
--- a/.travis/osx-build.sh
+++ b/.travis/osx-build.sh
@@ -7,10 +7,20 @@ EXTRA_OPTS=""
function configure_ovs()
{
+git clone https://github.com/openvswitch/ovs.git ovs_src
+pushd ovs_src
./boot.sh && ./configure $*
+make -j4
+popd
}
-configure_ovs $EXTRA_OPTS $*
+function configure_ovn()
+{
+configure_ovs $*
+./boot.sh && ./configure $* --with-ovs-source=$PWD/ovs_src
+}
+
+configure_ovn $EXTRA_OPTS $*
if [ "$CC" = "clang" ]; then
make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
@@ -18,6 +28,7 @@ else
make CFLAGS="$CFLAGS $BUILD_ENV"
fi
if [ "$TESTSUITE" ] && [ "$CC" != "clang" ]; then
+export DISTCHECK_CONFIGURE_FLAGS="$EXTRA_OPTS
--with-ovs-source=$PWD/ovs_src"
if ! make distcheck RECHECK=yes; then
# testsuite.log is necessary for debugging.
cat */_build/tests/testsuite.log
diff --git a/Documentation/intro/install/general.rst
b/Documentation/intro/install/general.rst
index 1d5323f76..01d545da2 100644
--- a/Documentation/intro/install/general.rst
+++ b/Documentation/intro/install/general.rst
@@ -42,9 +42,9 @@ out. This is the right branch for general development.
As of now there are no official OVN releases.
-Although building OVN, also builds OVS, it is recommended to clone
-and build