diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 2938e6c070b603c0ed6089d25e3f5c8c017ba01a..61822ec9f5e113ec7c785255cb5b8df8ad74cb2e 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -9,15 +9,14 @@ DAEMON_SOURCES = \ remote_dispatch_table.h \ remote_dispatch_args.h \ remote_dispatch_ret.h \ - remote_protocol.h remote_protocol.c + ../src/remote/remote_protocol.c AVAHI_SOURCES = \ mdns.c mdns.h DISTCLEANFILES = EXTRA_DIST = \ - remote_generate_stubs.pl rpcgen_fix.pl \ - remote_protocol.x \ + remote_generate_stubs.pl \ libvirtd.conf \ libvirtd.init.in \ libvirtd.policy-0 \ @@ -32,38 +31,6 @@ EXTRA_DIST = \ BUILT_SOURCES = -if HAVE_RPCGEN -# -# Maintainer-only target for re-generating the derived .c/.h source -# files, which are actually derived from the .x file. -# -# For committing protocol changes to CVS, the GLIBC rpcgen *must* -# be used. -# -# Support for non-GLIB rpcgen is here as a convenience for -# non-Linux people needing to test changes during dev. -# -rpcgen: - rm -f rp.c-t rp.h-t rp.c-t1 rp.c-t2 rp.h-t1 - $(RPCGEN) -h -o rp.h-t $(srcdir)/remote_protocol.x - $(RPCGEN) -c -o rp.c-t $(srcdir)/remote_protocol.x -if HAVE_GLIBC_RPCGEN - perl -w $(srcdir)/rpcgen_fix.pl rp.h-t > rp.h-t1 - perl -w $(srcdir)/rpcgen_fix.pl rp.c-t > rp.c-t1 - (echo '#include '; cat rp.c-t1) > rp.c-t2 - chmod 0444 rp.c-t2 rp.h-t1 - mv -f rp.h-t1 $(srcdir)/remote_protocol.h - mv -f rp.c-t2 $(srcdir)/remote_protocol.c - rm -f rp.c-t rp.h-t rp.c-t1 -else - chmod 0444 rp.c-t rp.h-t - mv -f rp.h-t $(srcdir)/remote_protocol.h - mv -f rp.c-t $(srcdir)/remote_protocol.c -endif -endif - -remote_protocol.c: remote_protocol.h - if WITH_LIBVIRTD sbin_PROGRAMS = libvirtd @@ -86,6 +53,7 @@ libvirtd_CFLAGS = \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/util \ -I$(top_srcdir)/src/conf \ + -I$(top_srcdir)/src/remote \ $(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \ $(POLKIT_CFLAGS) \ $(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \ @@ -189,17 +157,19 @@ remote.c: remote_dispatch_prototypes.h \ remote_dispatch_args.h \ remote_dispatch_ret.h -remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x - perl -w $(srcdir)/remote_generate_stubs.pl -p $(srcdir)/remote_protocol.x > $@ +REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x + +remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL) + perl -w $(srcdir)/remote_generate_stubs.pl -p $(REMOTE_PROTOCOL) > $@ -remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x - perl -w $(srcdir)/remote_generate_stubs.pl -t $(srcdir)/remote_protocol.x > $@ +remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL) + perl -w $(srcdir)/remote_generate_stubs.pl -t $(REMOTE_PROTOCOL) > $@ -remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x - perl -w $(srcdir)/remote_generate_stubs.pl -a $(srcdir)/remote_protocol.x > $@ +remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL) + perl -w $(srcdir)/remote_generate_stubs.pl -a $(REMOTE_PROTOCOL) > $@ -remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x - perl -w $(srcdir)/remote_generate_stubs.pl -r $(srcdir)/remote_protocol.x > $@ +remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL) + perl -w $(srcdir)/remote_generate_stubs.pl -r $(REMOTE_PROTOCOL) > $@ BUILT_SOURCES += libvirtd.logrotate diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 7a256483505fbe719d9133c12e18186d416c7aa2..f204b849d0e05902e3382e74ecf53532db596095 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -57,7 +57,7 @@ #include "dispatch.h" #include "util.h" -#include "remote/remote_driver.h" +#include "remote_driver.h" #include "conf.h" #include "event.h" #include "memory.h" diff --git a/src/Makefile.am b/src/Makefile.am index f5534d7a479c96e02c0b3a2c11ee5e9dee6b90fe..9cbec479a165adb37d2464492f32df877dad829b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -115,8 +115,10 @@ CONF_SOURCES = \ REMOTE_DRIVER_SOURCES = \ gnutls_1_0_compat.h \ remote/remote_driver.c remote/remote_driver.h \ - ../daemon/remote_protocol.c \ - ../daemon/remote_protocol.h + remote/remote_protocol.c \ + remote/remote_protocol.h + +EXTRA_DIST += remote/remote_protocol.x remote/rpcgen_fix.pl # Mock driver, covering domains, storage, networks, etc TEST_DRIVER_SOURCES = \ @@ -299,12 +301,10 @@ else noinst_LTLIBRARIES += libvirt_driver_remote.la libvirt_la_LIBADD += libvirt_driver_remote.la endif -# XXX have this depend on the daemon/ directory is bogus libvirt_driver_remote_la_CFLAGS = \ $(GNUTLS_CFLAGS) \ $(SASL_CFLAGS) \ - -I@top_srcdir@/src/conf \ - -I@top_srcdir@/daemon + -I@top_srcdir@/src/conf libvirt_driver_remote_la_LDFLAGS = \ $(GNUTLS_LIBS) \ $(SASL_LIBS) @@ -312,6 +312,38 @@ if WITH_DRIVER_MODULES libvirt_driver_remote_la_LDFLAGS += -module -avoid-version endif libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES) + +if HAVE_RPCGEN +# +# Maintainer-only target for re-generating the derived .c/.h source +# files, which are actually derived from the .x file. +# +# For committing protocol changes to CVS, the GLIBC rpcgen *must* +# be used. +# +# Support for non-GLIB rpcgen is here as a convenience for +# non-Linux people needing to test changes during dev. +# +rpcgen: + rm -f rp.c-t rp.h-t rp.c-t1 rp.c-t2 rp.h-t1 + $(RPCGEN) -h -o rp.h-t $(srcdir)/remote/remote_protocol.x + $(RPCGEN) -c -o rp.c-t $(srcdir)/remote/remote_protocol.x +if HAVE_GLIBC_RPCGEN + perl -w $(srcdir)/rpcgen_fix.pl rp.h-t > rp.h-t1 + perl -w $(srcdir)/rpcgen_fix.pl rp.c-t > rp.c-t1 + (echo '#include '; cat rp.c-t1) > rp.c-t2 + chmod 0444 rp.c-t2 rp.h-t1 + mv -f rp.h-t1 $(srcdir)/remote/remote_protocol.h + mv -f rp.c-t2 $(srcdir)/remote/remote_protocol.c + rm -f rp.c-t rp.h-t rp.c-t1 +else + chmod 0444 rp.c-t rp.h-t + mv -f rp.h-t $(srcdir)/remote/remote_protocol.h + mv -f rp.c-t $(srcdir)/remote/remote_protocol.c +endif +endif + +remote/remote_protocol.c: remote/remote_protocol.h endif if WITH_XEN diff --git a/daemon/remote_protocol.c b/src/remote/remote_protocol.c similarity index 100% rename from daemon/remote_protocol.c rename to src/remote/remote_protocol.c diff --git a/daemon/remote_protocol.h b/src/remote/remote_protocol.h similarity index 100% rename from daemon/remote_protocol.h rename to src/remote/remote_protocol.h diff --git a/daemon/remote_protocol.x b/src/remote/remote_protocol.x similarity index 100% rename from daemon/remote_protocol.x rename to src/remote/remote_protocol.x diff --git a/daemon/rpcgen_fix.pl b/src/remote/rpcgen_fix.pl similarity index 100% rename from daemon/rpcgen_fix.pl rename to src/remote/rpcgen_fix.pl