提交 634736a7 编写于 作者: D Daniel P. Berrange

Move remote protocol definition into src/remote/

When making changes to the remote protocol, src/ is always built
first, so rpcgen should live there, to avoid having to run make
in the 'daemon/' directory before building src/

* src/Makefile.am: Add rules for rpcgen, and drop -I../daemon from
  remote client build
* daemon/Makefile.am: Add -I../src/remote/ to libvirtd build
  and remove rpcgen rules
* daemon/libvirtd.c: Adapt include of remote_driver.h taking
  into account new -I flag
* daemon/remote_protocol.c, daemon/remote_protocol.h,
  daemon/remote_protocol.x: Move to src/remote/
* daemon/rpcgen_fix.pl: Move to src/remote/rpcgen_fix.pl
上级 b1be11c7
......@@ -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 <config.h>'; 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
......
......@@ -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"
......
......@@ -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 <config.h>'; 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册