This adds ability to do:

  ./configure --disable-brcompat

to disable building userspace and kernel module associated with
providing linux bridge compatibility.  Sources should still be
distributed w/ make dist.

While there, update comment referring to long removed veth driver
which is now relevant for brcompat module.

Signed-off-by: Chris Wright <chr...@sous-sol.org>
---

v2:
 - changed the conditional to allow keeping linux/Modules.mk as one file
 - split build_modules and dist_modules setting to ensure brcompat
   module source is distributed
 - verified against distcheck w/ both --{disable,enable}-brcompat

 configure.ac                    |    1 +
 datapath/Modules.mk             |    2 +-
 datapath/linux/Makefile.main.in |    1 +
 datapath/linux/Modules.mk       |    4 +++-
 m4/openvswitch.m4               |   16 ++++++++++++++++
 vswitchd/automake.mk            |    9 +++++++--
 6 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index a1c1fb4..3c3b1e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,7 @@ OVS_CHECK_SOCKET_LIBS
 OVS_CHECK_LINKER_SECTIONS
 OVS_CHECK_XENSERVER_VERSION
 OVS_CHECK_GROFF
+OVS_CHECK_BRCOMPAT
 
 OVS_ENABLE_OPTION([-Wall])
 OVS_ENABLE_OPTION([-Wno-sign-compare])
diff --git a/datapath/Modules.mk b/datapath/Modules.mk
index 96e7f7d..24c1075 100644
--- a/datapath/Modules.mk
+++ b/datapath/Modules.mk
@@ -1,7 +1,7 @@
 # Some modules should be built and distributed, e.g. openvswitch.
 #
 # Some modules should be distributed but not built, e.g. we do not build
-# veth if the kernel in question already has it.
+# brcompat if configured without it
 #
 # Some modules should be built but not distributed, e.g. third-party
 # hwtable modules.
diff --git a/datapath/linux/Makefile.main.in b/datapath/linux/Makefile.main.in
index b55fc95..6b46c0c 100644
--- a/datapath/linux/Makefile.main.in
+++ b/datapath/linux/Makefile.main.in
@@ -4,6 +4,7 @@ export srcdir = @abs_srcdir@
 export top_srcdir = @abs_top_srcdir@
 export KSRC = @KBUILD@
 export VERSION = @VERSION@
+export BUILD_BRCOMPAT = @BUILD_BRCOMPAT@
 
 include $(srcdir)/../Modules.mk
 include $(srcdir)/Modules.mk
diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk
index d9a85cc..baa4196 100644
--- a/datapath/linux/Modules.mk
+++ b/datapath/linux/Modules.mk
@@ -69,6 +69,8 @@ openvswitch_headers += \
        linux/compat/include/net/netns/generic.h \
        linux/compat/genetlink.inc
 
-both_modules += brcompat
+# always distribute brcompat source regardless of local build configuration
+dist_modules += brcompat
+build_modules += $(if $(BUILD_BRCOMPAT),brcompat)
 brcompat_sources = linux/compat/genetlink-brcompat.c brcompat_main.c
 brcompat_headers =
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 9b2a5ba..23e178f 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -354,3 +354,19 @@ AC_DEFUN([OVS_CHECK_GROFF],
        ovs_cv_groff=no
      fi])
    AM_CONDITIONAL([HAVE_GROFF], [test "$ovs_cv_groff" = yes])])
+
+dnl Checks for --disable-brcompat and undefines BUILD_BRCOMPAT if it is 
specified.
+AC_DEFUN([OVS_CHECK_BRCOMPAT],
+  [AC_ARG_ENABLE(
+     [brcompat],
+     [AC_HELP_STRING([--disable-brcompat], 
+                     [Disable building brcompat])],
+     [case "${enableval}" in
+        (yes) brcompat=true; BUILD_BRCOMPAT=yes ;;
+        (no)  brcompat=false ;;
+        (*) AC_MSG_ERROR([bad value ${enableval} for --enable-brcompat]) ;;
+      esac],
+     [brcompat=true])
+   AC_SUBST([BUILD_BRCOMPAT])
+   AM_CONDITIONAL([BUILD_BRCOMPAT], [test x$brcompat = xtrue])])
+
diff --git a/vswitchd/automake.mk b/vswitchd/automake.mk
index 8319c93..a8aadd2 100644
--- a/vswitchd/automake.mk
+++ b/vswitchd/automake.mk
@@ -1,10 +1,13 @@
 sbin_PROGRAMS += vswitchd/ovs-vswitchd
+if BUILD_BRCOMPAT
+  ovs_brcompatd_8 = vswitchd/ovs-brcompatd.8
+endif
 man_MANS += \
        vswitchd/ovs-vswitchd.8 \
-       vswitchd/ovs-brcompatd.8
+       $(ovs_brcompatd_8)
 DISTCLEANFILES += \
        vswitchd/ovs-vswitchd.8 \
-       vswitchd/ovs-brcompatd.8
+       $(ovs_brcompatd_8)
 
 vswitchd_ovs_vswitchd_SOURCES = \
        vswitchd/bridge.c \
@@ -24,6 +27,7 @@ vswitchd_ovs_vswitchd_LDADD = \
 EXTRA_DIST += vswitchd/INTERNALS
 MAN_ROOTS += vswitchd/ovs-vswitchd.8.in
 
+if BUILD_BRCOMPAT
 if HAVE_NETLINK
 sbin_PROGRAMS += vswitchd/ovs-brcompatd
 vswitchd_ovs_brcompatd_SOURCES = \
@@ -33,6 +37,7 @@ vswitchd_ovs_brcompatd_SOURCES = \
 vswitchd_ovs_brcompatd_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
 endif
 MAN_ROOTS += vswitchd/ovs-brcompatd.8.in
+endif
 
 # vswitch schema and IDL
 OVSIDL_BUILT += \
-- 
1.7.7.6

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to