configure: add configure option to disable building brcompat
authorChris Wright <chrisw@sous-sol.org>
Tue, 13 Mar 2012 23:21:55 +0000 (16:21 -0700)
committerJesse Gross <jesse@nicira.com>
Tue, 13 Mar 2012 23:50:42 +0000 (16:50 -0700)
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.

Cc: Jesse Gross <jesse@nicira.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
configure.ac
datapath/Modules.mk
datapath/linux/Makefile.main.in
datapath/linux/Modules.mk
m4/openvswitch.m4
vswitchd/automake.mk

index a1c1fb4..3c3b1e9 100644 (file)
@@ -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])
index 96e7f7d..24c1075 100644 (file)
@@ -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.
index b55fc95..6b46c0c 100644 (file)
@@ -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
index d9a85cc..baa4196 100644 (file)
@@ -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 =
index 9b2a5ba..d4f8fa6 100644 (file)
@@ -354,3 +354,23 @@ 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 ;;
+        (no)  brcompat=false ;;
+        (*) AC_MSG_ERROR([bad value ${enableval} for --enable-brcompat]) ;;
+      esac],
+     [brcompat=true])
+   if test x$brcompat = xtrue; then
+      BUILD_BRCOMPAT=yes
+   else
+      BUILD_BRCOMPAT=""
+   fi
+   AC_SUBST([BUILD_BRCOMPAT])
+   AM_CONDITIONAL([BUILD_BRCOMPAT], [test x$brcompat = xtrue])])
index 8319c93..861c152 100644 (file)
@@ -1,7 +1,8 @@
 sbin_PROGRAMS += vswitchd/ovs-vswitchd
-man_MANS += \
-       vswitchd/ovs-vswitchd.8 \
-       vswitchd/ovs-brcompatd.8
+man_MANS += vswitchd/ovs-vswitchd.8
+if BUILD_BRCOMPAT
+  man_MANS += vswitchd/ovs-brcompatd.8
+endif
 DISTCLEANFILES += \
        vswitchd/ovs-vswitchd.8 \
        vswitchd/ovs-brcompatd.8
@@ -24,6 +25,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 +35,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 += \