From: Chris Wright Date: Tue, 13 Mar 2012 23:21:55 +0000 (-0700) Subject: configure: add configure option to disable building brcompat X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8965755e707d97a515359a3d3732c46930d5350;p=openvswitch configure: add configure option to disable building brcompat 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 Signed-off-by: Chris Wright Acked-by: Ben Pfaff Signed-off-by: Jesse Gross --- diff --git a/configure.ac b/configure.ac index a1c1fb48..3c3b1e9a 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 96e7f7df..24c1075b 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 b55fc957..6b46c0c0 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 d9a85ccb..baa4196a 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 9b2a5baf..d4f8fa62 100644 --- a/m4/openvswitch.m4 +++ b/m4/openvswitch.m4 @@ -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])]) diff --git a/vswitchd/automake.mk b/vswitchd/automake.mk index 8319c939..861c1526 100644 --- a/vswitchd/automake.mk +++ b/vswitchd/automake.mk @@ -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 += \