]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Move remote protocol definition into src/remote/
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 16 Sep 2009 15:55:16 +0000 (16:55 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 21 Sep 2009 13:41:47 +0000 (14:41 +0100)
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

daemon/Makefile.am
daemon/libvirtd.c
src/Makefile.am
src/remote/remote_protocol.c [moved from daemon/remote_protocol.c with 100% similarity]
src/remote/remote_protocol.h [moved from daemon/remote_protocol.h with 100% similarity]
src/remote/remote_protocol.x [moved from daemon/remote_protocol.x with 100% similarity]
src/remote/rpcgen_fix.pl [moved from daemon/rpcgen_fix.pl with 100% similarity]

index 2938e6c070b603c0ed6089d25e3f5c8c017ba01a..61822ec9f5e113ec7c785255cb5b8df8ad74cb2e 100644 (file)
@@ -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
 
index 7a256483505fbe719d9133c12e18186d416c7aa2..f204b849d0e05902e3382e74ecf53532db596095 100644 (file)
@@ -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"
index f5534d7a479c96e02c0b3a2c11ee5e9dee6b90fe..9cbec479a165adb37d2464492f32df877dad829b 100644 (file)
@@ -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