From 6e037e3ca6381fa36fdf6009c4ccc97d0f041be4 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Thu, 15 Mar 2012 17:10:41 -0700 Subject: [PATCH] idl: Move vswitch-idl to libopenvswitch. This is cleaner then having multiple programs build the idl independently. Signed-off-by: Ethan Jackson --- lib/.gitignore | 3 +++ lib/automake.mk | 17 ++++++++++++++++- {vswitchd => lib}/vswitch-idl.ann | 2 +- utilities/automake.mk | 2 +- utilities/ovs-vsctl.c | 2 +- vswitchd/.gitignore | 3 --- vswitchd/automake.mk | 16 ++-------------- vswitchd/bridge.c | 2 +- vswitchd/ovs-vswitchd.c | 2 +- 9 files changed, 26 insertions(+), 23 deletions(-) rename {vswitchd => lib}/vswitch-idl.ann (87%) diff --git a/lib/.gitignore b/lib/.gitignore index 6cbaf304..ba73f285 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -4,3 +4,6 @@ /dirs.c /coverage-counters.c /ofp-errors.inc +/vswitch-idl.c +/vswitch-idl.h +/vswitch-idl.ovsidl diff --git a/lib/automake.mk b/lib/automake.mk index 3531ba97..82bafde2 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -187,7 +187,10 @@ lib_libopenvswitch_a_SOURCES = \ lib/vlandev.c \ lib/vlandev.h \ lib/vlog.c \ - lib/vlog.h + lib/vlog.h \ + lib/vswitch-idl.c \ + lib/vswitch-idl.h + nodist_lib_libopenvswitch_a_SOURCES = \ lib/dirs.c CLEANFILES += $(nodist_lib_libopenvswitch_a_SOURCES) @@ -269,6 +272,18 @@ MAN_FRAGMENTS += \ lib/vlog-syn.man \ lib/vlog.man +# vswitch IDL +OVSIDL_BUILT += \ + lib/vswitch-idl.c \ + lib/vswitch-idl.h \ + lib/vswitch-idl.ovsidl + +EXTRA_DIST += lib/vswitch-idl.ann +VSWITCH_IDL_FILES = vswitchd/vswitch.ovsschema lib/vswitch-idl.ann +lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES) + $(OVSDB_IDLC) -C $(srcdir) annotate $(VSWITCH_IDL_FILES) > $@.tmp + mv $@.tmp $@ + lib/dirs.c: lib/dirs.c.in Makefile ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \ -e 's,[@]srcdir[@],$(srcdir),g' \ diff --git a/vswitchd/vswitch-idl.ann b/lib/vswitch-idl.ann similarity index 87% rename from vswitchd/vswitch-idl.ann rename to lib/vswitch-idl.ann index 7a5cc314..e8ed743b 100644 --- a/vswitchd/vswitch-idl.ann +++ b/lib/vswitch-idl.ann @@ -6,4 +6,4 @@ # it can generate more programmer-friendly data structures. s["idlPrefix"] = "ovsrec_" -s["idlHeader"] = "\"vswitchd/vswitch-idl.h\"" +s["idlHeader"] = "\"lib/vswitch-idl.h\"" diff --git a/utilities/automake.mk b/utilities/automake.mk index 3e66aee1..0e93ffba 100644 --- a/utilities/automake.mk +++ b/utilities/automake.mk @@ -97,7 +97,7 @@ utilities_ovs_ofctl_LDADD = \ lib/libopenvswitch.a \ $(SSL_LIBS) -utilities_ovs_vsctl_SOURCES = utilities/ovs-vsctl.c vswitchd/vswitch-idl.c +utilities_ovs_vsctl_SOURCES = utilities/ovs-vsctl.c utilities_ovs_vsctl_LDADD = lib/libopenvswitch.a $(SSL_LIBS) if HAVE_NETLINK diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index db4e9102..560d747a 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -41,7 +41,7 @@ #include "stream-ssl.h" #include "sset.h" #include "svec.h" -#include "vswitchd/vswitch-idl.h" +#include "vswitch-idl.h" #include "table.h" #include "timeval.h" #include "util.h" diff --git a/vswitchd/.gitignore b/vswitchd/.gitignore index 60bacaf0..d5c239b7 100644 --- a/vswitchd/.gitignore +++ b/vswitchd/.gitignore @@ -6,6 +6,3 @@ /ovs-vswitchd.8 /ovs-vswitchd.conf.db.5 /vswitch.ovsschema.stamp -/vswitch-idl.c -/vswitch-idl.h -/vswitch-idl.ovsidl diff --git a/vswitchd/automake.mk b/vswitchd/automake.mk index 861c1526..4df5f22c 100644 --- a/vswitchd/automake.mk +++ b/vswitchd/automake.mk @@ -13,8 +13,6 @@ vswitchd_ovs_vswitchd_SOURCES = \ vswitchd/ovs-vswitchd.c \ vswitchd/system-stats.c \ vswitchd/system-stats.h \ - vswitchd/vswitch-idl.c \ - vswitchd/vswitch-idl.h \ vswitchd/xenserver.c \ vswitchd/xenserver.h vswitchd_ovs_vswitchd_LDADD = \ @@ -29,25 +27,15 @@ if BUILD_BRCOMPAT if HAVE_NETLINK sbin_PROGRAMS += vswitchd/ovs-brcompatd vswitchd_ovs_brcompatd_SOURCES = \ - vswitchd/ovs-brcompatd.c \ - vswitchd/vswitch-idl.c \ - vswitchd/vswitch-idl.h + vswitchd/ovs-brcompatd.c vswitchd_ovs_brcompatd_LDADD = lib/libopenvswitch.a $(SSL_LIBS) endif MAN_ROOTS += vswitchd/ovs-brcompatd.8.in endif # vswitch schema and IDL -OVSIDL_BUILT += \ - vswitchd/vswitch-idl.c \ - vswitchd/vswitch-idl.h \ - vswitchd/vswitch-idl.ovsidl -VSWITCH_IDL_FILES = vswitchd/vswitch.ovsschema vswitchd/vswitch-idl.ann -EXTRA_DIST += $(VSWITCH_IDL_FILES) +EXTRA_DIST += vswitchd/vswitch.ovsschema pkgdata_DATA += vswitchd/vswitch.ovsschema -vswitchd/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES) - $(OVSDB_IDLC) -C $(srcdir) annotate $(VSWITCH_IDL_FILES) > $@.tmp - mv $@.tmp $@ # vswitch E-R diagram # diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 4761cbf0..5b6976a2 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -50,7 +50,7 @@ #include "util.h" #include "unixctl.h" #include "vlandev.h" -#include "vswitchd/vswitch-idl.h" +#include "vswitch-idl.h" #include "xenserver.h" #include "vlog.h" #include "sflow_api.h" diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c index 22a26c1c..ebac1aa5 100644 --- a/vswitchd/ovs-vswitchd.c +++ b/vswitchd/ovs-vswitchd.c @@ -49,7 +49,7 @@ #include "util.h" #include "vconn.h" #include "vlog.h" -#include "vswitchd/vswitch-idl.h" +#include "vswitch-idl.h" VLOG_DEFINE_THIS_MODULE(vswitchd); -- 2.30.2